I was reading through Context Free Grammar, and I came across ambiguous grammar. If the language produced by CFG has more then 1 parse tree, then CFG is an ambiguous grammar. Is there any way by which I can find out or prove that the grammar is Unambiguous. In general I can test some language produced by CFG and check whether more than 1 parse tree is generated from that language, to show that grammar is ambiguous. But how do I check or prove that give CFG is unambiguous?
Asked
Active
Viewed 1,170 times
0

meow
- 307
- 4
- 16
-
http://cs.stackexchange.com/questions/2320/how-to-prove-that-a-grammar-is-unambiguous and http://cs.stackexchange.com/questions/7518/how-to-show-that-given-language-is-unambiguous should help. – Dogbert Feb 02 '14 at 08:58
1 Answers
2
The ambiguity problem for CFGs is undecidable in the general case. However, there are some ways to check whether the language is likely to be ambiguous. Check this article if you want the theory of it; for something more practical, consider this or this.

Koz Ross
- 3,040
- 2
- 24
- 44