IT lexicon › Programming › A-normal form (ANF)

A-normal form (ANF)

Programming På svenska → Updated: 2026-11-05

An intermediate form for functional compilers in which every subexpression is named with a let, so every function argument is a trivial value.

f(g(x), h(y)) in ANF reads let a = g(x) in let b = h(y) in f(a, b). Evaluation order becomes explicit and every intermediate result has a name to reason about. Cormac Flanagan, Amr Sabry, Bruce Duba and Matthias Felleisen described it in 1993 in "The Essence of Compiling with Continuations". Their point was that most of what compilers gained by converting to CPS could be had without introducing any continuations at all.

The kinship with SSA is close. Richard Kelsey showed in 1995 that CPS and SSA translate into each other, and Andrew Appel summed it up in 1998 as "SSA is functional programming": a let binding is a definition that is never reassigned, and a local function at a join point does the same job as a φ-function.

← Back to the lexicon