recategorized by
12,639 views
22 votes
22 votes

A context-free grammar is ambiguous if:

  1. The grammar contains useless non-terminals.
  2. It produces more than one parse tree for some sentence.
  3. Some production has two non terminals side by side on the right-hand side.
  4. None of the above.
recategorized by

3 Answers

Best answer
27 votes
27 votes
An ambiguous grammar produces more than one parse tree for any string.

Correct Answer : B.
edited by
1 votes
1 votes

The correct option is B it produces more than one parse tree for some sentence
A context-free grammar is ambiguous if
1. It produces more than one parse tree for some sentence
or
2.It produces more that one leftmost derivation for some sentence
or
3. It produces more than one rightmost derivation for some sentence.

Answer:

Related questions

21 votes
21 votes
4 answers
1
makhdoom ghaya asked Nov 9, 2016
3,362 views
State whether the following statements are TRUE or FALSE:The intersection of two CFL's is also a CFL.
15 votes
15 votes
2 answers
2
makhdoom ghaya asked Nov 8, 2016
7,354 views
FORTRAN is a:Regular language.Context-free language.Context-senstive language.None of the above.
22 votes
22 votes
6 answers
3
makhdoom ghaya asked Nov 14, 2016
5,474 views
Give a regular expression over the alphabet $\{0, 1\}$ to denote the set of proper non-null substrings of the string $0110$.
14 votes
14 votes
2 answers
4
makhdoom ghaya asked Nov 9, 2016
3,947 views
State whether the following statements are TRUE or FALSE:The problem as to whether a Turing machine $M$ accepts input $w$ is undecidable.