Push Down Automata

3 min read Updated Fri Apr 24 2026 07:36:29 GMT+0000 (Coordinated Universal Time)

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:

  • 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:

  • qq: current state
  • xx: remaining input
  • α\alpha: stack contents

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 (state, input, stack) 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 qA(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.

Computation Tree

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

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

Non-determinism

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

  • 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.