











































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!












































Pushdown Automaton -- PDA
Input String
Stack
States
The States
q
1
q
2
a, b c
Input
symbol
Pop
symbol
Push
symbol
q
1
q
2
a, b c
a
b
top
input
stack
a
Replace
e
h
e
h
c
q
1
q
2
a
a
Pop
b
e
h
e
h
top
input
stack
q
1
q
2
a
a
No Change
b
e
h
e
h
b
top
input
stack
Example PDA
q
0
q
1
q
2
q
3
PDA :
n n
q
0
q
1
q
2
q
3
L ( M ) {a b : n 0 }
n n
Basic Idea:
on the stack
with a’s on stack
found
q
0
q
1
q
2
q
3
Input
a a a
b b b
Time 1
Stack
q
0
q
1
q
2
q
3
Input
Stack
a a a
b b b
a
Time 2
q
0
q
1
q
2
q
3
Input
Stack
a a a
b b b
a
a
a
Time 4
q
0
q
1
q
2
q
3
Input
a a a
b b b
Stack
a
a
a
Time 5
q
0
q
1
q
2
q
3
Input
a a a
b b b
Stack
Time 7
a
q
0
q
1
q
2
q
3
Input
a a a
b b b
Time 8
accept
Stack