Skip to the reading
QuodlibetA deep study · The Combinators · §II

Confluence promises one answer — order decides whether you reach it

The Order

The λ-calculus is confluent: a term has at most one normal form, however you reduce it. This is a theorem of great reassurance and a source of a subtle trap, because confluence guarantees the uniqueness of the answer without guaranteeing that any given path reaches it. Some orders of reduction find the normal form; others spin forever a step away from it. This study is about that gap — the strategies of evaluation, the fixed-point combinator that works under one order and fails under another, the theorem that names a strategy which never misses, and the theory of optimal reduction that lies, unexpectedly deep, beneath the plain question of how few steps a computation needs.

the problem of order · name & value · the value-safe fixed point · standardization · sharing · optimal reduction · the fixed point in motion

Companion volumes of The Combinators have treated the fixed-point combinator as a static object — a term satisfying the equation Y f = f (Y f), the constructive shadow of Lawvere's theorem, the diagonal λx.x x wrapped so as to manufacture fixed points on demand. The Plural gave the family of such combinators and the confluence that keeps their answers coherent; The Operator gave the denotational fixed point they compute. This movement takes up what neither did: not what the fixed point is but how it runs.

The question is order. We begin with the fact that makes order matter — confluence secures a unique normal form, yet a reduction may diverge with that normal form in plain sight. We set the two archetypal strategies against each other, call-by-name and call-by-value, and watch the ordinary fixed-point combinator thrive under the first and loop uselessly under the second. We build the repair — Plotkin's call-by-value combinator, which guards its recursion behind a λ so that the unfolding waits for an argument. We prove the theorem that rescues the whole enterprise: standardization, and its corollary that normal-order reduction finds the normal form whenever one exists. We follow the efficiency the safe strategy costs, and its recovery through sharing and call-by-need. And we reach the theory of optimal reduction, where the innocent question — what is the least work a normalization can take? — opens onto sharing graphs, linear logic, and the geometry of interaction, and returns a famously double-edged answer. A live reducer runs throughout, so that every claim about order is a reduction you can watch, not a diagram you must trust.

I · the problem of order

A unique answer you may never reach

The Church–Rosser theorem is the calculus's great guarantee of coherence: reduce a term any way you like and the results can always be reconciled, so a normal form, if it exists, is unique. What the theorem does not say — and this is the whole of the present subject — is that any particular way of reducing will find it.

Confluence first, since everything here is measured against it.

confluence — the Church–Rosser theorem
If M ↠ N₁ and M ↠ N₂, then there is a term P with N₁ ↠ P and N₂ ↠ P. Divergent reductions can always be brought back together. Corollary: every term has at most one normal form — if M reduces to two normal forms, confluence reconciles them, and a normal form reduces only to itself, so they are equal. The answer, if there is one, is unique.

Now the trap the theorem leaves open. Uniqueness of the normal form is not the same as its reachability. Consider (λx.y)\u2009Ω, where Ω = (λx.x x)(λx.x x) is the archetypal term with no normal form, reducing forever to itself. The application (λx.y)\u2009Ω has a normal form — y — reached in a single step by contracting the outer redex and discarding the argument unread. But a reduction that insists on working on the argument first will grind on Ω without end, the answer y sitting untouched one step away.

the shape of the question

So there are two separate facts about a term: whether it has a normal form, and which reductions find one. Confluence settles the first kind of question up to uniqueness and says nothing about the second. The theory of reduction order is the theory of the second — of strategies that always arrive, strategies that arrive quickly, and the price each exacts. And because the fixed-point combinator is a term whose reduction is an infinite unfolding held in check only by order, it is precisely where the question bites.

II · name and value

Two strategies, two fates

The two archetypal orders differ in one decision: whether a function receives its argument evaluated or unevaluated. Call-by-name — normal order — contracts the outermost redex first, passing arguments untouched. Call-by-value — applicative order — reduces arguments to values before applying. On terminating terms they agree; on the fixed-point combinator they part ways completely.

