510 likes | 1.5k Views
NFA to DFA Conversion. Rabin and Scott (1959). Removing Nondeterminism. By simulating all moves of an NFA- λ in parallel using a DFA. λ -closure of a state is the set of states reachable using only the λ -transitions. NFA- λ. p2. λ. p1. a. p3. q1. λ. λ. p5. λ. q2. a. p4.
E N D
NFA to DFA Conversion Rabin and Scott (1959) L12NFA2DFA
Removing Nondeterminism • By simulating all moves of an NFA-λin parallel using a DFA. • λ-closure of a state is the set of states reachable using only the λ-transitions. L12NFA2DFA
NFA-λ p2 λ p1 a p3 q1 λ λ p5 λ q2 a p4 L12NFA2DFA
Transition Function L12NFA2DFA
Equivalence Construction • Given NFA-λ M, construct a DFA DM such that L(M) = L(DM). • Observe that • A node of the DFA = Set of nodes of NFA-λ • Transition of the DFA = Transition among set of nodes of NFA- λ L12NFA2DFA
{q1,…,qn} {p1,…,pm} a For every pi, there exists qj such that L12NFA2DFA
Start state of DFA = Final/Accepting state of DFA = All subsets of states of NFA-λ that contain an accepting state of the NFA-λ Dead state of DFA = L12NFA2DFA
Example a b q1 a q0 a+c*b* λ a q2 c L12NFA2DFA
{q0} {q0} {q0,q1,q2} a b c f L12NFA2DFA
{q0} {q0,q1,q2} a b c f a b {q1} c {q1,q2} a,b,c L12NFA2DFA
b {q1} a,c f c {q1} b {q1,q2} a f L12NFA2DFA
Equivalent DFA a a {q0} {q0,q1,q2} c c {q1,q2} b b,c b b a,c {q1} f a a,b,c L12NFA2DFA