Lecture 09 CNF and DFA Minimization
Lecture 09 CNF and DFA Minimization
CNF
• A context-free grammar is in Chomsky normal form if every rule is
• and are any variables—except that and may not be the start variable.
• Replace any terminal in the preceding rules with the new variable and add
the rule
Example
• Add anew start variable
Example
Example
Example
Example
Final Grammar in CNF
DFA Minimization
DFA Minimization Algorithm
• Let be a DFA
• and or vice-versa.
a,b
and are equivalent.
a,b
q0 q2
0 0
Examples 1
B D
0
A 1
𝐷X 0 0
𝐶X X
𝐵X X X 1 1 E
C
𝐴X X X
𝐸𝐷𝐶 𝐵 0 0
1
1
B D
0
and are equivalent. A,C 1
0
1 E
1
0
A,B 1 1 F
C,D,E
0,1
0