MELJUN CORTES Automata Theory (Automata7)

269 views

Published on

MELJUN CORTES Automata Theory (Automata7)

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
269
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
11
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

MELJUN CORTES Automata Theory (Automata7)

  1. 1. MELJUN P. CORTES, MBA,MPA,BSCS,ACS CSC 3130: Automata theory and formal languages More on DFA minimization and DFA equivalence MELJUN CORTES
  2. 2. Example • Construct a DFA over alphabet {0, 1} that accepts those strings that end in 111 0 0 q0 1 qε 1 0 q1 1 q00 1 q01 … q10 q11 1 … 1 1 q001 … 0 q000 q101 … 0 q111 • This is big, isn’t there a smaller DFA for this? 1
  3. 3. Smaller DFA • Yes, we can do it with 4 states: 0 q0 1 0 1 q1 0 0 q2 1 q3 1
  4. 4. No smaller DFA! • Last time we saw that There is no DFA with 3 states for L • In fact, it is also true that This is the unique 4-state DFA for L 0 q0 1 0 1 q1 0 0 q2 1 q3 1
  5. 5. Theorem The DFA M found by the minimization algorithm is the unique minimal DFA for L • Proof outline – Suppose there are two minimal DFAs M, M’ for L q0 M q0’ M’ – In both M and M’, every pair of states is distinguishable
  6. 6. Proof outline for uniqueness • If M and M’ are not the same, there must be states q1, q2 of M and q’ of M’ like this: u q1 M q0 M’ q0’ v q2 – For some strings u and v q’ u, v
  7. 7. Proof outline for uniqueness • Since q1 and q2 are distinguishable, there is a string w such that u v q1 q2 w M’ w • But in M’ this cannot happen! M’’ q’ u, v w ?
  8. 8. Testing equivalence of DFAs • Two DFAs are called equivalent if they accept the same language 0 0 q0 0 1 qε 0 1 q1 1 q01 1 q10 1 0 0 0 q11 1 0 qΑ q00 1 0 qΒ 0 1 qC 1 1
  9. 9. Testing equivalence of DFAs • How can we tell if M and M’ are equivalent? • Algorithm for testing DFA equivalence: Run DFA minimization algorithm on M Run DFA minimization algorithm on M’ Check that M and M’ are the same
  10. 10. Example • Do the following two NFAs 0 0,1 q0 0,1 1 q1 0 q0 1 1 accept the same language? q1 0
  11. 11. Answer • We cannot run minimization procedure on NFAs • But we can convert both NFAs to DFA and test equivalence regular expression NFA DFA

×