Professional Documents
Culture Documents
Chapter 6
Chomsky Normal Forms and Greibach Normal
Form
Text Book: Peter Linz, Introduction to Formal Languages and automata 6th edition, 2017.
This presentation is for academic use only in Taibah University, KSA
Removing Productions
Removing Productions
Step 01: To remove A→ B, add production A→x to grammar rule whenever B→x
occurs in the grammar where [x belong to terminal, x can also be Null]
Step 3: Repeat from step 1 until all unit productions are removed.
Example:
S 0A|1B|C
A 0S|00
B 1|A CFG becomes:
C 01 S 0A|1B|01
A 0S|00
Step 1 B 1|0S|00
S C is unit production but while removing S C, C 01
we have to consider what C gives so we can add a rule to S.
S 0A|1B|01
Step 2
B A is also unit production
B 1|0S|00
Chomsky Normal Form
𝜆
Example 1
Chomsky Normal Form
:Conversion of CFG to CNF steps
𝜆 𝜆 𝜆
Example 2
Example 3
𝜆
𝜆
𝜆
𝜆 𝜆
𝜆
Example 4
C
Greibach Normal Form
Greibach Normal Form
Example 1
Example 2
Exercises:
Section 6.2: 2, 3, 4, 5