Unit 4 TAFL
Unit 4 TAFL
Unit 4 TAFL
UNIT 4
TAFL
Course Details
(B Tech 4th Sem)
• Introduction
• Push Down Automata
• Example of PDA
• Formal Definition of PDA
• Operation of PDA
• Instantons Description of PDA
• PDA Examples
• Construction of PDA from CFG
• Non Deterministic PDA
Prerequisite:
Recap:
Recap: Till now we have studied about FA and its types, Regular
Expressions and Grammar.
POP Operation:
PUSH Operation:
• For a PDA, we want to know its state and the entire content of its
stack.
– Often the stack is one of the most useful pieces of
information, since it is not bounded in size.
• Write down the IDs or moves for input string w = “aabb” of PDA
as M = ({q0, q1, q2}, {a, b}, {a, b, Z0}, δ, q0, Z0, {q2}), where δ is
defined by following rules:
Recap: Till now we have studied about basic concept and definition of
Push Down Automata.
Solution:
Stack will be used to store excess of a’s over b’s or excess of b’s
over a’s out of input seen so far.
Transition Diagram
Solution:
Step 1: Design a DFA of given language:
Recap: Till now we have studied about basic concept and definition of
Push Down Automata with examples.
Solution:
The equivalent PDA, M is given by:
M = ({q},{0,1}, {0,1,S}, δ, q, S, Φ), where δ is given by:
Recap: Till now we have studied about basic concept and definition of
Push Down Automata with examples and relationship between CFG and
PDA.
Simulation of abaaba
• δ(q1, abaaba, Z) Apply rule 1
• ⊢ δ(q1, baaba, aZ) Apply rule 5
• ⊢ δ(q1, aaba, baZ) Apply rule 4
• ⊢ δ(q1, aba, abaZ) Apply rule 7
• ⊢ δ(q2, ba, baZ) Apply rule 8
• ⊢ δ(q2, a, aZ) Apply rule 7
• ⊢ δ(q2, ε, Z) Apply rule 11
• ⊢ δ(q2, ε) Accept
1. Top down PDA first move the ……. into the stack
a. start symbol
b. input symbol
c. first symbol
d. last production
a. Shift
b. Reduce
c. Both A ad B
d. Neither A and B
a. x
b. a
c. ax
d. xa