I attempted to transform the given CFG into CNF.
$$S → ASA|A$$
$$A→aa|ε$$
Here are my steps:
$$S→X$$
$$X→XA|AX|A$$
$$A→aa$$
$$S→X$$
$$X→XA|AX|YY$$
$$A→YY$$
$$Y→a$$
$$S→XA|AX|YY$$
$$X→XA|AX|YY$$
$$A→YY$$
$$Y→a$$
Is that one a correct solution?
I attempted to transform the given CFG into CNF.
$$S → ASA|A$$
$$A→aa|ε$$
Here are my steps:
$$S→X$$
$$X→XA|AX|A$$
$$A→aa$$
$$S→X$$
$$X→XA|AX|YY$$
$$A→YY$$
$$Y→a$$
$$S→XA|AX|YY$$
$$X→XA|AX|YY$$
$$A→YY$$
$$Y→a$$
Is that one a correct solution?
Copyright © 2021 JogjaFile Inc.
Follow the steps in the following order
1)Remove ε production
2)Remove Unit Production(Non Terminal->Single Non Terminal)
Here we have unit production S->A
3)Remove Long Production(restructure the grammar such that R.H.S. have either 2 Non Terminal or single Terminal symbol)
S→AX|AS|SA|YY
X→SA
A→YY
Y→a