One example is that simplifying arithmetic expressions produces a number - in arithmetic, all numbers are normal forms. A remarkable fact is that all arithmetic expressions have a unique value, so the rewriting system is strongly normalizing and confluent: :(3 + 5) * (1 + 2) ⇒ 8 * (1 + 2) ⇒ 8 * 3 ⇒ 24 :(3 + 5) * (1 + 2) ⇒ (3 + 5) * 3 ⇒ 3*3 + 5*3 ⇒ 9 + 5*3 ⇒ 9 + 15 ⇒ 24 Examples of non-normalizing systems (not weakly or strongly) include counting to infinity (1 ⇒ 2 ⇒ 3 ⇒ ...) and loops such as the transformation function of the
Collatz conjecture (1 ⇒ 2 ⇒ 4 ⇒ 1 ⇒ ..., it is an open problem if there are any other loops of the Collatz transformation). Another example is the single-rule system {
r(
x,
y) →
r(
y,
x) }, which has no normalizing properties since from any term, e.g.
r(4,2) a single rewrite sequence starts, viz.
r(4,2) →
r(2,4) →
r(4,2) →
r(2,4) → ..., which is infinitely long. This leads to the idea of rewriting "modulo
commutativity" where a term is in normal form if no rules but commutativity apply. The system {
b →
a,
b →
c,
c →
b,
c →
d} (pictured) is an example of a weakly normalizing but not strongly normalizing system.
a and
d are normal forms, and
b and
c can be reduced to
a or
d, but the infinite reduction
b →
c →
b →
c → ... means that neither
b nor
c is strongly normalizing.
Untyped lambda calculus The pure untyped
lambda calculus does not satisfy the strong normalization property, and not even the weak normalization property. Consider the term \lambda x . x x x (application is
left associative). It has the following rewrite rule: For any term t, : (\mathbf{\lambda} x . x x x) t \rightarrow t t t But consider what happens when we apply \lambda x . x x x to itself: : \begin{align} (\mathbf{\lambda} x . x x x) (\lambda x . x x x) & \rightarrow (\mathbf{\lambda} x . x x x) (\lambda x . x x x) (\lambda x . x x x) \\ & \rightarrow (\mathbf{\lambda} x . x x x) (\lambda x . x x x) (\lambda x . x x x) (\lambda x . x x x) \\ & \rightarrow (\mathbf{\lambda} x . x x x) (\lambda x . x x x) (\lambda x . x x x) (\lambda x . x x x) (\lambda x . x x x) \\ & \rightarrow \ \cdots\, \end{align} Therefore, the term (\lambda x . x x x) (\lambda x . x x x) is not strongly normalizing. And this is the only reduction sequence, hence it is not weakly normalizing either.
Typed lambda calculus Various systems of
typed lambda calculus including the
simply typed lambda calculus,
Jean-Yves Girard's
System F, and
Thierry Coquand's
calculus of constructions are strongly normalizing. A lambda calculus system with the normalization property can be viewed as a programming language with the property that every program
terminates. Although this is a very useful property, it has a drawback: a programming language with the normalization property cannot be
Turing complete, otherwise one could solve the halting problem by seeing if the program type checks. This means that there are computable functions that cannot be defined in the simply typed lambda calculus, and similarly for the
calculus of constructions and
System F. A typical example is that of a
self-interpreter in a total programming language. == See also ==