# Beta normal form

In the lambda calculus, a term is in beta normal form if no beta reduction is possible.[1] A term is in beta-eta normal form if neither a beta reduction nor an eta reduction is possible. A term is in head normal form if there is no beta-redex in head position.

## Beta reduction

In the lambda calculus, a beta redex is a term of the form

${\displaystyle (\mathbf {\lambda } x.A[x])M}$

where ${\displaystyle A[x]}$ is a term (possibly) involving variable ${\displaystyle x}$.

A redex ${\displaystyle r}$ is in head position in a term ${\displaystyle t}$, if ${\displaystyle t}$ t has the following shape:

${\displaystyle \lambda x_{1}\ldots \lambda x_{n}.\underbrace {(\lambda x.A[x])M_{1}} _{{\text{the redex }}r}M_{2}\ldots M_{m}}$, where ${\displaystyle n\geq 0}$ and ${\displaystyle m\geq 1}$.

A beta reduction is an application of the following rewrite rule to a beta redex contained in a term ${\displaystyle t}$:

${\displaystyle (\mathbf {\lambda } x.A[x])M\longrightarrow A[M]}$

where ${\displaystyle A[M]}$ is the result of substituting the term ${\displaystyle M}$ for the variable ${\displaystyle x}$ in the term ${\displaystyle A[x]}$.

A head beta reduction is a beta reduction applied in head position, that is, of the following form:

${\displaystyle \lambda x_{1}\ldots \lambda x_{n}.(\lambda x.A[x])M_{1}M_{2}\ldots M_{m}\longrightarrow \lambda x_{1}\ldots \lambda x_{n}.A[M_{1}]M_{2}\ldots M_{m}}$, where ${\displaystyle n\geq 0}$ and ${\displaystyle m\geq 1}$.

Any other reduction is an internal beta reduction.

A normal form is a term that do not contain any beta redex, ie. that cannot be further reduced. More generally, a head normal form is a term that do not contain a beta redex in head position, ie. that cannot be further reduced by a head reduction. Head normal forms are the terms of the following shape:

${\displaystyle \lambda x_{1}\ldots \lambda x_{n}.xM_{1}M_{2}\ldots M_{m}}$, where ${\displaystyle x}$ is a variable (if considering the simple lambda calculus), ${\displaystyle n\geq 0}$ and ${\displaystyle m\geq 0}$.

It is not always a normal form, because the applied arguments ${\displaystyle M_{j}}$ need not be normal. However, the converse is true: any normal form is also a head normal form. In fact, the normal forms are exactly the head normal forms in which the subterms ${\displaystyle M_{j}}$ are themselves normal forms. This gives an inductive syntactic description of normal forms.

## Reduction strategies

In general, a given term can contain several redexes, hence several different beta reductions can apply. We may specify a strategy to choose which redex to reduce.

• Normal-order reduction is the strategy in which one continually applies the rule for beta reduction in head position until no more such reductions are possible. At that point, the resulting term is in head normal form. One then continues applying head reduction in the subterms ${\displaystyle M_{j}}$, from left to right. Stated otherwise, normal‐order reduction is the strategy that always reduces the left‐most outer‐most redex first.
• By contrast, in applicative order reduction, one applies the internal reductions first, and then only applies the head reduction when no more internal reductions are possible.

Normal-order reduction is complete, in the sense that if a term has a head normal form, then normal‐order reduction will eventually reach it; by the syntactic description of normal forms above, this entails the same statement for a “fully” normal form (this is the standardization theorem). By contrast, applicative order reduction may not terminate, even when the term has a normal form. For example, using applicative order reduction, the following sequence of reductions is possible:

{\displaystyle {\begin{aligned}&(\mathbf {\lambda } x.z)((\lambda w.www)(\lambda w.www))\\\rightarrow &(\lambda x.z)((\lambda w.www)(\lambda w.www)(\lambda w.www))\\\rightarrow &(\lambda x.z)((\lambda w.www)(\lambda w.www)(\lambda w.www)(\lambda w.www))\\\rightarrow &(\lambda x.z)((\lambda w.www)(\lambda w.www)(\lambda w.www)(\lambda w.www)(\lambda w.www))\\&\ldots \end{aligned}}}

But using normal-order reduction, the same starting point reduces quickly to normal form:

${\displaystyle (\mathbf {\lambda } x.z)((\lambda w.www)(\lambda w.www))}$
${\displaystyle \rightarrow z}$

Sinot's director strings is one method by which the computational complexity of beta reduction can be optimized.