Normal order (call-by-name) always contracts the leftmost-outermost redex — the outermost function application available, arguments carried in as they stand. Applicative order (call-by-value) reduces the leftmost-innermost redex — it drives each argument down to a value before the surrounding function is applied. The reducer below is the genuine article: capture-avoiding substitution, single-step contraction, either strategy. Choose a term and an order and watch the sequence.

term
strategy
The same term, two orders. (λx.y) Ω reaches y at once under call-by-name and diverges under call-by-value. Y g unfolds the fixed-point equation Y g ↠ g (Y g) ↠ g (g (Y g)) ↠ ⋯. S K K computes I under either order — where a normal form is genuinely within reach of both, they agree.

the fixed point under each order  Run Y g and the parting is visible. Under call-by-name the combinator Y = λf.(λx.f(x x))(λx.f(x x)) unfolds one layer at a time — Y g ↠ g (Y g) — handing g a still-folded copy of the recursion, so that a g which inspects its argument before recurring (a factorial testing for zero, say) can halt. Under call-by-value the same unfolding races ahead of g: the calculus insists on reducing the argument to a value before g is applied, and the argument is another copy of the unfolding, so g never runs. The plain Y is a call-by-name instrument; under call-by-value it is useless. The next section builds the combinator that survives the change of order.

III · the value-safe fixed point

A combinator that survives call-by-value

If call-by-value unfolds the recursion too eagerly, the cure is to make the unfolding wait. Plotkin's combinator guards each recursive occurrence behind a λ, turning the runaway self-application into a value that the calculus leaves alone until it is actually applied to an argument. One η-expansion converts the useless Y into a working fixed point.

The failure under call-by-value was specific: in Y = λf.(λx.f(x x))(λx.f(x x)) the subterm x x is an application, and applicative order must reduce it before f can act — but reducing it produces another copy of the same application, forever. Replace x x with its η-expansion λv.\u2009x x\u2009v and the situation changes entirely: a λ-abstraction is a value, so call-by-value stops there and does not look inside until an argument v arrives.

Plotkin's call-by-value fixed-point combinator

Z = λf. (λx. f (λv. x x v)) (λx. f (λv. x x v))
Under call-by-value it satisfies, for any value argument v,
Z f ↠ f (λv. Z f v) and Z f v ↠ f (Z f) v
The recursion is present but guarded: Z f hands f a thunk λv. Z f v — a value — and the next layer of unfolding is released only when that thunk is applied. So f runs first, decides whether to recur, and the calculus never outruns it.

The move is general. To make any recursive definition safe under call-by-value, wrap each recursive occurrence in a λ that abstracts the argument it will be given — thunk it — so that the self-reference is a value at rest until forced. It is the same idea a strict language expresses when it makes recursion go through a function rather than a value, and the same idea lazy languages get for free by never evaluating an argument until its result is demanded. The Plural catalogued the family of fixed-point combinators as syntactic objects; Z is exactly the member of that family fit for the applicative order, the fixed point rebuilt to respect the evaluation of values.

IV · standardization

The strategy that never misses

Is there an order of reduction guaranteed to find the normal form whenever one exists? There is, and it is exactly the outermost-first order that saved (λx.y) Ω. The guarantee is a corollary of the standardization theorem, one of the structural pillars of the calculus.

Standardization says that reductions can always be tidied into a canonical shape — the redexes contracted in a fixed left-to-right, outside-in discipline — without changing where they end up.

the standardization theorem (Curry–Feys)
If M ↠ N, then there is a standard reduction from M to N — one in which redexes are contracted in leftmost-outermost order (no redex is contracted before one to its left or outside it that is contracted later). Every reduction has a standard counterpart to the same result.

The consequence for strategy is immediate and decisive. If a term has a normal form at all, some reduction reaches it; standardization converts that reduction into a standard one; and a standard reduction that reaches a normal form is exactly what the leftmost-outermost strategy generates. So:

