Pushdown Automata (PDA): Short Note + Core Formalism
A Pushdown Automaton (PDA) is an extension of a finite automaton that uses a stack as additional memory. In each step, the PDA uses the current state, the next input symbol (or ), and the top stack symbol to choose a transition; that transition can read the input and also push or pop stack symbols.
A PDA accepts an input string if there exists a computation path that satisfies an acceptance condition—commonly either:
- the automaton ends in an accepting state after the input is fully read, or
- the stack becomes empty after the input is fully read.
A key result is that PDA-recognized languages are exactly the context-free languages (CFLs).
Footnotes
-
Pushdown automaton - Wikipedia - Defines PDA components, transition mechanism using state, input, and top stack symbol. ↩
-
Pushdown automaton - Wikipedia - Acceptance by final state or empty stack; formal 7-tuple definition and notation. ↩
-
Pushdown Automata • Non-Context-Free Languages (TOC4 PDF) - States the theorem: a language is context-free iff some PDA recognizes it. ↩
Pushdown Automata (PDA) — example like a^n b^n
Formal Definition and Components
A PDA can be defined as a 7-tuple
where:
- is a finite set of states
- is the input alphabet
- is the stack alphabet
- is the transition relation (depends on state, input symbol or , and top-of-stack symbol; can update stack via push/pop)
- is the start state
- is the initial stack symbol
- is the set of accepting states 2
The transition mechanism is commonly described in terms of:
- reading an input symbol from
- popping the current top symbol
- pushing a (possibly empty) string onto the stack
Instantaneous Description (ID)
An instantaneous description of a PDA includes its current state, the unread portion of the input, and the current stack contents; nondeterministic PDAs may have multiple possible next IDs from the same ID.
Footnotes
-
Pushdown automaton - Wikipedia - Defines PDA components, transition mechanism using state, input, and top stack symbol. ↩ ↩2 ↩3
-
Pushdown automaton - Wikipedia - Acceptance by final state or empty stack; formal 7-tuple definition and notation. ↩
How a PDA Step Works (Stack View)
Think of the PDA as a finite controller plus a stack that supports LIFO behavior:
Keywords to remember:
- LIFO Stack
- Stack Top Symbol
- ε-Transition
- Transition Relation
Core PDA computation on an input string
- 1Step 1
Start in state with initial stack symbol and the full input string unread.
- 2Step 2
Use the current state, the next input symbol (or ), and the top stack symbol to select a rule from .
- 3Step 3
Pop the top stack symbol , then push the replacement string (which may be empty).
- 4Step 4
Move to the next state, and if the transition reads then advance input; otherwise keep input position (for ).
- 5Step 5
Accept if a computation path reaches an accepting state after consuming all input or if the stack becomes empty, depending on the PDA’s acceptance mode.
Language Power: PDA ↔ Context-Free Languages
The most important “short note” statement is the equivalence:
- A language is context-free iff there exists a PDA that recognizes it.
- Deterministic PDAs (DPDAs) recognize deterministic context-free languages (DCFLs), a proper subset of CFLs.
Determinism vs Nondeterminism
- A Nondeterministic PDA can branch; acceptance means some branch accepts.
- A Deterministic PDA (DPDA) restricts choices so that each configuration has at most one possible move; it cannot recognize all CFLs. 2
Footnotes
-
Pushdown Automata • Non-Context-Free Languages (TOC4 PDF) - States the theorem: a language is context-free iff some PDA recognizes it. ↩
-
Deterministic pushdown automaton - Wikipedia - DPDA accepts deterministic context-free languages, a proper subset of context-free languages. ↩ ↩2
-
Pushdown automaton - Wikipedia - Defines PDA components, transition mechanism using state, input, and top stack symbol. ↩ ↩2
Language classes by PDA type (high-level)
Deterministic PDAs are weaker than nondeterministic PDAs in general.
Pro Tip: What the stack is really doing
For CFLs, the stack tracks “unmatched structure” (e.g., pending ’s in or nested parentheses). The PDA can remember an unbounded amount because the stack size grows with input.
Acceptance condition matters
Two common acceptance criteria are: final accepting state vs empty stack. Many PDA definitions are equivalent up to standard transformations, but you should not mix the criteria casually in proofs.
Short examples (intuition for stack usage)
Where PDAs fit in the automata hierarchy
No stack
Finite automataRecognize regular languages."
Add one unbounded LIFO stack
Pushdown automataRecognize exactly context-free languages (CFLs)."
Unbounded tape/memory
Turing machinesRecognize recursively enumerable languages."
Knowledge Check
Which formal mechanism distinguishes a pushdown automaton (PDA) from a finite automaton?