1.

A CFG is ambiguous if(a) It has more than one rightmost derivations(b) It has more than one leftmost derivations(c) No parse tree can be generated for the CFG(d) None of the mentionedThe question was posed to me in final exam.The query is from Ambiguous Grammar in section Context Free Grammars and Languages of Automata Theory

Answer»

Correct choice is (B) It has more than one leftmost derivations

Explanation: A context FREE grammar is ambiguous if it has more than one PARSE tree generated or more than one leftmost derivations. An unambiguous grammar is a context free grammar for which EVERY valid string has a unique leftmost DERIVATION.



Discussion

No Comment Found

Related InterviewSolutions