Chapter-4 - Push Down Automata

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 13

1

CHAPTER 4: PUSHDOWN
AUTOMATA
PUSHDOWN AUTOMATA
2

  
CONT’D…
3

A schematic representation of a pushdown


automaton is given in Figure below.
CONT’D…
4

A PDA can write symbols on the stack and read


them back later.
Writing a symbol “pushes down” all the other
symbols on the stack.
At any time the symbol on the top of the stack
can be read and removed.
The remaining symbols then move back up.
Writing a symbol on the stack is often referred to
as pushing the symbol, and removing a symbol is
referred to as popping it.
CONT’D…
5

Note that all access to the stack, for both


reading and writing, may be done only at the
top.
In other words a stack is a “last in, first out”
storage device.
If certain information is written on the stack
and additional information is written
afterward, the earlier information becomes
inaccessible until the later information is
removed.
CONT’D…
6

A stack is valuable because it can hold an


unlimited amount of information.
Recall that an FA is unable to recognize the
language {0n1n|n≥0} because it cannot store
very large numbers in its finite memory.
A PDA is able to recognize this language
because it can use its stack to store the number
of 0s it has seen.
Thus the unlimited nature of a stack allows the
PDA to store numbers of unbounded size.
CONT’D…
7

The following informal description shows how the


automaton for this language works.
 Read symbols from the input.
 As each 0 is read, push it onto the stack.
 As soon as 1s are seen, pop a 0 off the stack for each 1
read.
 If reading the input is finished exactly when the stack
becomes empty of 0s, accept the input.
 If the stack becomes empty while 1s remain or if the 1s
are finished while the stack still contains 0s or if any 0s
appear in the input following 1s, reject the input.
CONT’D…
8

  
CONT’D…
9

  
The Formal Definition of PDA
10

A PDA is defined by the septuple


M = (Q, Σ, Γ, δ, q0, Z0, F),
Where
 Q: A finite set of states, like the states of a
finite automaton.
 Σ: A finite set of input symbols, also
analogous to the corresponding component of
a finite automaton.
CONT’D…
11

  
CONT’D…
12

  
CONT’D…
13

Example: Let us consider the language


L ={wwR |w is in (0 + 1)*}

You might also like