0% found this document useful (0 votes)
21 views

Lecture 23 Automata Theory - 2

Pushdown automata (PDA) are more powerful than finite state machines (FSM) as they have an additional memory component called a stack. A PDA consists of a finite set of states, input alphabet, stack alphabet, initial state, starting stack symbol, accepting states, and transition function. The transition function takes a triple as input - current state, read symbol (from input or empty), and top stack symbol. It defines the next state and whether to push or pop symbols from the stack. Graphically, PDAs are represented similar to FSMs but with the stack operations shown on the transitions.

Uploaded by

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

Lecture 23 Automata Theory - 2

Pushdown automata (PDA) are more powerful than finite state machines (FSM) as they have an additional memory component called a stack. A PDA consists of a finite set of states, input alphabet, stack alphabet, initial state, starting stack symbol, accepting states, and transition function. The transition function takes a triple as input - current state, read symbol (from input or empty), and top stack symbol. It defines the next state and whether to push or pop symbols from the stack. Graphically, PDAs are represented similar to FSMs but with the stack operations shown on the transitions.

Uploaded by

Waqas Zafar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 15

Theory Of Automata

Pushdown Automata
(Introduction)
Pushdown Automata (Introduction)
• A pushdown automata (PDA) is a way to
implement a context free grammar in a
similar way we design finite automata for
regular grammar
– It is more powerful than FSM
– FSM has a very limited memry but PDA has
more memory
– PDA= Finite state machine + A stack
Stack
• A stack is a way we arrange elements one
on top of another
• A stack does two basic opertaions:
– PUSH: A new element is added at the top of
the stack
– POP: the top element of the stack is read or
removed
Stack (Example)
Top Top

Stack Stack

PUSH POP
Stack (Example)
Top
Top
d
c Stack
c
Stack
b Push d in this stack b
a
a
Stack (Example)
Top
c
Top
d Stack
b d is removed/
Stack popped
c a
pop this stack
b
Top
a Stack b
c is removed/
a popped
Pushdown Automata (Basic Components)
• A pushdown automata has 3 basic components:
– An input tape/string
– A Finite Control Unit
– A stack with infinite size
Pushdown Automata (Formal Definition)
• A pushdown automaton (PDA) is a seven-tuple:
P = (Q, Σ, Г, δ, q0, z0, F)
where
Q A finite set of states
Σ A finite input alphabet
Г A finite stack alphabet
q0 The initial/starting state, q0 is in Q
z0 A starting stack symbol, is in Г
F A set of final/accepting states, which is a subset of Q
δ A transition function
Pushdown Automata(Transition Function)
• δ is transition function of PDA that takes as argument a
triple (three inputs) δ(q, a, X) where:
1) q is a state in Q
2) a is either an input symbol from Σ or Λ
3) X is a stack symbol, that is a member of Г
Pushdown Automata(Transition Function)
Pushdown Automata(Graphical Notation)
• Finite State Machine
a
A B

• Pushdown Automata
a, bc
A B
Pushdown Automata(Graphical Notation)
• Pushdown Automata

A B
a, bc

Input Symbol Symbol on the top This symbol is


of the stack, this pushed on to
Maybe Λ
symbol is popped the stack

Λ means the stuck is Λ means nothing


neither read nor is pushed
popped
Example

0, Λ0 1, 0Λ
a,b

Λ, Λzo 1, 0Λ Λ, zo Λ


q1 q2 q3 q4
SummingUP

You might also like