1 / 90

Pushdown Automata PDAs

Pushdown Automata PDAs Pushdown Automaton -- PDA Input String Stack States Initial Stack Symbol Stack Stack stack head top bottom special symbol Appears at time 0 The States Pop symbol Input symbol Push symbol input stack top Replace input stack top Push input stack

Sophia
Download Presentation

Pushdown Automata PDAs

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. Pushdown AutomataPDAs Costas Busch - RPI

  2. Pushdown Automaton -- PDA Input String Stack States Costas Busch - RPI

  3. Initial Stack Symbol Stack Stack stack head top bottom special symbol Appears at time 0 Costas Busch - RPI

  4. The States Pop symbol Input symbol Push symbol Costas Busch - RPI

  5. input stack top Replace Costas Busch - RPI

  6. input stack top Push Costas Busch - RPI

  7. input stack top Pop Costas Busch - RPI

  8. input stack top No Change Costas Busch - RPI

  9. Empty Stack input stack empty Pop top When the stack gets empty, the automaton HALTS (no more transitions after ) Costas Busch - RPI

  10. A Possible Transition input stack Pop top Costas Busch - RPI

  11. Non-Determinism PDAs are non-deterministic Allowed non-deterministic transitions Costas Busch - RPI

  12. Example PDA PDA : Costas Busch - RPI

  13. Basic Idea: • Push the a’s • on the stack 2. Match the b’s on input with a’s on stack 3. Match found Costas Busch - RPI

  14. Execution Example: Time 0 Input Stack current state Costas Busch - RPI

  15. Time 1 Input Stack Costas Busch - RPI

  16. Time 2 Input Stack Costas Busch - RPI

  17. Time 3 Input Stack Costas Busch - RPI

  18. Time 4 Input Stack Costas Busch - RPI

  19. Time 5 Input Stack Costas Busch - RPI

  20. Time 6 Input Stack Costas Busch - RPI

  21. Time 7 Input Stack Costas Busch - RPI

  22. Time 8 Input Stack accept Costas Busch - RPI

  23. A string is accepted if there is a computation such that: All the input is consumed AND The last state is an accepting state At the end of the computation, we do not care about the stack contents (the stack can be empty at the last state) Costas Busch - RPI

  24. The input string is accepted by the PDA: Costas Busch - RPI

  25. In general, is the language accepted by the PDA: Costas Busch - RPI

  26. Rejection Example: Time 0 Input Stack current state Costas Busch - RPI

  27. Rejection Example: Time 1 Input Stack current state Costas Busch - RPI

  28. Rejection Example: Time 2 Input Stack current state Costas Busch - RPI

  29. Rejection Example: Time 3 Input Stack current state Costas Busch - RPI

  30. Rejection Example: Time 4 Input Stack current state Costas Busch - RPI

  31. Rejection Example: Time 4 Input Stack reject current state Costas Busch - RPI

  32. The input string is rejected by the PDA: Costas Busch - RPI

  33. A string is rejected if there is no computation such that: All the input is consumed AND The last state is an accept state At the end of the computation, we do not care about the stack contents Costas Busch - RPI

  34. Another PDA example PDA : Costas Busch - RPI

  35. Basic Idea: • Push v • on stack 3. Match on input with v on stack 2. Guess middle of input 4. Match found Costas Busch - RPI

  36. Execution Example: Time 0 Input Stack Costas Busch - RPI

  37. Time 1 Input Stack Costas Busch - RPI

  38. Time 2 Input Stack Costas Busch - RPI

  39. Time 3 Input Guess the middle of string Stack Costas Busch - RPI

  40. Time 4 Input Stack Costas Busch - RPI

  41. Time 5 Input Stack Costas Busch - RPI

  42. Time 6 Input Stack accept Costas Busch - RPI

  43. Rejection Example: Time 0 Input Stack Costas Busch - RPI

  44. Time 1 Input Stack Costas Busch - RPI

  45. Time 2 Input Stack Costas Busch - RPI

  46. Time 3 Input Guess the middle of string Stack Costas Busch - RPI

  47. Time 4 Input Stack Costas Busch - RPI

  48. Time 5 There is no possible transition. Input Input is not consumed Stack Costas Busch - RPI

  49. Another computation on same string: Input Time 0 Stack Costas Busch - RPI

  50. Time 1 Input Stack Costas Busch - RPI

More Related