1 / 76

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.

alicelewis
Télécharger la présentation

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 - LSU

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

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

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

  5. input stack top Replace Costas Busch - LSU

  6. input stack top Push Costas Busch - LSU

  7. input stack top Pop Costas Busch - LSU

  8. input stack top No Change Costas Busch - LSU

  9. Non-Determinism PDAs are non-deterministic Allowed non-deterministic transitions Costas Busch - LSU

  10. Example PDA PDA : Costas Busch - LSU

  11. 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 - LSU

  12. Execution Example: Time 0 Input Stack current state Costas Busch - LSU

  13. Time 1 Input Stack Costas Busch - LSU

  14. Time 2 Input Stack Costas Busch - LSU

  15. Time 3 Input Stack Costas Busch - LSU

  16. Time 4 Input Stack Costas Busch - LSU

  17. Time 5 Input Stack Costas Busch - LSU

  18. Time 6 Input Stack Costas Busch - LSU

  19. Time 7 Input Stack Costas Busch - LSU

  20. Time 8 Input Stack accept Costas Busch - LSU

  21. A string is accepted if there is a computation such that: All the input is consumed AND The last state is an accepting state we do not care about the stack contents at the end of the accepting computation Costas Busch - LSU

  22. Rejection Example: Time 0 Input Stack current state Costas Busch - LSU

  23. Rejection Example: Time 1 Input Stack current state Costas Busch - LSU

  24. Rejection Example: Time 2 Input Stack current state Costas Busch - LSU

  25. Rejection Example: Time 3 Input Stack current state Costas Busch - LSU

  26. Rejection Example: Time 4 Input Stack current state Costas Busch - LSU

  27. Rejection Example: Time 4 Input Stack reject current state Costas Busch - LSU

  28. There is no accepting computation for The string is rejected by the PDA Costas Busch - LSU

  29. Another PDA example PDA : Costas Busch - LSU

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

  31. Execution Example: Time 0 Input Stack Costas Busch - LSU

  32. Time 1 Input Stack Costas Busch - LSU

  33. Time 2 Input Stack Costas Busch - LSU

  34. Time 3 Input Guess the middle of string Stack Costas Busch - LSU

  35. Time 4 Input Stack Costas Busch - LSU

  36. Time 5 Input Stack Costas Busch - LSU

  37. Time 6 Input Stack accept Costas Busch - LSU

  38. Rejection Example: Time 0 Input Stack Costas Busch - LSU

  39. Time 1 Input Stack Costas Busch - LSU

  40. Time 2 Input Stack Costas Busch - LSU

  41. Time 3 Input Guess the middle of string Stack Costas Busch - LSU

  42. Time 4 Input Stack Costas Busch - LSU

  43. Time 5 There is no possible transition. Input Input is not consumed Stack Costas Busch - LSU

  44. Another computation on same string: Input Time 0 Stack Costas Busch - LSU

  45. Time 1 Input Stack Costas Busch - LSU

  46. Time 2 Input Stack Costas Busch - LSU

  47. Time 3 Input Stack Costas Busch - LSU

  48. Time 4 Input Stack Costas Busch - LSU

  49. Time 5 Input No accept state is reached Stack Costas Busch - LSU

  50. There is no computation that accepts string Costas Busch - LSU

More Related