Question: Show that the following CFGs that use A are ambiguous: (i) S XaX X aX l bX I (ii) S aSX

Show that the following CFGs that use A are ambiguous:

(i) S → XaX
X → aX l bX I Λ

(ii) S → aSX I Λ
X → aX l a

(iii) S → aS l bS l aaS I Λ

(iv) Find unambiguous CFGs that generate these three languages.

(v) For each of these three languages, find an unambiguous grammar that generates exactly the same language except for the word Λ. Do this by not employing the symbol Λ in the CFGs at all.

Step by Step Solution

3.34 Rating (151 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

i S XaX S aSX I This is ambiguous as the premise of aSXI is SxI which is not unambiguous as per rule ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related SQL Database Programming Questions!