Allen's techniques enable us to model a variety of type theories. Let us designate some models for the theories discussed earlier. We'll fix the terms and evaluation relation to include those of the richest theory; so the terms are: 0, 1, , , 0, suc(t), prd(s), add(s; t), mult(s; t), exp(s; t), R(n; t; v.b; u, v, i.h), , pair(s; t), prod(s; x.t), fun(s; x.t), , list(t), (s.t), L(s; a; v.b; h, t, v, i.g), s+t, inl(s), inr(t), and decide(p; u.s; v.t).
There is also the evaluation relation which we abbreviate as . definedness ( ) We consider various mappings T where l is a label such as , etc. The most elementary ``theory'' we will examine is a subtheory of arithmetic involving only equalities over built from 0, suc(t), prd(s), and add(s; t). This is modeled by TN. The input to TN is any pair and the output is where the only type name is N, so NFN, thus , and the only type equality is M(N) which is defined inductively. We have that s M(N)tis the least relation such that
The map TN takes any to this , so its least fixed point, is just . This is the model for successor arithmetic. We see that in this model, N is a type, that s=t in N iff s evaluates to a canonical natural number and t evaluates to the same canonical number.
The rules can be confirmed as follows. First, notice that evaluation is deterministic and idempotent on the terms. As we observed, the general equality rules hold in any type system (because M(N) is in equivalence relation on canonical numbers). This follows by showing inductively that are in the relation M(N), i.e. in the field of the relation. The fact that M(N) respects evaluation validates the last equality rule.
in N |
in N implies in N. |
The typing rule for successor is also confirmed by induction on ; namely, if s' L(N) t', then since and , then we have suc(s) M(N) suc(t) as required for the typing rule.
In the case of N, the model ,
and the informal semantics are
essentially the same. So the theory fragment for N can stand on its
own with respect to the model. Even a set theoretic semantics for N will
have the same essential ingredient of an inductive characterization. For
instance, Frege's definition was that
The same approach can be used to define a model for the type theory with cartesian products. In this case we denote the operator on type systems as . Given , if and then , and is . For this system, TN2 is continuous, i.e. if and , then .
In all the rules for the fragment of section are true. Again the theory is so close to the semantics that it stands on its own. Notice that in confirming the rule for typing pairs, we rely on the fact that is a fixed point.
in imply | |
To provide a semantics for and we use the map TML defined in section . The model is . To prove the rules correct, we recall the meaning of sequents such as type and in T.
implies |
implies in |