547 views
Consider the following grammar

$S\rightarrow Aa\mid B$

$B\rightarrow a\mid BC$

$C \rightarrow a\mid \in$

the no of productions in simplified cfg is

edited | 547 views

1.Removal of null production

S->Aa|B
B->a|B|BC
C->a

2.Removal of Unit production
S->Aa|a|BC
B->a|BC
C->a

3.Removal of useless production

S->a|BC
B->a|BC
C->a
so total 5 production in simplified CFG.

selected
0
Why you have removed S -> Aa

A is variable here??
0
But you can't reachA from S therefore we removed it
0
Do we remove, A because its definition is not present in the grammar??
0
plz give me proper explanation why A is not removed in that grammer