in Theory of Computation
1,549 views
1 vote
1 vote
E -> E+T

E -> T

T -> (E)

T -> i
in Theory of Computation
by
1.5k views

1 comment

is there a way to do such questions?
0
0

1 Answer

4 votes
4 votes
Best answer

E -> ET’ / i
T’ -> PT
P -> +
E -> RE’
R -> (
E’ -> ES
S -> ) 
T -> RE’
T -> i

Here the key point is E->T so don't take it T epsilon. Simply take E-->(E) hence we can solve this.

Total {E,T',P,R,E'S,T} 7 variables.

edited by

4 Comments

Hi thanks for ur analysis.

So if a cfg is to be converted to cnf, We should remove null production and unit productions.  As they will be a problem while converting.

Is it true?
0
0
Yes @gari. and CNF grammar should not contain null productions.

@joshi_nitish Infact I didn't know you can edit our answers :p haha.
1
1
Thanks @Ashwin :)
0
0

Related questions