Push Down Automata
•The PDA will have input tape, finite control and stack.
TOS Z0
Stack
• The input tape is divided in many cells.
• The finite control has some pointer which points to the current symbol
which is to be read.
• At the end of the input $ or blank symbol is placed to identify the end
of input.
• Here Stack will be used to store the items temporarily.
A A B B $
Finite
Control
3.
Definition of aPDA
• A pushdown automaton (PDA) is a seven-tuple:
M = (Q, Σ, Г, δ, q0, z0, F)
Q A finite set of states
Σ A finite input alphabet
Г A finite stack alphabet
q0 The initial/starting state, q0 is in Q
z0 A starting stack symbol, is in Г // need not always remain at the bottom
of stack
F A set of final/accepting states, which is a subset of Q
δ A transition function, where
For DPDA δ: Q x (Σ U {ε}) x Г –> finite subsets of Q x Г*
For NDPDA δ: Q x (Σ U {ε}) x Г –> finite subsets of 2Q x Г*
4.
Push Down Automata
•Any language which is accepted by a F.A. can also accepted by PDA.
• PDA can also accepts the class of languages which are not accepted by F.A.,
Thus PDA is much more superior to F.A.
Example: Design a PDA for accepting the Language L= {an
bn
|n>=1}.
Solution:
The above given language is in which equal number of a’s are followed by
equal number of b’s.
Logic for PDA:
1. Push all a’s onto the stack
2. On reading every single b pop one a from the stack.
3. If the input string is reached end and the stack is empty then the string is
accepted by the PDA.
Transition function InstantaniousDescription
• The Description for the PDA can
be given as follows.
(q0,a,z0)=(q0,az0)
(q0,a,a)=(q0,aa)
(q0,b,a)=(q1, )
Ꜫ
(q1,b,a)=(q1, )
Ꜫ
(q1,$, z0)=(q2, )
Ꜫ
Where q0 is start state and q2 is
accept state.
• Simulation of PDA for the input string aaabbb
as follows
(q0,aaabbb,z0)Ͱ(q0,aabbb,az0)
Ͱ(q0,abbb,aaz0)
Ͱ(q0,bbb,aaaz0)
Ͱ(q1,bb,aaz0)
Ͱ(q1,b,az0)
Ͱ(q1,ε, z0)
Ͱ(q2, Ꜫ)
Accept State
Hence the string is accepted by the PDA.