You are on page 1of 22

6.

2 TWO IMPORTANT NORMAL


FORMS
CHOMSKY NORMAL FORM
GREIBACH NORMAL FORM
Edith Castro
March 27, 2014

Chomsky Normal Form


A context-free grammar is in Chomsky normal form if all
productions are of the form:
A BC
or
Aa
Where: A, B, C are variables and a is a terminal symbol.
Example 1:
Given the grammar:

P:

S AS | a,

A SA | b
The productions are of the Chomsky normal form.
2

Chomsky Normal Form


Example 2:
Given another grammar:
P:

S AS | AAS,

A SA | aa
The productions S AAS and A aa do not follow the
conditions of the Chomsky normal form. The grammar is not in the
Chomsky normal form.

Chomsky Normal Form

Chomsky Normal Form

Chomsky Normal Form

Chomsky Normal Form

Chomsky Normal Form


Example: Given the grammar with the productions:
S ABa,
A aab,
B Ac
Convert to Chomsky normal form.
Solution: We can apply the theorem 6.6. So the grammar does not
have any - productions and no unit-productions.

Chomsky Normal Form

Chomsky Normal Form


Step 1: We introduce additional variables to get the first two
productions into normal form and we get the final result:

10

11

12

13

14

15

16

17

18

19

20

21

22

You might also like