1 / 18

2110711 THEORY OF COMPUTATION

2110711 THEORY OF COMPUTATION. 07 NON-DETERMINISTIC FINITE AUTOMATA. IMPORTANT. We introduce a conceptual machine that occurs in practice more frequently than the transition graph. TRANSITION GRAPH. Definition A transition graph (abbreviated TG) is a 5-tuple (Q,  , q 0 ,  , A) where

Télécharger la présentation

2110711 THEORY OF COMPUTATION

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. 2110711THEORY OF COMPUTATION 07 NON-DETERMINISTIC FINITE AUTOMATA

  2. IMPORTANT • We introduce a conceptual machine that occurs in practice more frequently than the transition graph.

  3. TRANSITION GRAPH • Definition • A transition graph (abbreviated TG) is a 5-tuple (Q, , q0, , A) where • Q means a finite set of states. •  is a finite input alphabet. • q0  Q named Initial state. • A  Q , A is the set of all accepted states. •  is a function from Q* to P(Q), called transition function.

  4. TRANSITION GRAPH 1 1 q1 01 q0 0 1 001 010 q3 q2 1

  5. EXAMPLE • (0+1)*00(0+1)* 0,1 0,1 0 0 q0 q1 q2

  6. EXAMPLE • (010+101)*0(0+1)* q3 0 q2 1 0,1 1 0 q0 q1 0 0 q4 q5 1

  7. NON-DETERMINISTIC MACHINE • A nondeterministic finite state machine (NFA) is a transition graph with a unique start state and each of its edge labels is a single alphabet.

  8. NON-DETERMINISTIC MACHINE • Definition • A nondeterministic finite automaton (abbreviated NFA) is a 5-tuple (Q,,q0,A,). where • Q means a finite set of states. •  is a finite input alphabet. • q0 is in Q named Initial state. • A is a subset of Q, A is the set of all accepted states. •  is a function from Q   to P(Q) • where P(Q) is the power set of Q.

  9. NON-DETERMINISTIC MACHINE 0,1 0,1 0,1 0 A C D B *(A,00) *(A,00) = (r,0) : r *(A,0) : r  { A , B } = { A , B }  { C } = { A , B , C } How to define the transition function?

  10. NON-DETERMINISTIC MACHINE 0,1 0,1 0,1 0 A C D B *(A,010) =  (r,0) : r  *(A,01) *(A,01) =  (s,1) : s  *(A,0) : s  { A , B } = (A,1)  (B,1) = { A }  { C } : r  { A , C } *(A,010) = (A,0)  (C,0) = { A , B }  { D } = { A , B , D } *(A,010)

  11. NON-DETERMINISTIC MACHINE • For a NFA, M = (Q, , q0, , A) and any pQ, *(p,) = {p}. • For any pQ and x = a1a2a3…an  * (with n  1) • *(p, x) is the set of all states q for which • there is a sequence of states p=p0, p1p2…pn-1, pn = q satisfying : pi(pi-1,ai) for each i with 1  i  n. • String x in * is accepted by a NFA if *(q0,x)  A  . *(p,) = {p} *(p,yan) = all r*(p,y)(r,an)

  12. NON-DETERMINISTIC MACHINE • Definition • A nondeterministic finite automaton with -transition (NFA-) is a 5-tuple (Q, , q0, , A) where • Q means a finite set of states. •  is a finite input alphabet. • q0  Q named Initial state. • A  Q , A is the set of all accepted states. •  is a function from Q({}) to P(Q) • where P(Q) is the power set of Q.

  13. NON-DETERMINISTIC MACHINE • For an NFA-, M=(Q, , q0, , A) states p and q  Q and a string • x = a1a2a3…an *, we will say M moves from p to q by a sequence of transitions corresponding to x if • there exist an integer m  n, a sequence b1b2b3…bm{} • satisfying x = b1b2b3…bm and a sequence of states • p = p0, p1, p2, …, pm = q • so that for each i, 1  i  m, pi (pi-1,bi). • For x * and p  Q, *(p,x) is the set of all states q  Q such that there is a sequence of transitions corresponding to x by which M moves from p to q.

  14. -CLOSURE • Definition • Let M=(Q, , q0, , A) be a NFA-. • Let S be any subset of Q. • The -closure of S is the set (S) defined as follows: • Every element of S is an element of (S). • For any q (S), every element of (q,) is in (S). • No other elements of Q are in (S).

  15. -CLOSURE • For a NFA- M = (Q, , q0, , A). • The extended transition function *: Q *  P(Q) is defined as follows: • For any q  Q, *(q,) = ({q}) • For any q  Q, y * and a  , • *(q,ya) = (  r*(q,y)(r,a) ) • A string x is accepted by M if *(q0,x)  A  . • The language recognized by M is the set L(M) of all strings accepted by M.

  16. NON-DETERMINISTIC MACHINE • Theorem • For every nondeterministic finite state machine, there is a finite state machine accepts exactly the same language. PROOF

  17. NON-DETERMINISTIC MACHINE • Theorem • For every nondeterministic finite state machinewith -transition, there is a finite state machine accepts exactly the same language. PROOF

  18. EXERCISE • จงยกตัวอย่าง ภาษาที่บรรยายด้วยการบรรยายแบบสม่ำเสมอ ที่มี non-deterministic automaton with -transition ที่ accept ทุกสมาชิกในภาษาได้ แต่ไม่สามารถถูกยอมรับได้ด้วย non-deterministic finite automaton ที่มี accepted state เพียงสถานะเดียว

More Related