0% found this document useful (0 votes)
38 views18 pages

Understanding Pushdown Automata (PDA)

The document provides an overview of Pushdown Automata (PDA), detailing its formalism, including states, input and stack alphabets, transition functions, and actions for both deterministic and non-deterministic PDAs. It includes examples of constructing PDAs for specific languages, such as recognizing patterns and well-formed parentheses. Additionally, it illustrates state transition diagrams for various PDA configurations.

Uploaded by

pranay4352
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views18 pages

Understanding Pushdown Automata (PDA)

The document provides an overview of Pushdown Automata (PDA), detailing its formalism, including states, input and stack alphabets, transition functions, and actions for both deterministic and non-deterministic PDAs. It includes examples of constructing PDAs for specific languages, such as recognizing patterns and well-formed parentheses. Additionally, it illustrates state transition diagrams for various PDA configurations.

Uploaded by

pranay4352
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Pushdown Automata

C. M. Pandit
Pushdown Automaton -- PDA
Input String
Unbounded Tape .
Left end is fixed
and unbounded Stack
towards right

States
Pictorial Representation of PDA
PDA Formalism
A PDA is described by:
● A finite set of states (Q, typically).

● An input alphabet (Σ, typically).

● A stack alphabet (Γ, typically).

● A transition function (δ, typically).

δ: Q X Σ X Γ → Q X Γ*
(Transition function for DPDA)
● A start state (q0, in Q, typically).

● A start symbol (Z0, in Γ, typically).

● A set of final states (F ⊆ Q, typically).


The Transition Function
δ(q, a, Z) = (p, γ)
Takes three arguments:
● A state, in Q.

● An input, which is either a symbol in Σ or ε.

● A stack symbol in Γ.

δ(q, a, Z) is a set of zero or more actions of the


form (p, γ).
● p is a state; γ is a string of stack symbols.
Actions of the DPDA
Actions of the NPDA
Construct PDA that recognizes the language accepted by the DFA

Regular Expression for given DFA


b a R = b*aa*(bb* a a*)*
- + a

L = {ba, baba, babaa, aaaaa, .....}


b
Fig .a
Start
b
b a b a a b
b
a blank
Read 1 Read 2 Accept
Note: For blank use symbol' b'

blank a

Reject

Fig. 1 DPDA equivalent to DFA shown in fig . a


Construct PDA that recognizes the language accepted by the DFA

a Start
1 a 3
b 2
- + a,b
b
b blank
Fig. b
Read 1
R = b*aa(a*b*)* Reject
b a
L = {aa, bbaababb,aaab,…..}
blank
Read 2
For blank use symbol' b'
a
a,b
blank
Read 3 Accept

Fig. 2 DPDA equivalent to DFA shown in fig . b


Construct a PDA that accepts the following language
L = {anbn|n>=0}

L = {epsilon,ab,aabb,aaabbb,aaaabbbb,aaaaabbbbb,…….}

a a a b b b blank

a
a
a
blank
Construct a PDA that accepts the following language
L = {anbn|n>=0}
L = {Epsilon, ab, aabb, aaabbb, aaaabbbb, ....} For blank use symbol' b'

Start rejected
a
b
blank blank
a Accept
Push a Read 1 Pop 2

b
b blank
a read2
pop1

b blank
a
reject

Fig. 3 PDA that accept {anbn|n>=0}


The edges labelled in the form 'a,Z/γ '
where 'a' is the input symbol read, 'Z'
denotes the topmost stack symbol;
and γ denotes the stack string after
transition is complete.
State transition diagram for PDA that accepts
{anbn|n>=0} by empty stack.

State transition diagram for PDA that accepts


{anbn|n>=0} by final state.
Design a PDA that checks for well-formed parentheses.
L = {Epsilon, (), (()), (()()), ....}

Start For blank use symbol' b'

(
( )
Push ( Read 1 pop1 Reject
blank

blank

(
Pop 2

blank

Accept

Fig. 4 DPDA that that checks for well-formed parentheses.

You might also like