1 / 30

Pushdown Automata

CSC 4170 Theory of Computation. Pushdown Automata. Section 2.2. 2.2.a. Components of a pushdown automaton (PDA). Stack. Input. a a b a c …. x y x z. Push : write a symbol on the top of the stack Pop : delete a symbol from the top of the stack. a,x  y. (Q,  ,  ,  ,s,F). q1.

eudora
Download Presentation

Pushdown Automata

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. CSC 4170 Theory of Computation Pushdown Automata Section 2.2

  2. 2.2.a Components of a pushdown automaton (PDA) Stack Input a a b a c … x y x z . . . Push: write a symbol on the top of the stack Pop: delete a symbol from the top of the stack a,xy (Q,,,,s,F) q1 q2 If the input symbol is a and the top stack symbol is x, go from q1 to q2, pop x and push y Q is the set of states  is the input alphabet  is the stack alphabet  is the transition function s is the start state FQ is the set of accept states If a=, the read head is not advanced If x=, nothing is popped If y=, nothing is pushed

  3. 2.2.b1 How a PDA works ,$ 0,0 q1 q2 1,0   1,0  q3 q4 ,$  0 0 0 1 1 1 Stack Input

  4. 2.2.b2 How a PDA works ,$ 0,0 q1 q2 1,0   1,0  q3 q4 ,$  0 0 0 1 1 1 $ Stack Input

  5. 2.2.b3 How a PDA works ,$ 0,0 q1 q2 1,0   1,0  q3 q4 ,$  0 $ 0 0 0 1 1 1 Stack Input

  6. 2.2.b4 How a PDA works ,$ 0,0 q1 q2 1,0   1,0  q3 q4 ,$  0 0 $ 0 0 0 1 1 1 Stack Input

  7. 2.2.b5 How a PDA works ,$ 0,0 q1 q2 1,0   1,0  q3 q4 ,$  0 0 0 $ 0 0 0 1 1 1 Stack Input

  8. 2.2.b6 How a PDA works ,$ 0,0 q1 q2 1,0   1,0  q3 q4 ,$  0 0 $ 0 0 0 1 1 1 Stack Input

  9. 2.2.b7 How a PDA works ,$ 0,0 q1 q2 1,0   1,0  q3 q4 ,$  0 $ 0 0 0 1 1 1 Stack Input

  10. 2.2.b8 How a PDA works ,$ 0,0 q1 q2 1,0   1,0  q3 q4 ,$  0 0 0 1 1 1 $ Stack Input

  11. 2.2.b9 How a PDA works ,$ 0,0 q1 q2 1,0   1,0  q3 q4 ,$  Accept 0 0 0 1 1 1 Stack Input

  12. 2.2.b10 How a PDA works ,$ 0,0 q1 q2 1,0   1,0  q3 q4 ,$  What language does this automaton recognize?

  13. 2.2.b11 How a PDA works ,$ 0,0 q1 q2 1,0   1,0  q3 q4 ,$  0 0 1 Stack Input

  14. 2.2.b12 How a PDA works ,$ 0,0 q1 q2 1,0   1,0  q3 q4 ,$  0 0 1 $ Stack Input

  15. 2.2.b13 How a PDA works ,$ 0,0 q1 q2 1,0   1,0  q3 q4 ,$  0 $ 0 0 1 Stack Input

  16. 2.2.b14 How a PDA works ,$ 0,0 q1 q2 1,0   1,0  q3 q4 ,$  0 0 $ 0 0 1 Stack Input

  17. 2.2.b15 How a PDA works ,$ 0,0 q1 q2 1,0   1,0  q3 q4 ,$  Reject 0 $ 0 0 1 Stack Input

  18. 2.2.b16 How a PDA works ,$ 0,0 q1 q2 1,0   1,0  q3 q4 ,$  0 1 1 Stack Input

  19. 2.2.b17 How a PDA works ,$ 0,0 q1 q2 1,0   1,0  q3 q4 ,$  $ 0 1 1 Stack Input

  20. 2.2.b18 How a PDA works ,$ 0,0 q1 q2 1,0   1,0  q3 q4 ,$  0 $ 0 1 1 Stack Input

  21. 2.2.b19 How a PDA works ,$ 0,0 q1 q2 1,0   1,0  q3 q4 ,$  $ 0 1 1 Stack Input

  22. 2.2.b20 How a PDA works ,$ 0,0 q1 q2 1,0   1,0  q3 q4 ,$  Reject 0 1 1 Stack Input

  23. 2.2.b21 How a PDA works ,$ 0,0 q1 q2 1,0   1,0  q3 q4 ,$  0 1 0 Stack Input

  24. 2.2.b22 How a PDA works ,$ 0,0 q1 q2 1,0   1,0  q3 q4 ,$  $ 0 1 0 Stack Input

  25. 2.2.b23 How a PDA works ,$ 0,0 q1 q2 1,0   1,0  q3 q4 ,$  0 $ 0 1 0 Stack Input

  26. 2.2.b24 How a PDA works ,$ 0,0 q1 q2 1,0   1,0  q3 q4 ,$  $ 0 1 0 Stack Input

  27. 2.2.b25 How a PDA works ,$ 0,0 q1 q2 1,0   1,0  q3 q4 ,$  Reject 0 1 0 Stack Input

  28. 2.2.c Designing pushdown automata Design a pushdown automaton that recognizes the language {w | w has an equal number of 0s and 1s} 0 = s 1

  29. 2.2.d Converting NFA into PDA Every NFA can be understood as a PDA that never pushes or pops. Just replace every label a of the NFA by a, 1 1 b b,  a , a, a a, a b a, b, 2 3 2 3

  30. 2.2.e Main theorems Theorem 2.20:A language is context-free iff some pushdown automaton recognizes it. Theorem:Not every nondeterministic PDA has an equivalent deterministic PDA. Example 2.18:There is a nondeterministic PDA recognizing {wwR | w{0,1}* } (wR means w reversed), but no deterministic PDA can recognize this language. Proofs omitted.

More Related