Consider an ambiguous grammar G and its disambiguated version D. Let the…
2007
Consider an ambiguous grammar G and its disambiguated version D. Let the language recognized by the two grammars be denoted by L(G) and L(D) respectively. Which one of the following is true ?
- A.
L (D) ⊂ L (G)
- B.
L (D) ⊃ L (G)
- C.
L (D) = L (G)
- D.
L (D) is empty
Attempted by 25 students.
Show answer & explanation
Correct answer: C
Disambiguating a grammar means resolving ambiguities in its production rules without changing the language it generates. The disambiguated version D is constructed to produce the same set of strings as the original grammar G, but with unambiguous parse trees. Therefore, L(D) must equal L(G). The correct option is C, which states L(D) = L(G), matching the fundamental property of grammar disambiguation.