Title: Pushdown Automata PDAs
1Pushdown AutomataPDAs
2Pushdown Automaton -- PDA
Input String
Stack
States
3Initial Stack Symbol
Stack
Stack
stack head
top
bottom
special symbol
Appears at time 0
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
9Pop from Empty Stack
input
Pop
Automaton halts!
stack
top
If the automaton attempts to pop from empty
stack then it halts and rejects input
10Non-Determinism
PDAs are non-deterministic
Allowed non-deterministic transitions
11Example PDA
PDA
12Basic Idea
2. Match the bs on input with as on stack
3. Match found
13Execution Example
Time 0
Input
Stack
current state
14Time 1
Input
Stack
15Time 2
Input
Stack
16Time 3
Input
Stack
17Time 4
Input
Stack
18Time 5
Input
Stack
19Time 6
Input
Stack
20Time 7
Input
Stack
21Time 8
Input
Stack
accept
22A 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
23Rejection Example
Time 0
Input
Stack
current state
24Rejection Example
Time 1
Input
Stack
current state
25Rejection Example
Time 2
Input
Stack
current state
26Rejection Example
Time 3
Input
Stack
current state
27Rejection Example
Time 4
Input
Stack
current state
28Rejection Example
Time 4
Input
Stack
reject
current state
29There is no accepting computation for
The string is rejected by the PDA
30Another PDA example
PDA
31Basic Idea
3. Match on input with v on stack
2. Guess middle of input
4. Match found
32Execution Example
Time 0
Input
Stack
33Time 1
Input
Stack
34Time 2
Input
Stack
35Time 3
Input
Guess the middle of string
Stack
36Time 4
Input
Stack
37Time 5
Input
Stack
38Time 6
Input
Stack
accept
39Rejection Example
Time 0
Input
Stack
40Time 1
Input
Stack
41Time 2
Input
Stack
42Time 3
Input
Guess the middle of string
Stack
43Time 4
Input
Stack
44Time 5
There is no possible transition.
Input
Input is not consumed
Stack
45Another computation on same string
Input
Time 0
Stack
46Time 1
Input
Stack
47Time 2
Input
Stack
48Time 3
Input
Stack
49Time 4
Input
Stack
50Time 5
Input
No accept state is reached
Stack
51There is no computation that accepts string
52Pushing Popping Strings
Pop string
Input symbol
Push string
53Example
input
stack
top
push string
top
pop string
Replace
54Equivalent transitions
pop
push
55Another PDA example
PDA
56Execution Example
Time 0
Input
Stack
current state
57Time 1
Input
Stack
58Time 3
Input
Stack
59Time 4
Input
Stack
60Time 5
Input
Stack
61Time 6
Input
Stack
62Time 7
Input
Stack
63Time 8
Input
Stack
accept
64Formalities for PDAs
65Transition function
66Transition function
67Formal Definition
Pushdown Automaton (PDA)
Accept states
States
Input alphabet
Stack start symbol
Transition function
Initial state
Stack alphabet
68Instantaneous Description
Current state
Current stack contents
Remaining input
69Example
Instantaneous Description
Input
Time 4
Stack
70Example
Instantaneous Description
Input
Time 5
Stack
71We write
Time 4
Time 5
72A computation
73For convenience we write
74Language of PDA
Language accepted by PDA
Initial state
Accept state
75Example
PDA
76PDA
77Therefore
PDA