assn
5
Name :Dweep Sarker ID:CSE-052-06625 Subject : Theory of computing Assignment 2: Is the following grammar ambiguous? SAS | ε AA1 | 0A1 | 01
-
Upload
dweep-sarker -
Category
Documents
-
view
30 -
download
0
Transcript of assn
![Page 1: assn](https://reader036.fdocuments.us/reader036/viewer/2022083113/58ede97a1a28ab422a8b45a7/html5/thumbnails/1.jpg)
Name :Dweep SarkerID:CSE-052-06625
Subject : Theory of computing
Assignment 2: Is the following grammar ambiguous?SAS | ε
AA1 | 0A1 | 01
![Page 2: assn](https://reader036.fdocuments.us/reader036/viewer/2022083113/58ede97a1a28ab422a8b45a7/html5/thumbnails/2.jpg)
• Left most derivation:
Parse Tree: S
00111001111101 SSASAASS
A
0 A
A 1
1
10
![Page 3: assn](https://reader036.fdocuments.us/reader036/viewer/2022083113/58ede97a1a28ab422a8b45a7/html5/thumbnails/3.jpg)
• Another , Left most derivation :
Parse Tree: 001110011111010 SSASAASS
A
SA
S
1
1
1
A
0
0
![Page 4: assn](https://reader036.fdocuments.us/reader036/viewer/2022083113/58ede97a1a28ab422a8b45a7/html5/thumbnails/4.jpg)
The two left most derivation is same, so this Grammar is Ambigous.To move ambigous
01101
AAAAA
SASS
01|10|1
|
FFFPPPA
TTATS
![Page 5: assn](https://reader036.fdocuments.us/reader036/viewer/2022083113/58ede97a1a28ab422a8b45a7/html5/thumbnails/5.jpg)
Parse Tree:
The unique derivation tree is : 00111
S
TA
1P
0
10
1F