edited
2,547 views
0 votes
0 votes
Remove unit productions from the following CFG:

S0 --> S
S --> ASA | aB | a | SA | AS | S
A-->B | S
B --> b

Solution:
if I replace S with its Right Side part, i get
S0-> ASA | aB | a | SA | AS | S
S --> ASA | aB | a | SA | AS | S
A-->b | ASA | aB | a | SA | AS | S
B --> b

How to remove this S from RHS, S->S or S0->S or A->S all are unit productions.
edited

Please log in or register to answer this question.

Related questions

1 votes
1 votes
0 answers
2
2 votes
2 votes
7 answers
3
KISHALAY DAS asked Jan 11, 2017
10,135 views