[Section 4.1] Nondeterminism (Deterministic) FA required for every state q and every symbol σ of the alphabet to have exactly one arrow out of q labeled σ . What happens when we drop this requirement ? L = { w ∈ {a,b} * | w contains abba as a substring } Transition diagram (of this new type) :
[Section 4.1] Formal definition of an NFA A nondeterministic finite automaton (NFA) is a 5-tuple (Q, Σ ,q 0 ,A, δ ) where - Q is a finite set of states - is a finite alphabet (input symbols) Σ - q o ∈ Q is the initial state - A ⊆ Q is a set of accepting states - δ : Q × Σ → ___ is the transition function Give a formal definition of the NFA from the previous slide.
[Section 4.1] Formal definition of an NFA Defining the computation of an NFA M=(Q, Σ ,q 0 ,A, δ ). Extended transition function δ * : Q × Σ * → ____ : 1) For every q ∈ Q, let δ * (q, Λ ) = 2) For every q ∈ Q, y ∈ Σ * , and σ ∈ Σ , let δ * (q,y σ ) = We say that a string x ∈ Σ * is accepted by M if ________ . A string which is not accepted by M is rejected by M . The language accepted by M , denoted by L(M) is the set of all strings accepted by M.
[Section 4.1] NFA’s vs. FA’s Is the following statement true ? For every FA M = (Q, Σ ,q 0 ,A, δ ) there exists an NFA M 1 = (Q 1 , Σ ,q 1 ,A 1 , δ 1 ) such that L(M) = L(M 1 ).
[Section 4.1] NFA’s vs. FA’s Is the following statement true ? For every NFA M = (Q, Σ ,q 0 ,A, δ ) there exists an FA M 1 = (Q 1 , Σ ,q 1 ,A 1 , δ 1 ) such that L(M) = L(M 1 ). Example : a a b b a,b b
[Section 4.1] NFA’s vs. FA’s Thm : For every NFA M = (Q, Σ ,q 0 ,A, δ ) there exists an FA M 1 = (Q 1 , Σ ,q 1 ,A 1 , δ 1 ) such that L(M) = L(M 1 ). Construction of M 1 :
[Section 4.1] NFA’s vs. FA’s Thm : For every NFA M = (Q, Σ ,q 0 ,A, δ ) there exists an FA M 1 = (Q 1 , Σ ,q 1 ,A 1 , δ 1 ) such that L(M) = L(M 1 ). Proof that L(M) = L(M 1 ) :
[Section 4.2] NFA’s with Λ Example : NFA accepting a * b * c * .
[Section 4.2] Formal definition of an NFA- Λ A nondeterministic finite automaton with Λ -transitions (NFA- Λ ) is a 5-tuple (Q, Σ ,q 0 ,A, δ ) where - Q is a finite set of states - is a finite alphabet (input symbols) Σ - q o ∈ Q is the initial state - A ⊆ Q is a set of accepting states - δ : ______ → ___ is the transition function Give a formal definition of the NFA- Λ from the previous slide.
[Section 4.2] Formal definition of an NFA- Λ Defining the computation of an NFA- Λ M=(Q, Σ ,q 0 ,A, δ ). Extended transition function δ * : ____ → ____ : 1) For every q ∈ Q, let δ * (q, Λ ) = 2) For every q ∈ Q, y ∈ Σ * , and σ ∈ Σ , let δ * (q,y σ ) =
[Section 4.2] Formal definition of an NFA- Λ Defining the computation of an NFA- Λ M=(Q, Σ ,q 0 ,A, δ ). Extended transition function δ * : Q × Σ * → 2 Q : 1) For every q ∈ Q, let δ * (q, Λ ) = 2) For every q ∈ Q, y ∈ Σ * , and σ ∈ Σ , let δ * (q,y σ ) = Λ -closure of a set S ⊆ Q, denoted Λ (S), is the set of all states reachable from S by a sequence of Λ -transitions. Define Λ (S) :
[Section 4.2] Formal definition of an NFA- Λ Defining the computation of an NFA- Λ M=(Q, Σ ,q 0 ,A, δ ). Extended transition function δ * : Q × Σ * → 2 Q : 1) For every q ∈ Q, let δ * (q, Λ ) = Λ ( { q } ) 2) For every q ∈ Q, y ∈ Σ * , and σ ∈ Σ , let δ * (q,y σ ) = Λ ( ∪ p ∈ δ *(q,y) δ (p, σ ) ) We say that a string x ∈ Σ * is accepted by M if __________. A string which is not accepted by M is rejected by M . The language accepted by M , denoted by L(M) is the set of all strings accepted by M.
[Section 4.2] NFA- Λ ’s vs. NFA’s Is the following statement true ? For every NFA M = (Q, Σ ,q 0 ,A, δ ) there exists an NFA- Λ M 1 = (Q 1 , Σ ,q 1 ,A 1 , δ 1 ) such that L(M) = L(M 1 ).
[Section 4.2] NFA- Λ ’s vs. NFA’s Is the following statement true ? For every NFA- Λ M = (Q, Σ ,q 0 ,A, δ ) there exists an NFA M 1 = (Q 1 , Σ ,q 1 ,A 1 , δ 1 ) such that L(M) = L(M 1 ).
[Section 4.2] NFA- Λ ’s vs. NFA’s Is the following statement true ? For every NFA- Λ M = (Q, Σ ,q 0 ,A, δ ) there exists an NFA M 1 = (Q 1 , Σ ,q 1 ,A 1 , δ 1 ) such that L(M) = L(M 1 ).
[Section 4.3] Proof of Kleene’s Thm Kleene’s Thm: A language L over Σ is regular iff there exists a finite automaton that accepts L. Part 1 : For every regular language there exists an NFA- Λ accepting it.
[Section 4.3] Proof of Kleene’s Thm Kleene’s Thm: A language L over Σ is regular iff there exists a finite automaton that accepts L. Part 1 : For every regular language there exists an NFA- Λ accepting it.
[Section 4.3] Proof of Kleene’s Thm Part 2 : Any language accepted by an FA is regular. Let M=({1,2,3,…,k}, Σ ,q 0 ,A, δ ) be an FA. We will show that for every p,q,r ∈ Q, the following language is regular : L(p,q,r) = { x ∈ Σ * | δ * (p,x)=q and for every prefix y of x other than Λ and x we have δ * (p,y) ≤ r } Can we then conclude that L(M) is regular ?
[Section 4.3] Proof of Kleene’s Thm Claim : Let M=({1,2,3,…,k}, Σ ,q 0 ,A, δ ) be an FA. For every p,q,r ∈ Q, the following language is regular : L(p,q,r) = { x ∈ Σ * | δ * (p,x)=q and for every prefix y of x other than Λ and x we have δ * (p,y) ≤ r }
[Section 4.3] Proof of Kleene’s Thm Claim : Let M=({1,2,3,…,k}, Σ ,q 0 ,A, δ ) be an FA. For every p,q,r ∈ Q, the following language is regular : L(p,q,r) = { x ∈ Σ * | δ * (p,x)=q and for every prefix y of x other than Λ and x we have δ * (p,y) ≤ r }
[Section 4.3] Proof of Kleene’s Thm Claim : Let M=({1,2,3,…,k}, Σ ,q 0 ,A, δ ) be an FA. For every p,q,r ∈ Q, the following language is regular : L(p,q,r) = { x ∈ Σ * | δ * (p,x)=q and for every prefix y of x other than Λ and x we have δ * (p,y) ≤ r }
[Section 4.3] Proof of Kleene’s Thm Claim : Let M=({1,2,3,…,k}, Σ ,q 0 ,A, δ ) be an FA. For every p,q,r ∈ Q, the following language is regular : L(p,q,r) = { x ∈ Σ * | δ * (p,x)=q and for every prefix y of x other than Λ and x we have δ * (p,y) ≤ r }
Recommend
More recommend