Awesome q2a theme
+1 vote
32 views

I am no able to prove if the following grammar is ambiguous.

G=({S,A,B},{A,B},P,S}

P:

S->aAB|bBA

A->bS|a

B->aS|b

Can some one help me prove it?

in Theory of Computation by (11 points) | 32 views
0

I am no able to prove if the following grammar is ambiguous.

Because the grammar is unambigous :)

0
How can I prove that?
0
Well you can try making the LL(1), LR(0) or LR(1) parsing table for it.

1 Answer

+2 votes
Best answer

The grammar is LR(0), hence it is unambiguous.

Clear pic

by (3.6k points)
selected by
0
Kindly put a “NOTE” that it is just one way proof. If, it isn’t LR1 then it doesn’t mean that it Not ambiguous. So, after so much effort of creating LR1 DFA, if it turns out to be “Not LR1”, then we are back to the original question without any progress.
Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
Welcome to GATE CSE Doubts, where you can ask questions and receive answers from other members of the community.
9,211 questions
3,186 answers
14,687 comments
96,181 users