Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Logic and CS / Girard. Proofs and Types.pdf
Скачиваний:
38
Добавлен:
10.08.2013
Размер:
947.15 Кб
Скачать

24

CHAPTER 4. THE NORMALISATION THEOREM

4.2The weak normalisation theorem

This result states the existence of a normal form | which is necessarily unique | for every term. Its immediate corollary is the decidability of denotational equality. Indeed we have seen that the equation u = v is provable exactly when u; v w for some w; but such w has a normal form, which then becomes the common normal form for u and v. To decide the denotational equality of u and v we proceed thus:

in the rst step, calculate the normal forms of u and v,

in the second step, compare them.

There is perhaps a small di culty hidden in calculating the normal forms, since the reduction is not a deterministic algorithm. That is, for xed t, many conversions (but only a nite number) are possible on the subterms of t. So the theorem states the possibility of nding the normal form by appropriate conversions, but does not exclude the possibility of bad reductions, which do not lead to a normal form. That is why one speaks of weak normalisation.

Having said that, it is possible to nd the normal form by enumerating all the reductions in one step, all the reductions in two steps, and so on until a normal form is found. This inelegant procedure is justi ed by the fact that there are onlynitely many reductions of length n starting from a xed term t.

The strong normalisation theorem will simplify the situation by guaranteeing that all normalisation strategies are good, in the sense they all lead to the normal form. Obviously, some are more e cient than others, in terms of the number of steps, but if one ignores this (essential) aspect, one always gets to the result!

4.3Proof of the weak normalisation theorem

The degree @(T ) of a type is de ned by:

@(Ti) = 1 if Ti is atomic.

@(U V ) = @(U!V ) = max(@(U); @(V )) + 1.

The degree @(r) of a redex is de ned by:

@( 1hu; vi) = @( 2hu; vi) = @(U V ) where U V is the type of hu; vi.

@(( x: v) u) = @(U!V ) where U!V is the type of ( x: v).

4.3. PROOF OF THE WEAK NORMALISATION THEOREM

25

The degree d(t) of a term is the sup of the degrees of the redexes it contains. By convention, a normal term (i.e. one containing no redex) has degree 0.

NB A redex r has two degrees: one as redex, another as term, for the redex may contain others; the second degree is greater than or equal to the rst: @(r) d(r).

4.3.1Degree and substitution

Lemma If x is of type U then d(t[u=x]) max(d(t); d(u); @(U)).

Proof Inside t[u=x], one nds:

the redexes of t (in which x has become u)

the redexes of u (proliferated according to the occurrences of x)

possibly new redexes, in the case where x appears in a context 1x

(respectively 2x or x v) and u is

hu0; u00i

(respectively hu0; u00i or y: u0).

These new redexes have the degree

of U.

 

4.3.2Degree and conversion

First note that, if r is a redex of type T , then @(r) > @(T ) (obvious).

Lemma If t u then d(u) d(t).

Proof We need only consider the case where there is only one conversion step: u is obtained from t by replacing r by c. The situation is very close to that of lemma 4.3.1, i.e. in u we nd:

redexes which were in t but not in r, modi ed by the replacement of r by c (which does not a ect the degree),

redexes of c. But c is obtained by simpli cation of r, or by an internal

substitution in r: ( x: s) s0 becomes s[s0=x] and lemma 4.3.1 tells us that d(c) max(d(s); d(s0); @(T )), where T is the type of x. But @(T ) < d(r), so d(c) d(r).

redexes which come from the replacement of r by c. The situation is the same as in lemma 4.3.1: these redexes have degree equal to @(T ) where T

is the type of r, and @(T ) < @(r).

 

Соседние файлы в папке Logic and CS