normalization — the leftmost-outermost theorem
If M has a normal form, then repeatedly contracting the leftmost-outermost redex terminates at that normal form. Normal order is normalizing: it finds the answer whenever there is one.
the safe strategy, and what it costs

Call-by-value has no such guarantee — (λx.y) Ω, which the reducer sends to y under normal order and to divergence under applicative order, is the standing counterexample: applicative order can loop where a normal form exists. Normal order cannot. But safety is not free. Normal order passes arguments unevaluated, and a function that uses its argument several times receives several unreduced copies, each reduced afresh — the same work done again and again. Call-by-value, when it terminates, does that work once. The two strategies sit at opposite corners: normal order always arrives but may repeat itself; applicative order never repeats an argument but may fail to arrive. The rest of this study is the search for a strategy at neither corner.

V · sharing

Neither corner: call-by-need

The safe strategy repeats work; the efficient one may not terminate. The practical resolution keeps the safety of normal order and buys back its efficiency with a single idea — do not copy an unevaluated argument, share it, and evaluate the shared copy at most once. This is call-by-need, and it is why lazy languages are both total where strict ones loop and efficient where naïve normal order would crawl.

The waste in normal order is exact. When (λx. x x x)\u2009M is contracted, the argument M is substituted three times, and each copy is reduced on its own — the cost of evaluating M paid threefold. Call-by-value would pay it once, by reducing M before substituting; but that is the very eagerness that loses termination. Call-by-need takes the third path: substitute M unevaluated, as normal order does, but let the three occurrences be three pointers to one copy. When the first is forced to a value, the value is written back and the others find it already done.

graph reduction

The mechanism is to stop thinking of a term as a tree and think of it as a graph — a directed acyclic graph in which a shared subterm is pointed to, not duplicated (Wadsworth, 1971). Reduction rewrites the graph in place; contracting a shared redex updates it once for every pointer at once. Call-by-need is graph reduction under a normal-order discipline, and it is observationally identical to call-by-name — the same normal forms, the same termination behaviour — while performing, for shared subterms, the work only once, as call-by-value would. It occupies neither corner: normalizing like normal order, non-repeating like applicative order. It is the evaluation strategy of real lazy implementations.

Call-by-need looks like the end of the story — safety and efficiency reconciled. It is not, quite. Sharing subterms is not the same as sharing redexes, and there is a finer notion of doing no redundant work that graph reduction still misses. Naming it precisely, and building a machine that achieves it, turns out to reach surprisingly far down.

VI · optimal reduction

The least work, and the price of counting it

What is the fewest β-reductions a term's normalization can take? Lévy made the question precise: certain redexes are copies of one another, sharing a history, and an ideal reducer would contract each such family once. Lamping built the first machine that does — sharing graphs — and the theory beneath it turned out to be linear logic, with a famous sting in the accounting.

The subtlety call-by-need leaves is this. When a redex is duplicated — copied into two contexts before it is contracted — the two copies are, in a strong sense, the same redex: contracting one is doing the very work of contracting the other. Graph reduction shares subterms that are literally identical pointers, but once a redex has been copied into genuinely separate positions, it no longer recognizes them as the same, and it contracts both. Lévy (1978) formalized sameness by labelling redexes with their history, collecting those with the same label into a family, and defining a reduction to be optimal when it never contracts two members of a family separately — each family costs exactly one step.

Lévy-optimality, and Lamping's realization
Lévy defined the optimal cost of normalization as the number of family reduction steps, and proved this the true lower bound on shared work — but gave no algorithm attaining it. Lamping (1990) gave the first: sharing graphs, a graph-rewriting system with fan nodes that duplicate and share, together with control nodes — brackets and croissants, the “oracle” — that keep the sharing correctly matched when redexes at different levels of duplication interact. Sharing graphs realize Lévy-optimal reduction: every family is contracted exactly once.

