Pushdown Automata
Pushdown Automata
Pushdown Automata
A PDA has
an input tape,
a finite control, and
a stack.
0 0 0 1 0 0 0 (input tape)
0 0 1 0 0 0 1 0
δ B
G G
q1 q1
R R
-Moves:
0 0 1 0 0 0 1 0
δ B
G G
q1 q1
R R
Instantaneous descriptions:
0 0 1 0 0 0 1 0
δ B
G G
q1 q1
R R
M = ({q1, q2}, {0, 1}, {Z0, 0, 1}, δ, q1, Z0, {}), and δ is as
follows:
M = ({q1, q2, q3}, {0, 1}, {Z0, 0, 1}, δ, q1, Z0, {q3}), and δ is
as follows:
Proof
Let M1 = (Q, Σ, Γ, δ, q0, Z0 , F), and L(M1) = L.
Construct M2= (Q{qe, q0'}, Σ, Γ{Z'}, δ', q0, Z' , {}), where
δ'(q0', , Z') ={(q0, Z0Z')},
δ'(q, a, X) = δ(q, a, X), for all q in Q, a in Σ{}, X in Γ.
For all q in F, and X in Γ {Z'}, δ'(q, , X) contains (qe, ).
For all X in Γ {Z'}, δ'(qe, , X) contains (qe, ).
Theorem 2 L = N(M2) for some PDA M2 L = L(M1) for
some PDA M1.
Proof
Let M2 = (Q, Σ, Γ, δ, q0, Z0 , {}), and N(M2) = L.
Construct M1= (Q{qf, q0'}, Σ, Γ{Z'}, δ', q0', Z', {qf}), where
δ'(q0', , Z') ={(q0, Z0Z')},
δ'(q, a, X) = δ(q, a, X), for all q in Q, a in Σ{}, X in Γ.
For all q in Q, δ'(q, , Z') contains (qf, ).
Example L ={anbn | n≧1} is a context-free language .