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

7.4. EXPRESSIVE POWER: RESULTS

51

7.4Expressive power: results

7.4.1Canonical forms

First a question: what guarantee do we have that Int represents the integers, Bool the booleans, etc.? It is not because we have represented the integers in the type Int that this type can immediately claim to represent the integers. The answer lies in the following lemma:

Lemma Let t be a closed normal term:

If t is of type Int, then t is of the form n.

If t is of type Bool, then t is of the form T or F.

If t is of type U V , then t is of the form hu; vi.

If t is of type U!V , then t is of the form x: v.

Proof By induction on the number of symbols of t. If t is S w, the induction hypothesis applied to w gives w = n, so t = n + 1. So we suppose that t is not of the form O, T, F, hu; vi or x: v:

If t is R u v w, then the induction hypothesis says that w is of the form n, and then t is not normal.

If t is D u v w, then by the induction hypothesis w is T or F, and then t is not normal.

If t is iw, then again w is of the form hu; vi, and t is not normal.

If t is w u, then w is of the form x: v, and t is not normal.

 

7.4.2Representable functions

In particular, if t is a closed term of type Int! Int of T, it induces a function jtj from N to N de ned by:

jtj(n) = m

i

t

 

 

 

n

m

Likewise, a closed term of type Int! Bool induces a predicate jtj on N:

jtj(n) holds

i

t

 

T

n

The functions jtj are clearly calculable: the normalisation algorithm gives jtj(n) as a function of n. So those functions representable in T are recursive. Can we characterise the class of such functions?

52

CHAPTER 7. GODEL'S SYSTEM T

In general, recursive functions are de ned using partial algorithms, whose convergence is not assured, but which have nice closure properties not shared by total ones. Seen as a partial algorithm, jtj amounts to looking for the normal form, and, in the case where this succeeds, writing it. The normalisation theorem is thus a proof of program guaranteeing termination of all algorithms obtained from T. Now, what are the mathematical principles necessary to prove the reducibility of a xed term t?

We need

to be able to express the reducibility of t and of its subterms: one must be able to write a nite number of reducibilities, which can be done in Peano arithmetic (PA).

to be able to reason by mathematical induction on this nite number of reducibility predicates; that can again be done in PA, modulo some awful coding without signi cant interest (G•odel numbering).

Summing up, the termination is provable in arithmetic: we say that jtj is provably total in PA.

The converse is true: let f be a recursive function, provably total in PA, then one can nd a term of type Int! Int in T, such that f(n) = jtj(n) for all n. In other words, the expressive power of the system T is enormous, and much more than what is feasible1 on a computer! The further generalisations are not aiming to increase the class of representable functions, which is already too big, but only to enlarge the class of particular algorithms calculating simple given functions. For example, nding a type system where the predecessor is well-behaved.

We do not want to give a proof of this converse here, since we consider the (more delicate) case of system F in 15.2.

1In the sense of complexity. Thus for instance hyperexponential algorithms, such as the proof of cut elimination, are not feasible.

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