And then the structure underneath came into view. Gonthier, Abadi, and Lévy showed that Lamping's fan nodes and their bookkeeping are precisely the exponential modalities of linear logic — the operators governing duplication and discarding — and that the whole algorithm is an instance of Girard's Geometry of Interaction, the token-passing semantics of proofs. The plain operational question of how few times to reduce had led, without warning, into the deepest account of copying that logic possesses.

Four strategies against two demands — does it always find the normal form, and does it avoid repeating work. No strategy above call-by-need is a pure gain: optimality in β-family steps is bought with a bookkeeping ledger whose own cost can dwarf the reductions it saves.
optimal is not the same as cheap

The sting is in the ledger. Asperti and Mairson proved that the number of β-family reductions can be non-elementary smaller than the total work a sharing-graph reducer performs: the oracle's accounting — the shuffling of brackets and croissants that keeps the families straight — can itself take non-elementary time. So a Lévy-optimal reduction, minimal in the steps that matter to the theory, need not be efficient in any wall-clock sense; the count it minimizes is not the count that measures cost. Optimal reduction is a precise and beautiful answer to the question of least shared work, and a standing warning that the natural measure of “least work” was not the one the machine has to pay. The innocent question about order ends in one of the subtler open landscapes of the subject.

VII · the fixed point in motion

Where order rejoins the diagonal

The fixed-point combinator is the diagonal λx.x x dressed to manufacture fixed points — the constructive face of Lawvere's theorem, the affirmative twin of every impossibility the corpus catalogues. This movement has watched that construction not at rest but in motion, and the three theorems it turns on are three guarantees about the motion.

Read the results as a single account of how a fixed point computes. The diagonal supplies the fixed point; confluence, standardization, and the value-safe combinator govern its realization; and the sharing theory beneath them exposes the fine grain of the computation.

the answer is unique  Confluence (Church–Rosser). However the unfolding Y f ↠ f (Y f) ↠ ⋯ is reduced, all paths that reach a normal form reach the same one. The fixed point's value does not depend on the road taken.

the answer is findable  Standardization, and its corollary that normal order is normalizing. If the computation has a normal form, the outermost-first order reaches it — the lazy unfolding hands the recursor a folded copy at each step, so a terminating recursion terminates.

the answer survives the order  Plotkin's Z. Even where the calculus insists on values, one η-guard makes the fixed point wait for its argument, so the same recursion runs under call-by-value. The construction is robust to the discipline of evaluation.

The diagonal makes the fixed point; the order makes it run. What The Plural gave as a term and The Operator as a denotation, this movement gives as a process — and the process is exactly as constrained, and as free, as the impossibility results elsewhere in the corpus are strict. The same self-application that in a typed setting would inhabit the empty type, and that The Correspondence shows a consistent logic must forbid, is here a working engine, its non-termination not a defect but the very thing that lets it recur; the price of general recursion is the loss of the guarantee to halt, paid in the one currency — a divergent reduction — that the order of evaluation lets us choose when to spend. And beneath the whole apparatus, the theory of optimal reduction finds the logic of duplication itself — the exponentials of linear logic, the geometry of interaction — so that the plainest question one can ask about a fixed point, how does it compute, and how cheaply, turns out to touch the deepest structure the subject has. The fixed point that the diagonal builds is not only a term or a value. It is a motion, and its law is order.

Confluence gives the calculus its serenity — there is one answer, and no way of working can reach a different one. Order gives it its drama, for the same theorem is silent on whether a given way of working reaches the answer at all, and the fixed-point combinator, an unfolding stopped only by the discipline of reduction, is where the silence speaks. Outermost-first always arrives and sometimes labours; innermost-first never repeats itself and sometimes never returns; between them, sharing buys back what safety cost, and optimality reaches down into linear logic for the last accounting and finds the ledger heavier than the sum it settles. The diagonal that manufactures the fixed point does not say how the fixed point moves. That is the work of order — the one freedom left once the answer is fixed, and the one that decides whether the answer is ever seen.