Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 9

Compiler

Construction
Lecture 6
DFA Minimization
 The generated DFA may
have a large number of
states.
 Hopcroft’s algorithm:
minimizes DFA states
2
DFA Minimization
 The generated DFA may
have a large number of
states.
 Hopcroft’s algorithm:
minimizes DFA states
3
DFA Minimization
 Idea: find groups of
equivalent states.
 All transitions from
states in one group G1
go to states in the same
group G2
4
DFA Minimization
 Idea: find groups of
equivalent states.
 All transitions from
states in one group G1
go to states in the same
group G2
5
DFA Minimization
 Construct the minimized
DFA such that there is
one state for each
group of states from the
initial DFA.
6
DFA Minimization
a a
a b b
A B D E
a
b a
b
C

b
DFA for (a | b )*abb
7
DFA Minimization
b a a
a b b
A,C B D E
a
b

Minimized DFA for (a | b )*abb

8
Lexical Analyzers
R1…R2 RE=>NFA
NFA=>DFA

Min. DFA
character Simulate Token
stream DFA stream
9

You might also like