We would like to show that reduction terminates. To do so, we will need a bit of machinery. The first concept to consider will be the depth of a term.
Our goal now is
to find a reduction strategy (choice of which -redex to reduce) which
will guarantee that
(redex) >
(contractum). That is, we need
some reduction strategy where:
We know two reduction strategies already which we could consider,
namely lazy (leftmost outermost) and eager (leftmost innermost).
So, what sort of strategy do we choose? If we have ,
then our goal is to reduce in such a way such that
.
When we consider
, our first thought might be to find the maximum
depth redex and then reduce it. However, we see that this strategy
won't work. Supose
is the maximum depth redex.
Also suppose that
itself is duplicated in
. Then, if we do the
substitution
we end up replicating
, possibly many times.
This clearly does not decrease the number of maximum depth
redices. In fact it will often increase the number of maximum depth redices.
Thus
is not decreasing. So this reduction strategy does not work.
It turns out that we need to find the rightmost innermost maximum depth
redex, and then reduce that one. In this case,
the redices in will be of smaller depth, and if the reduction creates
a redex in
, say
reduces
to
; then the depth of the new redex is
, which is
smaller than
.
We will call this strategy maximum depth rightmost innermost redex reduction. We have thus demonstrated the following theorem:
The theorem we stated above is a weak theorem. The stronger statement of this theorem is to say that every reduction terminates, not only the maximum depth rightmost innermost redex reduction as demonstrated above. The proof of this theorem can be found in CN91 11.