nondeterminism
play

Nondeterminism (Deterministic) FA required for every state q and - PowerPoint PPT Presentation

[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


  1. [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) :

  2. [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.

  3. [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.

  4. [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 ).

  5. [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

  6. [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 :

  7. [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 ) :

  8. [Section 4.2] NFA’s with Λ Example : NFA accepting a * b * c * .

  9. [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.

  10. [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 σ ) =

  11. [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) :

  12. [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.

  13. [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 ).

  14. [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 ).

  15. [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 ).

  16. [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.

  17. [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.

  18. [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 ?

  19. [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 }

  20. [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 }

  21. [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 }

  22. [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