This presentation introduces pushdown automata (PDA). A PDA is a nondeterministic finite state automaton that has an additional stack. It can perform epsilon transitions and manipulate symbols on the stack. PDAs have states, an initial stack symbol, and transitions that can pop, push or replace symbols on the stack. The presentation provides an example of a nondeterministic PDA and traces its execution on an input string to demonstrate how it works. A string is accepted if the PDA reaches a final state after consuming all input, regardless of the stack contents.
14. a, a
b, a
0q q1 q2 q3
Execution Example:
Input
a a a b b b
current
state
b, a
Time 0
, , $ $
Stack
$
15. a, a
b, a q0 q1 q2 q3
Input
a a a b b b
b, a
Time 1
, , $ $
Stack
$
16. a, a
b, a q0 q1 q2 q3
Input
Stack
a a a b b b
$
a
b, a
Time 2
, , $ $
17. a, a
b, a q0 q1 q2 q3
Input
Stack
a a a b b b
$
a
a
b, a
Time 3
, , $ $
18. a, a
b, a q0 q1 q2 q3
Input
Stack
a a a b b b
$
a
a
a
b, a
Time 4
, , $ $
19. a, a
b, a q0 q1 q2 q3
Input
a a a b b b
Stack
$
a
a
a
b, a
Time 5
, , $ $
20. a, a
b, a q0 q1 q2 q3
Input
a a a b b b
$
a
Stack
b, a
Time 6
, , $ $
a
21. a, a
b, a q0 q1 q2 q3
Input
a a a b b b
$
Stack
b, a
Time 7
, , $ $
a
22. a, a
b, a q0 q1 q2 q3
Input
a a a b b b
b, a
Time 8
accept
, , $ $
$
Stack
23. A string is accepted if there is
a computation such that:
• All the input is consumed
• The last state is a final state
At the end of the computation,
we do not care about the stack contents
The Language of PDA