Title: Pushdown Automata PDAs
1Pushdown AutomataPDAs
2Pushdown Automaton -- PDA
Input String
Stack
States
3Initial Stack Symbol
Stack
Stack
stack head
top
bottom
special symbol
4The States
Pop symbol
Input symbol
Push symbol
5input
stack
top
Replace
6input
stack
top
Push
7input
stack
top
Pop
8input
stack
top
No Change
9A Possible Transition
input
stack
empty
Pop
top
10A Bad Transition
input
Empty stack
HALT
The automaton Halts in state and Rejects the
input string
11A Bad Transition
input
Empty stack
HALT
The automaton Halts in state and Rejects the
input string
12No transition is allowed to be followed When the
stack is empty
Empty stack
13A Good Transition
input
stack
Pop
top
14Non-Determinism
These are allowed transitions in a
Non-deterministic PDA (NPDA)
15NPDA Non-Deterministic PDA
Example
16Execution Example
Time 0
Input
Stack
current state
17Time 1
Input
Stack
18Time 2
Input
Stack
19Time 3
Input
Stack
20Time 4
Input
Stack
21Time 5
Input
Stack
22Time 6
Input
Stack
23Time 7
Input
Stack
24Time 8
Input
Stack
accept
25A 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
26The input string is accepted by the NPDA
27In general,
is the language accepted by the NPDA
28NPDA example
NPDA
29Execution Example
Time 0
Input
Stack
30Time 1
Input
Stack
31Time 2
Input
Stack
32Time 3
Input
Guess the middle of string
Stack
33Time 4
Input
Stack
34Time 5
Input
Stack
35Time 6
Input
Stack
accept
36Rejection Example
Time 0
Input
Stack
37Time 1
Input
Stack
38Time 2
Input
Stack
39Time 3
Input
Guess the middle of string
Stack
40Time 4
Input
Stack
41Time 5
There is no possible transition.
Input
Input is not consumed
Stack
42Another computation on same string
Input
Time 0
Stack
43Time 1
Input
Stack
44Time 2
Input
Stack
45Time 3
Input
Stack
46Time 4
Input
Stack
47Time 5
Input
No final state is reached
Stack
48There is no computation that accepts string
49A 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
50In 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 OR The stack head moves below the bottom of
the stack
51Another NPDA example
NPDA
52Execution Example
Time 0
Input
Stack
53Time 1
Input
Stack
54Time 2
Input
Stack
55Time 3
Input
Stack
accept
56Rejection example
Time 0
Input
Stack
57Time 1
Input
Stack
58Time 2
Input
Stack
59Time 3
Input
Stack
60Time 4
Input
Stack
Halt and Reject
61Pushing Strings
Pop symbol
Input symbol
Push string
62Example
input
pushed string
stack
top
Push
63Another NPDA example
NPDA
64Execution Example
Time 0
Input
Stack
current state
65Time 1
Input
Stack
66Time 3
Input
Stack
67Time 4
Input
Stack
68Time 5
Input
Stack
69Time 6
Input
Stack
70Time 7
Input
Stack
71Time 8
Input
Stack
accept
72Formalities for NPDAs
73Transition function
74Transition function
75Formal Definition
Non-Deterministic Pushdown Automaton
NPDA
Final states
States
Input alphabet
Stack start symbol
Transition function
Initial state
Stack alphabet
76Instantaneous Description
Current state
Current stack contents
Remaining input
77Example
Instantaneous Description
Input
Time 4
Stack
78Example
Instantaneous Description
Input
Time 5
Stack
79We write
Time 4
Time 5
80A computation
81For convenience we write
82Formal Definition
Language of NPDA
Initial state
Final state
83Example
NPDA
84NPDA
85Therefore
NPDA