src/ZF/Coind/Types.thy
author paulson
Wed, 13 Jan 1999 11:57:09 +0100
changeset 6112 5e4871c5136b
parent 6068 2d8f3e1f1151
child 11318 6536fb8c9fc6
permissions -rw-r--r--
datatype package improvements
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1478
2b8c2a7547ab expanded tabs
clasohm
parents: 1401
diff changeset
     1
(*  Title:      ZF/Coind/Types.thy
916
d03bb9f50b3b New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
     2
    ID:         $Id$
1478
2b8c2a7547ab expanded tabs
clasohm
parents: 1401
diff changeset
     3
    Author:     Jacob Frost, Cambridge University Computer Laboratory
916
d03bb9f50b3b New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
     4
    Copyright   1995  University of Cambridge
d03bb9f50b3b New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
     5
*)
d03bb9f50b3b New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
     6
d03bb9f50b3b New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
     7
Types = Language +
d03bb9f50b3b New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
     8
d03bb9f50b3b New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
     9
consts
1478
2b8c2a7547ab expanded tabs
clasohm
parents: 1401
diff changeset
    10
  Ty :: i                       (* Datatype of types *)
2b8c2a7547ab expanded tabs
clasohm
parents: 1401
diff changeset
    11
  TyConst :: i          (* Abstract type of type constants *)
6112
5e4871c5136b datatype package improvements
paulson
parents: 6068
diff changeset
    12
5e4871c5136b datatype package improvements
paulson
parents: 6068
diff changeset
    13
datatype
5e4871c5136b datatype package improvements
paulson
parents: 6068
diff changeset
    14
  "Ty" = t_const ("tc:TyConst")
5e4871c5136b datatype package improvements
paulson
parents: 6068
diff changeset
    15
       | t_fun ("t1:Ty","t2:Ty")
916
d03bb9f50b3b New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
    16
  
d03bb9f50b3b New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
    17
d03bb9f50b3b New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
    18
(* Definition of type environments and associated operators *)
d03bb9f50b3b New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
    19
d03bb9f50b3b New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
    20
consts
1401
0c439768f45c removed quotes from consts and syntax sections
clasohm
parents: 1155
diff changeset
    21
  TyEnv :: i
6112
5e4871c5136b datatype package improvements
paulson
parents: 6068
diff changeset
    22
5e4871c5136b datatype package improvements
paulson
parents: 6068
diff changeset
    23
datatype
934
2e0203309287 Replaced rules by defs. Also got rid of tyconstU by
lcp
parents: 916
diff changeset
    24
  "TyEnv" = te_emp
6112
5e4871c5136b datatype package improvements
paulson
parents: 6068
diff changeset
    25
          | te_owr ("te:TyEnv","x:ExVar","t:Ty") 
916
d03bb9f50b3b New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
    26
d03bb9f50b3b New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
    27
consts
1401
0c439768f45c removed quotes from consts and syntax sections
clasohm
parents: 1155
diff changeset
    28
  te_dom :: i => i
0c439768f45c removed quotes from consts and syntax sections
clasohm
parents: 1155
diff changeset
    29
  te_app :: [i,i] => i
6046
2c8a8be36c94 converted to use new primrec section
paulson
parents: 3840
diff changeset
    30
2c8a8be36c94 converted to use new primrec section
paulson
parents: 3840
diff changeset
    31
2c8a8be36c94 converted to use new primrec section
paulson
parents: 3840
diff changeset
    32
primrec (*domain of the type environment*)
2c8a8be36c94 converted to use new primrec section
paulson
parents: 3840
diff changeset
    33
  "te_dom (te_emp) = 0"
2c8a8be36c94 converted to use new primrec section
paulson
parents: 3840
diff changeset
    34
  "te_dom(te_owr(te,x,v)) = te_dom(te) Un {x}"
2c8a8be36c94 converted to use new primrec section
paulson
parents: 3840
diff changeset
    35
2c8a8be36c94 converted to use new primrec section
paulson
parents: 3840
diff changeset
    36
primrec (*lookup up identifiers in the type environment*)
2c8a8be36c94 converted to use new primrec section
paulson
parents: 3840
diff changeset
    37
  "te_app (te_emp,x) = 0"
6068
2d8f3e1f1151 if-then-else syntax for ZF
paulson
parents: 6046
diff changeset
    38
  "te_app (te_owr(te,y,t),x) = (if x=y then t else te_app(te,x))"
916
d03bb9f50b3b New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
    39
d03bb9f50b3b New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
    40
end
d03bb9f50b3b New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
    41
d03bb9f50b3b New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
    42
d03bb9f50b3b New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
    43
d03bb9f50b3b New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
    44
d03bb9f50b3b New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
    45