You are on page 1of 10

PUSHDOWN

AUTOMATA

-Mrs.Harini S
Assistant Professor,
Dept. of ISE,BMSCE
Acceptance of a Language by PDA
• There are two cases wherein a string w is accepted by a
PDA:
• Get the final state from the start state
• Get an empty stack from the start state
Acceptance of a Language by PDA
• Get the final state from the start state
Let M=(Q, ∑, Γ, δ, q0, Z, F) be a PDA. The language L(M) accepted
by a final state is defined as
L(M)={w | (q0,w,Z0) |-* (p, ε, α) }
For some α € Γ* , p € F and w € ∑*.
Note: when all the symbols in string w have been read and when the
machine is in the final state, the final contents of the stack are
irrelevant
• Get an empty stack from the start state
L(M)={w | (q0,w,Z0) |-* (p, ε, ε) }
For some q0, p € Q and w € ∑*.
It means when the string w is accepted by an empty stack, the final
state is irrelevant, the input should be completely read and the stack
should be empty.
Example : wCwR
Example : wCwR
Show whether the string aabCbaa is accepted by the PDA or not.

(q0, aabCbaa, Z0) |- (q0, abCbaa, aZ0)


|- (q0, bCbaa, aaZ0)
|- (q0, Cbaa, baaZ0)
|- (q1, baa, baaZ0)
|- (q1, aa, aaZ0)
|- (q1, a, aZ0)
|- (q1, Ɛ, Ɛ)

In this method, finally stack should not contain anything including Z0.
Note that q1 is not a final state and there is no final state.
Deterministic and Non-deterministic PDA
• Let M=(Q, ∑, Γ, δ, q0, Z, F) be a PDA. The PDA is
deterministic if
• 1. δ (q, a ,Z) has only one element
• 2. If δ (q, Ɛ ,Z) is not empty, then δ (q, a, Z) should be empty.
Both the conditions should be satisfied for a DPDA.

Let’s check all our PDAs that we have designed are Deterministic or
non-deterministic.
Deterministic and Non-deterministic PDA
• Is L ={wCwR | w € (a+b)*} deterministic??
Deterministic and Non-deterministic PDA

Transitions are:
δ (q0, a ,Z0) = (q0, aZ0)
δ (q0, a ,a) = (q0, aa)
δ (q0, b ,a) = (q1, Ɛ)
δ (q1, b ,a) = (q1, Ɛ)
δ (q1, Ɛ, Z0) = (q2, Z0)
Deterministic and Non-deterministic PDA

Transitions:
δ (q0, a ,Z0) = (q0, aZ0)
δ (q0, b ,Z0) = (q0, bZ0)
δ (q0, a ,a) = (q0, aa)
δ (q0, b ,b) = (q0, bb)
δ (q0, a ,b) = (q0, Ɛ)
δ (q0, b ,a) = (q0, Ɛ)
δ (q0, Ɛ, Z0) = (q1, Z0)
Deterministic and Non-deterministic PDA

You might also like