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 *)
|
6112
|
12 |
|
|
13 |
datatype
|
|
14 |
"Ty" = t_const ("tc:TyConst")
|
|
15 |
| t_fun ("t1:Ty","t2:Ty")
|
916
|
16 |
|
|
17 |
|
|
18 |
(* Definition of type environments and associated operators *)
|
|
19 |
|
|
20 |
consts
|
1401
|
21 |
TyEnv :: i
|
6112
|
22 |
|
|
23 |
datatype
|
934
|
24 |
"TyEnv" = te_emp
|
6112
|
25 |
| te_owr ("te:TyEnv","x:ExVar","t:Ty")
|
916
|
26 |
|
|
27 |
consts
|
1401
|
28 |
te_dom :: i => i
|
|
29 |
te_app :: [i,i] => i
|
6046
|
30 |
|
|
31 |
|
|
32 |
primrec (*domain of the type environment*)
|
|
33 |
"te_dom (te_emp) = 0"
|
|
34 |
"te_dom(te_owr(te,x,v)) = te_dom(te) Un {x}"
|
|
35 |
|
|
36 |
primrec (*lookup up identifiers in the type environment*)
|
|
37 |
"te_app (te_emp,x) = 0"
|
6068
|
38 |
"te_app (te_owr(te,y,t),x) = (if x=y then t else te_app(te,x))"
|
916
|
39 |
|
|
40 |
end
|
|
41 |
|
|
42 |
|
|
43 |
|
|
44 |
|
|
45 |
|