Push Down Automaton

An automaton with a stack. Used to recognize CFLs.

A 7-tuple: (Q,Σ,Γ,q0,Z0,A,δ)(Q, \Sigma, \Gamma, q_0, Z_0, A, \delta)

Here:

(Q,Σ,Γ,q0,Z0,A,δ)(Q, \Sigma, \Gamma, q_0, Z_0, A, \delta)
Here:
QQ
states
Σ\Sigma
input alphabet
Γ\Gamma
stack alphabet
q0q_0
initial state
Z0Z_0
initial stack symbol
AA
accepting states
δ\delta
transition function

Stack

PDAs work with an internal stack, where elements can be pushed, popped, and replaced. The contents of the stack is expressed by a string of stack alphabet. By convention, left end of the string is the top element of the stack.

Stack is never empty. A special symbol Z0Z_0 is always the bottom-most element. It’s never removed and no additional copies of Z0Z_0 are pushed onto the stack.

Configuration

Represents current machine state. Denoted by (q,x,α)(q, x, \alpha) where:

(q,x,α)(q, x, \alpha)
Here:
qq
current state
xx
remaining input
α\alpha
stack contents

Element of Q×(Σ∪Λ)×Γ∗Q \times (\Sigma \cup {\Lambda}) \times \Gamma^*.

Transition

δ:Q×(Σ∪Λ)×Γ∗→finite subsets of Q×Γ∗δ: Q \times (\Sigma \cup {\Lambda}) \times \Gamma^* \rightarrow \text{finite subsets of }Q \times \Gamma^*

Each transition maps a configuration to a set of finite subsets of Q×Γ∗Q\times \Gamma^*.

δ(q,a,X)=(p,β)\delta (q, a, X) = (p, \beta) means, when the PDA has XX on the stack top, and gets aa as input, it moves to pp, replacing XX with ββ.

Multi-step transition is denoted using ⊢∗⊢^*.

Acceptance

2 modes.

Final State Acceptance

A string is accepted (by final state acceptance) iff it reaches a configuration with an accepting state.

(q0,x,Z0)⊢∗(q,Λ,α) where q∈A(q_0, x, Z_0) ⊢^* (q, \Lambda, \alpha) \text{ where } q \in A

Input must be fully consumed. Stack may or may not be empty.

Empty Stack Acceptance

A string is accepted (by empty stack acceptance) iff it reaches a configuration with empty stack.

Non-Determinism

When multiple transitions are possible from the same configuration. It could:

  • consume input or not
  • consume input and multiple transitions for the same input

If not, the PDA is called a Deterministic PDA or DPDA in short. A CFL is called a Determinsitic CFL or DCFL if there exists a DPDA accepting the language.

An input string is accepted iff any paths reaches final state.

Computation Tree

Represents all possible PDA execution paths. Each node is a configuration. Each branch is a non-deterministic choice.

Written by November 3, 2026 2 min read
Was this helpful?