1 / 93

Formal Languages Push-Down Automata (PDAs)

Formal Languages Push-Down 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.

creidy
Télécharger la présentation

Formal Languages Push-Down 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. Formal Languages Push-Down Automata (PDAs)

  2. Pushdown Automaton -- PDA Input String Stack States

  3. Initial Stack Symbol Stack Stack stack head top bottom special symbol Appears at time 0

  4. The States Pop symbol Input symbol Push symbol

  5. input stack top Replace

  6. input stack top Push

  7. input stack top Pop

  8. input stack top No Change

  9. Empty Stack input stack empty Pop top The automaton HALTS No possible transition after

  10. A Possible Transition input stack Pop top

  11. Non-Determinism PDAs are non-deterministic Allow non-deterministic transitions

  12. Example PDA: Basic Idea? PDA

  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

  14. Execution Example: Time 0 Input Stack current state

  15. Time 1 Input Stack

  16. Time 2 Input Stack

  17. Time 3 Input Stack

  18. Time 4 Input Stack

  19. Time 5 Input Stack

  20. Time 6 Input Stack

  21. Time 7 Input Stack

  22. Time 8 Input Stack accept

  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)

  24. The input string is accepted by the PDA:

  25. In general, is the language accepted by the PDA:

  26. Rejection Example: Time 0 Input Stack current state

  27. Rejection Example: Time 1 Input Stack current state

  28. Rejection Example: Time 2 Input Stack current state

  29. Rejection Example: Time 3 Input Stack current state

  30. Rejection Example: Time 4 Input Stack current state

  31. Rejection Example: Time 4 Input Stack reject current state

  32. The input string is rejected by the PDA:

  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

  34. Another PDA example: Language? PDA

  35. Another PDA example PDA

  36. Basic Idea: • Push v • on stack 3. Match on input with v on stack 2. Guess middle of input 4. Match found

  37. Execution Example: Time 0 Input Stack

  38. Time 1 Input Stack

  39. Time 2 Input Stack

  40. Time 3 Input Guess the middle of string Stack

  41. Time 4 Input Stack

  42. Time 5 Input Stack

  43. Time 6 Input Stack accept

  44. Rejection Example: Time 0 Input Stack

  45. Time 1 Input Stack

  46. Time 2 Input Stack

  47. Time 3 Input Guess the middle of string Stack

  48. Time 4 Input Stack

  49. Time 5 There is no possible transition. Input Input is not consumed Stack

  50. Another computation on same string: Input Time 0 Stack

More Related