06 - Lecture 6 The fundamental theorem Let L Then the following three statements are equivalent 1 L is accepted by some DFA 2 L is accepted by some

Info iconThis preview shows pages 1–8. Sign up to view the full content.

View Full Document Right Arrow Icon
Lecture 6: The fundamental theorem Let L Σ . Then the following three statements are equiv- alent. 1. L is accepted by some DFA. 2. L is accepted by some NFA. 3. L can be represented by a regular expression Proof : We will prove the following: i) 1 2, ii) 2 3. i) 1 2 1 2: A DFA is an NFA, by de±nition. 1
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
The fundamental theorem To prove that 2 1 : This is a constructive proof. First, let’s work on a simple NFA that does not contain e -edges. q 01 q q 2 b a b a It is possible to go from one state to several states after con- suming one input symbol. Hence, the states now are subsets of K : δ ab { q 0 } { q 1 }∅ { q 1 } ∅{ q 0 ,q 2 } { q 0 2 } { q 0 1 { q 0 1 } { q 1 }{ q 0 2 } ∅∅ How do we decide the ±nal states? 2
Background image of page 2
What if the given NFA has some e edges? Idea: On reading a Σ, the DFA M ± imitates a move of the NFA M on a , possibly follows a ±nite number of e -moves. s --> q1 --> q2 --> q3 --> q4 --> q5 -> q6 -> q7 -> q8 e eaee b e e Initial state is { s, q 1 ,q 2 } . δ ( { s, q 1 2 } ,a )= { q 3 4 5 } δ ( { q 3 4 5 } ,b { q 6 7 8 } 3
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
The fundamental theorem Defne E ( q ) = the set oF states reachable From q , without reading any input symbols = { p K | ( q, e ) ± M ( p, e ) } Example: 2 3 4 0 1 5 6 7 e e e e e e a b e e 9 10 a 8 b b E (0) = { 0 , 1 , 2 , 4 , 7 } E (1) = { 1 , 2 , 4 } E (2) = { 2 } E (3) = { 3 , 6 , 1 , 2 , 4 , 7 } E (4) = { 4 } E (5) = { 5 , 6 , 7 , 1 , 2 , 4 } E (6) = { 6 , 7 , 1 , 2 , 4 } E (7) = { 7 } E (8) = { 8 } E (9) = { 9 } E (10) = { 10 } 4
Background image of page 4
The fundamental theorem Given an NFA M = { K, Σ , Δ ,s,F } . We want to construct an equivalent DFA that accepts the same language: M ± = { K ± , Σ ± ,s ± ,F ± } K ± =2 K s ± = E ( s ) F ± = { Q K ± | Q F ² = ∅} for all Q K ± , σ Σ, δ ± ( Q, σ )= S q Q { E ( p ):( q, σ, p ) Δ } . Note: δ ± ( Q, σ )mayequa ls for some Q K ± , σ Σ. Some Q ’s are unreachable thus are irrelevant, so we start the construction from E ( s ) and only introduce a new state when it is reachable from the start state (equivalently, con- struct the transition table row by row). 5
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Refer to the given NFA: a b E (0) = { 0 , 1 , 2 , 4 , 7 } E (3) E (9) = { 3 , 6 , 1 , 2 , 4 , 7 , 9 } E (5) = { 5 , 6 , 7 , 1 , 2 , 4 } { 3 , 6 , 1 , 2 , 4 , 7 , 9 } E (3) E (9) = { 3 , 6 , 1 , 2 , 4 , 7 , 9 } E (5) E (10) = { 5 , 6 , 7 , 1 , 2 , 4 , 10 } { 5 , 6 , 7 , 1 , 2 , 4 } E (9) E (3) = { 3 , 6 , 1 , 2 , 4 , 7 , 9 } E (5) = { 5 , 6 , 7 , 1 , 2 , 4 } { 5 , 6 , 7 , 1 , 2 , 4 , 10 } E (9) E (3) = { 3 , 6 , 1 , 2 , 4 , 7 , 9 } E (5) E (10) = { 5 , 6 , 7 , 1 , 2 , 4 , 8 } { 5 , 6 , 7 , 1 , 2 , 4 , 8 } E (9) E (3) = { 3 , 6 , 1 , 2 , 4 , 7 , 9 } E (5) = { 5 , 6 , 7 , 1 , 2 , 4 } 5, 6, 7, 1, 2, 4 8 5, 6, 7, 1, 2, 4 10 0, 1, 2, 4, 7 a a b a b b a a b 3, 6, 1, 2, 4 5, 6, 7, 1, 2, 4 9 7, 6
Background image of page 6
To be rigorous, we should also show that (i) M ± is deterministic and (ii) L ( M )= L ( M ± ). We only sketch the proof here (refer to textbook for details).
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 8
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 09/22/2011 for the course COMP 272 taught by Professor Prof.tai during the Spring '10 term at HKUST.

Page1 / 21

06 - Lecture 6 The fundamental theorem Let L Then the following three statements are equivalent 1 L is accepted by some DFA 2 L is accepted by some

This preview shows document pages 1 - 8. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online