Module4 Push Down Automata
Module4 Push Down Automata
Chapter 5
To process input string PDA uses stack along with input, such an automata is called Push Down
Automata (PDA). PDA is defined with seven tuples, (Q, ∑, δ, Z0, ┌, IS, FS)
∑ is input alphabet
┌ is stack symbols
IS is initial state
FS is final state
Figure 5.1: Different position of stack for the input string is 100001.
In Deterministic Push Down Automata (DPDA), we are designing PDA. The design of PDA begins with
Instantaneous Description (IDs), each IDs consist of state, input string to be processed and initial symbol
of the stack (z0).
The Instantaneous Descriptions (IDs) for the given problem are as follows:
Page 5.1
PUSHDOWN AUTOMATA
By making use of the above IDs we can obtain the transition functions, which are required for the
construction of PDA.
For first transition function, ID1 is used for input transition and ID2 is used as output.
Next ID2 is the input of transition and ID3 is used for output transition function.
δ(q0, 0, 0)=q0, 00
δ(q0, 1, 0)=q0, Ɛ
δ(q0, Ɛ, z0)=q1, z0
The Instantaneous Descriptions (IDs) for the given problem are as follows
By making use of the above IDs we can obtain the transition functions, which are required to
construct the PDA.
For first transition function, ID1 is used for input transition and ID2 is used as output.
Page 5.2
PUSHDOWN AUTOMATA
Next ID2 is the input of transition and ID3 is used for output transition function.
δ(q0, b, a)=q0, Ɛ
δ(q0, Ɛ, z0)=q1, z0
The Instantaneous Descriptions (IDs) for the given problem are as follows
By making use of the above IDs we can obtain the transition functions, which are required for the
construction of a PDA.
For first transition function, ID1 is used for input transition and ID2 is used as output.
Possible transition
Next ID2 is the input of transition and ID3 is used for output transition function.
δ(q0, a, a)=q0, aa
Possible transition
δ(q0, b, b)=q0, bb
Page 5.3
PUSHDOWN AUTOMATA
δ(q0, b, a)=q0, Ɛ
δ(q0, a, b)=q0, Ɛ
δ(q0, Ɛ, z0)=q1, z0
The Instantaneous Descriptions (IDs) for the given problem are as follows
By making use of the above IDs we can obtain the transition functions, which are required to
construct the PDA.
For first transition function, ID1 is used for input transition and ID2 is used as output.
Next ID2 is the input of transition and ID3 is used for output transition function.
δ(q0, a, a)=q0, aa
δ(q0, b, a)=q0, Ɛ
δ(q0, c, c)=q0, cc
δ(q0, Ɛ, c)=q0, Ɛ
Page 5.4
PUSHDOWN AUTOMATA
δ(q0, Ɛ, z0)=q1, z0
Example 5.5: Design NPDA for the language L={wwR| w={a, b}*}.
i. Symbol of first half continues in the same state and push the symbol to top of the stack.
ii. Symbol of second half, it just changes the state and continues further.
The Instantaneous Descriptions (IDs) for the given problem are as follows
δ(q0, a, a)=q0, aa
δ(q0, a, a)=q1, a
δ(q1, a, a)=q1, Ɛ
δ(q1, Ɛ, z0)=q2, z0
Page 5.5
PUSHDOWN AUTOMATA
CFG begins with starting symbol. Therefore starting symbol in the form of transition function of PDA is
derived as:
In this case productions of CFG’s are given; we need to find out equivalent transition functions of
PDA.
Example 5.7: Convert following productions of CFG into transition function of PDA.
Before converting CFG to PDA, see that all productions are in the form of Greibach Normal form. In
Greibach Normal form there should not be undesired production and all the right hand side
production are only terminal or terminal followed by any number of variables.
Page 5.6
PUSHDOWN AUTOMATA
CFLs are closed under operator; there are different types of operators
i. Union
ii. Concatenation
iii. Star Closure
iv. Intersection of two CFLs
v. Intersection of CFL and regular language
vi. Compliment of CFLs
vii. Reversal.
viii. Substitution.
ix. Inverse Homomorphism,
i. Union:
CFL1=G1=(V1, T1, P1, S1) CFL2=( V2, T2, P2, S2)
CFL3=G3 =(V1UV2, T1UT2, P1UP2, S1|S2)
ii. Concatenation:
CFL3=G3 =(V1V2, T1T2, P1P2, S1S2)
iii. Star Closure:
CFL1=G1=(V1, T1, P1, S1)
S1=TS1|Ɛ;
iv. Intersection of two CFLs:
CFL1=L1={anbnci :n≥0, i≥0}
CFL2=L2={aibncn :n≥0, i≥0} is not a CFL
Proof:
={anbncn :n≥0}
Page 5.7
PUSHDOWN AUTOMATA
The above language is neither belongs to L1 nor L2 therefore intersection of two CFLs are not CFL.
vii. Reversal:
In this case the right hand side of production is reversed.
viii. Substitution:
h(0)= aba; h(1)= ba
h(010)=ababaaba
S(0)= {anbn:n≥0}; S(1)={aa, bb}
S(01)={anbnaa, anbnbb}
ix. Inverse Homomorphism:
Page 5.8