ISRO Scientist/Engineer CSE 2020Compiler Design › Not yet assigned to a topic
ISRO Scientist/Engineer CSE 2020 PYQ: A given grammar is called ambiguous if
A given grammar is called ambiguous if
- Atwo or more productions have the same non-terminal on the left hand side
- Ba derivation tree has more than one associated sentence
- Cthere is a sentence with more than one derivation tree corresponding to itCorrect answer
- Dbrackets are not present in the grammar
Answer
(C) there is a sentence with more than one derivation tree corresponding to it
Approach
Recall the standard definition of ambiguity in formal language theory: a context-free grammar is ambiguous when at least one string in its language can be generated by two or more distinct parse (derivation) trees. Evaluate each option against this definition.
Reviewed by ISRO IQ Editorial Team.