


















































































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
q
1
q
2
a
a
Pop
top
input
stack
A Possible Transition
b
Non-Determinism
q
1
q
2
a, b c
q
3
a, b c
q
1
q
2
transition
PDAs are non-deterministic
Allowed non-deterministic transitions
a, a b, a
q 0 q 1 q 2 q 3
, $ $
L ( M ) { a b : n 0 } n n Basic Idea: Push the a’s on the stack
with a’s on stack
found
0
q
q
1
q
2
q
3
Execution Example:
Input
a a a
b b b
current
state
Time 0
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
Time 3
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
a
Stack
Time 6
a