Name :Dweep SarkerID:CSE-052-06625
Subject : Theory of computing
Assignment 2: Is the following grammar ambiguous?SAS | ε
AA1 | 0A1 | 01
• Left most derivation:
Parse Tree: S
00111001111101 SSASAASS
A
0 A
A 1
1
10
• Another , Left most derivation :
Parse Tree: 001110011111010 SSASAASS
A
SA
S
1
1
1
A
0
0
The two left most derivation is same, so this Grammar is Ambigous.To move ambigous
01101
AAAAA
SASS
01|10|1
|
FFFPPPA
TTATS
Parse Tree:
The unique derivation tree is : 00111
S
TA
1P
0
10
1F