1 / 27

COSC 3340: Introduction to Theory of Computation

COSC 3340: Introduction to Theory of Computation. University of Houston Dr. Verma Lecture 11. Push Down Automaton (PDA). Language Acceptor Model for CFLs It is an NFA with a stack. Finite State control. Input. Accept/Reject. Stack. PDA (contd.). In one move the PDA can :

clover
Download Presentation

COSC 3340: Introduction to 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. COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 11 UofH - COSC 3340 - Dr. Verma

  2. Push Down Automaton (PDA) • Language Acceptor Model for CFLs • It is an NFA with a stack. Finite State control Input Accept/Reject Stack UofH - COSC 3340 - Dr. Verma

  3. PDA (contd.) • In one move the PDA can : • change state, • consume a symbol from the input tape or ignore it • pop a symbol from the stack or ignore it • push a symbol onto the stack or not • A string is accepted provided the machine when started in the start state consumes the string and reaches a final state. UofH - COSC 3340 - Dr. Verma

  4. PDA (contd.) • If PDA in state q can consume u, pop x from stack, change state to p, and push w on stack we show it as u, x  w q0 q1 u, x ; w In JFLAP UofH - COSC 3340 - Dr. Verma

  5. Example of a PDA • PDA L = {anbn|n  0} Push S to the stack in the beginning and then pop it at the end before accepting. UofH - COSC 3340 - Dr. Verma

  6. JFLAP Simulation UofH - COSC 3340 - Dr. Verma

  7. JFLAP Simulation UofH - COSC 3340 - Dr. Verma

  8. JFLAP Simulation UofH - COSC 3340 - Dr. Verma

  9. JFLAP Simulation UofH - COSC 3340 - Dr. Verma

  10. JFLAP Simulation UofH - COSC 3340 - Dr. Verma

  11. JFLAP Simulation UofH - COSC 3340 - Dr. Verma

  12. JFLAP Simulation UofH - COSC 3340 - Dr. Verma

  13. JFLAP Simulation UofH - COSC 3340 - Dr. Verma

  14. JFLAP Simulation UofH - COSC 3340 - Dr. Verma

  15. JFLAP Simulation UofH - COSC 3340 - Dr. Verma

  16. JFLAP Simulation UofH - COSC 3340 - Dr. Verma

  17. JFLAP Simulation UofH - COSC 3340 - Dr. Verma

  18. JFLAP Simulation UofH - COSC 3340 - Dr. Verma

  19. JFLAP Simulation UofH - COSC 3340 - Dr. Verma

  20. JFLAP Simulation UofH - COSC 3340 - Dr. Verma

  21. JFLAP Simulation UofH - COSC 3340 - Dr. Verma

  22. JFLAP Simulation UofH - COSC 3340 - Dr. Verma

  23. JFLAP Simulation UofH - COSC 3340 - Dr. Verma

  24. JFLAP Simulation UofH - COSC 3340 - Dr. Verma

  25. Definition of PDA • Formally, a PDAM = (K, , , , s, F), where • K -- finite set of states •  -- is the input alphabet •  -- is the tape alphabet • sK -- is the start state • FK -- is the set of final states •  (K X  X ) X (K X ) UofH - COSC 3340 - Dr. Verma

  26. Definition of L(M) • Define * as: (1) *(q, w, x) = {(q, w, x)}  {(p, w, x) | ((q, , ), (p, )) } (2) *(q, uv, xy) = U {*(p, v, wy) | ((q, u, x), (p, w)) } [at least one of u, x, w is not equal to ] • i.e., first compute * for all successor configurations and then take the union of all those sets • Macceptsw if (f, , x) in *(s, w, ) • Alternative: if (f, ,  )in *(s, w, ) [we use] • L(M) = {w* | M accepts w} UofH - COSC 3340 - Dr. Verma

  27. Example • What is L(M)? Push S to the stack in the beginning and then pop it at the end before accepting. UofH - COSC 3340 - Dr. Verma

More Related