Page 1
Wink Notes
B.Tech CSE — 4th Semester
Theory of Automata and Formal Languages
— Unit - 4 —
1. Introduction to Pushdown Automata (PDA)
A DFA cannot count because it has no memory. It cannot recognize .
To process Context-Free Languages (CFLs), we upgrade the DFA by attaching an infinite memory structure: a Stack. This new machine is a Pushdown Automaton (PDA).
1.1 The Stack Mechanism
The memory is strictly LIFO (Last-In, First-Out). The machine can only read, push, or pop the absolute top symbol of the stack. It cannot look deep inside the stack.
How does a PDA solve ?
1. As it reads the 'a's, it PUSHES an 'A' onto the stack for every 'a' it sees.
2. When the 'b's start, for every 'b' it reads, it POPS one 'A' off the stack.
3. When the string ends, if the stack is exactly empty, it mathematically proves the number of 'a's exactly matched the 'b's.