Pushdown Automata PDAs Costas Busch - RPI
Pushdown Automaton -- PDA Input String Stack States Costas Busch - RPI
Formal Definition Non-Deterministic Pushdown Automaton NPDA Final states States Input alphabet Stack start symbol Transition function Initial state Stack alphabet Costas Busch - RPI
Initial Stack Symbol Stack Stack stack head top bottom special symbol Costas Busch - RPI
The States Pop symbol Input symbol Push symbol Costas Busch - RPI
input stack top Replace Costas Busch - RPI
input stack top Push Costas Busch - RPI
input stack top Pop Costas Busch - RPI
input stack top No Change Costas Busch - RPI
A Possible Transition input stack empty Pop top Costas Busch - RPI
The automaton Halts in state and Rejects the input string A Bad Transition input Empty stack HALT The automaton Halts in state and Rejects the input string Costas Busch - RPI
The automaton Halts in state and Rejects the input string A Bad Transition input Empty stack HALT The automaton Halts in state and Rejects the input string Costas Busch - RPI
No transition is allowed to be followed When the stack is empty Empty stack Costas Busch - RPI
A Good Transition input stack Pop top Costas Busch - RPI
Non-Determinism These are allowed transitions in a Non-deterministic PDA (NPDA) Costas Busch - RPI
NPDA: Non-Deterministic PDA Example: Costas Busch - RPI
Execution Example: Time 0 Input Stack current state Costas Busch - RPI
Time 1 Input Stack Costas Busch - RPI
Time 2 Input Stack Costas Busch - RPI
Time 3 Input Stack Costas Busch - RPI
Time 4 Input Stack Costas Busch - RPI
Time 5 Input Stack Costas Busch - RPI
Time 6 Input Stack Costas Busch - RPI
Time 7 Input Stack Costas Busch - RPI
Time 8 Input Stack accept Costas Busch - RPI
A string is accepted if there is a computation such that: All the input is consumed AND The last state is a final state At the end of the computation, we do not care about the stack contents Costas Busch - RPI
is accepted by the NPDA: The input string is accepted by the NPDA: Costas Busch - RPI
is the language accepted by the NPDA: In general, is the language accepted by the NPDA: Costas Busch - RPI
Another NPDA example NPDA Costas Busch - RPI
Execution Example: Time 0 Input Stack Costas Busch - RPI
Time 1 Input Stack Costas Busch - RPI
Time 2 Input Stack Costas Busch - RPI
Time 3 Input Guess the middle of string Stack Costas Busch - RPI
Time 4 Input Stack Costas Busch - RPI
Time 5 Input Stack Costas Busch - RPI
Time 6 Input Stack accept Costas Busch - RPI
Rejection Example: Time 0 Input Stack Costas Busch - RPI
Time 1 Input Stack Costas Busch - RPI
Time 2 Input Stack Costas Busch - RPI
Time 3 Input Guess the middle of string Stack Costas Busch - RPI
Time 4 Input Stack Costas Busch - RPI
There is no possible transition. Input Time 5 There is no possible transition. Input Input is not consumed Stack Costas Busch - RPI
Another computation on same string: Input Time 0 Stack Costas Busch - RPI
Time 1 Input Stack Costas Busch - RPI
Time 2 Input Stack Costas Busch - RPI
Time 3 Input Stack Costas Busch - RPI
Time 4 Input Stack Costas Busch - RPI
Time 5 Input No final state is reached Stack Costas Busch - RPI
There is no computation that accepts string Costas Busch - RPI
A string is rejected if there is no computation such that: All the input is consumed AND The last state is a final state At the end of the computation, we do not care about the stack contents Costas Busch - RPI
In other words, a string is rejected if in every computation with this string: The input cannot be consumed OR The input is consumed and the last state is not a final state The stack head moves below the bottom of the stack Costas Busch - RPI
Another NPDA example NPDA Costas Busch - RPI
Execution Example: Time 0 Input Stack Costas Busch - RPI
Time 1 Input Stack Costas Busch - RPI
Time 2 Input Stack Costas Busch - RPI
Time 3 Input Stack accept Costas Busch - RPI
Rejection example: Time 0 Input Stack Costas Busch - RPI
Time 1 Input Stack Costas Busch - RPI
Time 2 Input Stack Costas Busch - RPI
Time 3 Input Stack Costas Busch - RPI
Time 4 Input Stack Halt and Reject Costas Busch - RPI
Pushing Strings Pop symbol Input symbol Push string Costas Busch - RPI
Example: input pushed string stack top Push Costas Busch - RPI
Another NPDA example NPDA Costas Busch - RPI
Execution Example: Time 0 Input Stack current state Costas Busch - RPI
Time 1 Input Stack Costas Busch - RPI
Time 3 Input Stack Costas Busch - RPI
Time 4 Input Stack Costas Busch - RPI
Time 5 Input Stack Costas Busch - RPI
Time 6 Input Stack Costas Busch - RPI
Time 7 Input Stack Costas Busch - RPI
Time 8 Input Stack accept Costas Busch - RPI
Formalities for NPDAs Costas Busch - RPI
Transition function: Costas Busch - RPI
Transition function: Costas Busch - RPI
Formal Definition Non-Deterministic Pushdown Automaton NPDA Final states States Input alphabet Stack start symbol Transition function Initial state Stack alphabet Costas Busch - RPI