Simplification of CFG
Useless productions
Null productions
Unit production
S -> ABC|a
A -> b
B -> c
C -> d
E -> e
F -> f
G -> g
Answers
Answered by
1
Answer:S -> abS | abA | abB
A -> cd
B -> aB
C -> dc
Explanation:
The definition of context free grammars (CFGs) allows us to develop a wide variety of grammars. Most of the time, some of the productions of CFGs are not useful and are redundant. This happens because the definition of CFGs does not restrict us from making these redundant productions.
By simplifying CFGs we remove all these redundant productions from a grammar , while keeping the transformed grammar equivalent to the original grammar. Two grammars are called equivalent if they produce the same language. Simplifying CFGs is necessary to later convert them into Normal forms.
Similar questions