Chomsky Normal Form
Chomsky Normal Form
in Automata
Normal Forms-
• By reducing the grammar, the grammar gets minimized but does not gets
standardized.
• This is because the RHS of productions have no specific format.
• In order to standardize the grammar, normalization is performed using normal forms.
A context free grammar is said to be in chomsky normal form (CNF) if all its productions are of the
form-
A → BC or A → a
where A, B, C are non-terminals and a is a terminal.
Example-
S → AB
A→a
B→b
Steps-
The following steps are followed to standardize the grammar using CNF-
Rule-01:
Rule-02:
Replace each production of the form A → B1B2B3….Bn where n > 2 with A → B1C where
C → B2B3….Bn.
Repeat this step for all the productions having more than two variables on RHS.
Rule-03:
Problem-01:
Solution-
Step-01:
Step-03:
This is done by introducing the following two new productions in the grammar-
Ca → a ………..(5)
Cb → b ………..(6)
Step-04:
This is done by introducing the following two new productions in the grammar-
CAD → AD ………..(9)
CAB → AB ………..(10)
Step-05:
From (1), (2), (5), (6), (9), (10), (11) and (12), the resultant grammar is-
S → CaCAD
A → CaB / CbCAB
B→b
D→d
Ca → a
Cb → b
CAD → AD
CAB → AB