Pushdown Automata-PDA: Prof. (DR.) K.R. Chowdhary
Pushdown Automata-PDA: Prof. (DR.) K.R. Chowdhary
Pushdown Automata-PDA: Prof. (DR.) K.R. Chowdhary
kr chowdhary TOC 1/ 7
Introduction to Pushdown Automata (PDA)
Definition
A PDA consists: a infinite tape, a read head, set of states, and a start
state. The additional components from FA are: Pushdown stack, initial
symbol on stack, and stack alphabets (). PDA M = (Q, , , s, , Z0 ),
where,
Q is finite set of states,
is finite set of terminal symbols (language alphabets),
s start state (q0 ),
is transition function: : Q ( { }) finite subset of
Q .
The transition function of a PDA is so defined, because a PDA may have
transitions without any input read.
kr chowdhary TOC 2/ 7
Introduction to PDA
The PDA has two types of storage; 1) infinite tape, just like the FA, 2)
pushdown stack, is read-write memory of arbitrary size, with the
restriction that it can be read or written at one end only.
Input tape
a a a b b b
pushdown stack
finite
control
Z0
Definition
ID (Instantaneous Description) of a PDA is: ID : Q , start-id
{q0 } {Z0}, e.g., start ID may be (q0 , ax, Z ).
kr chowdhary TOC 3/ 7
PDA Transitions
(q, a, Z ) = finite subset of {(p1 , 1 ), (p2 , 2 ), . . . , (pm , m )}. Therefore,
(pi , i ) (q, a, z)), for 1 i m.
By default, a PDA is non-derministic machine. Due to this fact, a PDA
can manipulate the stack without any input from tape. Following are
some of the transitions in PDA:
kr chowdhary TOC 4/ 7
Language recognition: an b n
A move of a PDA is defined as (q, ax, Z ) M (q , x, ), if
(q , ) (q, a, Z ). (In Z , Z is top symbol on stack)
Example
Construct a PDA to recognize L = {an b n |n 0}.
Example
Construct a PDA to recognize L = {wcw R |w {a, b}}.
kr chowdhary TOC 6/ 7
PDA moves
PDA moves
1. (q, x, ) (q , , ) (q, xy , ) (q , y , )
2. (q, xy , ) (q , y , ) (q, xy , ) (q , y , )
The case 1., above is obvious, however, the case 2., is not
guaranteed due to the trace of computation shown below.
b b
b
b b
b
b
b
stack
time
kr chowdhary TOC 7/ 7