1478
|
1 |
(* Title: ZF/Coind/Types.thy
|
916
|
2 |
ID: $Id$
|
1478
|
3 |
Author: Jacob Frost, Cambridge University Computer Laboratory
|
916
|
4 |
Copyright 1995 University of Cambridge
|
|
5 |
*)
|
|
6 |
|
|
7 |
Types = Language +
|
|
8 |
|
|
9 |
consts
|
1478
|
10 |
Ty :: i (* Datatype of types *)
|
|
11 |
TyConst :: i (* Abstract type of type constants *)
|
934
|
12 |
datatype <= "univ(TyConst)"
|
|
13 |
"Ty" = t_const("tc:TyConst")
|
|
14 |
| t_fun("t1:Ty","t2:Ty")
|
916
|
15 |
|
|
16 |
|
|
17 |
(* Definition of type environments and associated operators *)
|
|
18 |
|
|
19 |
consts
|
1401
|
20 |
TyEnv :: i
|
934
|
21 |
datatype <= "univ(Ty Un ExVar)"
|
|
22 |
"TyEnv" = te_emp
|
|
23 |
| te_owr("te:TyEnv","x:ExVar","t:Ty")
|
916
|
24 |
|
|
25 |
consts
|
1401
|
26 |
te_dom :: i => i
|
|
27 |
te_app :: [i,i] => i
|
6046
|
28 |
|
|
29 |
|
|
30 |
primrec (*domain of the type environment*)
|
|
31 |
"te_dom (te_emp) = 0"
|
|
32 |
"te_dom(te_owr(te,x,v)) = te_dom(te) Un {x}"
|
|
33 |
|
|
34 |
primrec (*lookup up identifiers in the type environment*)
|
|
35 |
"te_app (te_emp,x) = 0"
|
|
36 |
"te_app (te_owr(te,y,t),x) = if(x=y, t, te_app(te,x))"
|
916
|
37 |
|
|
38 |
end
|
|
39 |
|
|
40 |
|
|
41 |
|
|
42 |
|
|
43 |
|