PDA-7 Tuple Machine
PDA-7 Tuple Machine
The Problem
● Finite automata accept precisely the regular
languages.
● We may need unbounded memory to recognize
context-free languages.
● e.g. { 0n1n| n ∈ ℕ } requires unbounded counting.
How do we build an automaton with finitely
●
many states but unbounded memory?
The finite-state
control acts as a
finite memory.
A B C A ...
a, b → z
Z0
Means “If the current input symbol
is a and the current stack symbol is b,
then follow this transition, pop b, and
push the string z. 0 0 0 1 1 1
A Simple Pushdown Automaton
0, Z0 → 0Z0
0, 0 → 00
1, 0 → ε
ε, Z0 → ε
start
0 0 0 1 1 1
A Simple Pushdown Automaton
0, Z0 → 0Z0
0, 0 → 00
1, 0 → ε
ε, Z0 → ε
start
0 0 0 1 1 1
A Simple Pushdown Automaton
0, Z0 → 0Z0
0, 0 → 00
1, 0 → ε
ε, Z0 → ε
start
0 0 0 1 1 1
A Simple Pushdown Automaton
0, Z0 → 0Z0
0, 0 → 00
1, 0 → ε
ε, Z0 → ε
start
0 0 0 1 1 1
A Simple Pushdown Automaton
0, Z0 → 0Z0
0, 0 → 00
1, 0 → ε
ε, Z0 → ε
start
0 0 0 1 1 1
Pushdown Automata
● Formally, a pushdown automaton is a nondeterministic machine
defined by the 7-tuple (Q, Σ, Γ, δ, q0, Z0, F), where
Σ, ε → Σ
ε, ε → ε
start
This transition means “don't consume any input, don't change the
top of the stack, and don't
add anything to a stack. It's the equivalent of an ε-transition in
an NFA.
A PDA for Palindromes
Σ, ε → Σ Σ, Σ → ε
ε, ε → ε
Σ, ε → ε ε, Z0 → ε
start