2. Group Members:
1. Muradul Islam Jamil (152-35-1203)
2. Mahadi Hasan Joy (152-35-1207)
3. Mazed Mourshed (152-35-1215)
Md. Anwar Hossen
Lecturer, Dept. of Software Engineering
Daffodil International University
2
3. AMBIGUITY IN CFG
If a context free grammar has more than one derivation tree
for some string, it is called an ambiguous grammar. There
exist multiple right-most or left-most derivations for some
string generated from
that grammar.
3
7. SOLUTION
Let’s find out the derivation tree for the string “a+a+a". It has two leftmost d
i) S → S + S → S + S + S → a + a + S → a + a + a
ii) S → S + S → S + S + S → S + a + a → a + a + a
7
8. SOLUTION
Let’s find out the derivation tree for the string “a+a*a". It has two leftmost de
i) S → S + S → a + S → a + S * S → a + a * a
ii) S → S * S → S + S * S → a + a * S → a + a * a
8