Beta normal form


In the lambda calculus, a term is in beta normal form if no beta reduction is possible. 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:
A redex is in head position in a term, if has the following shape :
A beta reduction is an application of the following rewrite rule to a beta redex contained in a term:
where is the result of substituting the term for the variable in the term.
A head beta reduction is a beta reduction applied in head position, that is, of the following form:
Any other reduction is an internal beta reduction.
A normal form is a term that does not contain any beta redex, i.e. that cannot be further reduced. A head normal form is a term that does not contain a beta redex in head position, i.e. that cannot be further reduced by a head reduction. When considering the simple lambda calculus, head normal forms are the terms of the following shape:
A head normal form is not always a normal form, because the applied arguments 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 are themselves normal forms. This gives an inductive syntactic description of normal forms.
There is an additional notion of weak head normal form : a term is in whnf if it is not an application, and it is not starting with a constant or function symbol. is in whnf because it is an abstraction. is in whnf because it starts with a function symbol, namely.

Reduction strategies

In general, a given term can contain several redexes, hence several different beta reductions could be applied. We may specify a strategy to choose which redex to reduce.
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. 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:
But using normal-order reduction, the same starting point reduces quickly to normal form:
Sinot's director strings is one method by which the computational complexity of beta reduction can be optimized.