1 / 11

CSC 3130: Automata theory and formal languages

Fall 2008. The Chinese University of Hong Kong. CSC 3130: Automata theory and formal languages. More on DFA minimization and DFA equivalence. Andrej Bogdanov http://www.cse.cuhk.edu.hk/~andrejb/csc3130. Example.

kim
Download Presentation

CSC 3130: Automata theory and formal languages

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Fall 2008 The Chinese University of Hong Kong CSC 3130: Automata theory and formal languages More on DFA minimizationand DFA equivalence Andrej Bogdanov http://www.cse.cuhk.edu.hk/~andrejb/csc3130

  2. Example • Construct a DFA over alphabet {0, 1} that accepts those strings that end in 111 • This is big, isn’t there a smaller DFA for this? 0 0 q000 1 0 q00 1 q001 q0 1 … 0 q01 … qe 1 q101 q10 0 … 1 q1 … 1 q11 1 q111 1

  3. 0 1 1 1 1 q0 q1 q2 q3 0 0 0 Smaller DFA • Yes, we can do it with 4 states:

  4. 0 1 1 1 1 q0 q1 q2 q3 0 0 0 No smaller DFA! • Last time we saw that • In fact, it is also true that There is no DFA with 3 states for L This is the unique 4-state DFA for L

  5. Theorem • Proof outline • Suppose there are two minimal DFAs M, M’ for L • In bothM and M’, every pair of states is distinguishable The DFA M found by the minimization algorithm is the unique minimal DFA for L M M’ q0 q0’

  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: • For some strings u and v M M’ u q1 q’ q0 q0’ u, v v q2

  7. Proof outline for uniqueness • Since q1 and q2 are distinguishable, there is a string w such that • But in M’ this cannot happen! M’ M’’ u w q1 q’ w ? u, v v q2 w

  8. Testing equivalence of DFAs • Two DFAs are called equivalent if they accept the same language 0 0 q00 q0 1 0 1 q01 0 qe 1 0 q10 0 1 1 q1 0 1 q11 1 0 1 1 qA qB qC 1 0 0

  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. Example • Do the following two NFAsaccept the same language? 0,1 0 0,1 0 1 q0 q0 q1 1 1 q1 0

  11. Answer • We cannot run minimization procedure on NFAs • But we can convert both NFAs to DFA and test equivalence regularexpression NFA DFA

More Related