Convert the contextfree grammar to Chomsky Normal Form where
Convert the context-free grammar
to Chomsky Normal Form, where P consists of the rules:
Show your work...
Solution
A CFG is in chomsky normal form if the productions are in the following forms:
A -> a
A - > epsilon
A -> BC.
Add these productions to given rules:
Aa -> a
Bb -> b
Cc -> c
The grammar becomes:
S -> Sab C | Sac
C -> CcC | epsilon
Sab -> Aa SabB | epsilon
Sac -> Aa Sac C | B
B -> Bb B | epsilon
also add..
S1 -> Aa Sab
S2 -> Aa Sac
New grammar becomes:
Aa -> a
Bb -> b
Cc -> c
S -> Sab C | Sac
C -> CcC | epsilon
Sab -> S1B | epsilon
Sac -> S2 C | B
B -> Bb B | epsilon
S1 -> Aa Sab
S2 -> Aa Sac

