edited by
6,571 views
33 votes
33 votes

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?

  1. $L (D) ⊂ L (G)$
  2. $L (D) ⊃ L (G)$
  3. $L (D) = L (G)$
  4. $L (D)$ is empty
edited by

3 Answers

Best answer
54 votes
54 votes

Correct Option: C

$L (D) = L (G).$ Both must represent same language. Also,  if we are converting  a grammar from ambiguous to unambiguous form, we must  ensure that our new new grammar represents the same language as previous grammar.

For ex $G1: S \rightarrow Sa\mid aS\mid a;$ $\{$Ambiguous $(2$ parse trees for string '$aa$'$)\}$

$G1': S \rightarrow aS\mid a;$ $\{$Unambiguous$\}$

Both represent the language represented by the regular expression: $a^+$

edited by
Answer:

Related questions

46 votes
46 votes
5 answers
3