485 views

2 Answers

1 votes
1 votes
Step 1: First we remove all those variable who can't derive a terminal string

               so we remove productions C ->cCD

Step 2: Now we remove all those variables who can't be reached from the start symbol

            so we remove production D -> ddd
0 votes
0 votes
C can never terminate

after removing C ,D can’t be reached

the remaining grammer is

 

S→  a | aA | B,

 A→  aB |  λ,

B→Aa

after solving λ productions

S→  a | aA | B,

 A→  aB

B→Aa

now unit productions

S→  a | aA | Aa,

 A→  aAa

B→Aa

and now we can’t reach to B so we can remove it also

S→  a | aA | Aa,

 A→  aAa

Related questions

0 votes
0 votes
0 answers
1
0 votes
0 votes
0 answers
2