src/ZF/Coind/Types.thy
author paulson
Fri, 16 Feb 1996 18:00:47 +0100
changeset 1512 ce37c64244c0
parent 1478 2b8c2a7547ab
child 3840 e0baea4d485a
permissions -rw-r--r--
Elimination of fully-functorial style. Type tactic changed to a type abbrevation (from a datatype). Constructor tactic and function apply deleted.
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 *)
934
2e0203309287 Replaced rules by defs. Also got rid of tyconstU by
lcp
parents: 916
diff changeset
    12
datatype <= "univ(TyConst)"
2e0203309287 Replaced rules by defs. Also got rid of tyconstU by
lcp
parents: 916
diff changeset
    13
  "Ty" = t_const("tc:TyConst")
2e0203309287 Replaced rules by defs. Also got rid of tyconstU by
lcp
parents: 916
diff changeset
    14
       | t_fun("t1:Ty","t2:Ty")
916
d03bb9f50b3b New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
    15
  
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
(* Definition of type environments and associated operators *)
d03bb9f50b3b New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
    18
d03bb9f50b3b New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
    19
consts
1401
0c439768f45c removed quotes from consts and syntax sections
clasohm
parents: 1155
diff changeset
    20
  TyEnv :: i
934
2e0203309287 Replaced rules by defs. Also got rid of tyconstU by
lcp
parents: 916
diff changeset
    21
datatype <= "univ(Ty Un ExVar)"
2e0203309287 Replaced rules by defs. Also got rid of tyconstU by
lcp
parents: 916
diff changeset
    22
  "TyEnv" = te_emp
2e0203309287 Replaced rules by defs. Also got rid of tyconstU by
lcp
parents: 916
diff changeset
    23
          | te_owr("te:TyEnv","x:ExVar","t:Ty") 
916
d03bb9f50b3b New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
    24
d03bb9f50b3b New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
    25
consts
1401
0c439768f45c removed quotes from consts and syntax sections
clasohm
parents: 1155
diff changeset
    26
  te_rec :: [i,i,[i,i,i,i]=>i] => i
934
2e0203309287 Replaced rules by defs. Also got rid of tyconstU by
lcp
parents: 916
diff changeset
    27
defs
916
d03bb9f50b3b New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
    28
  te_rec_def
1155
928a16e02f9f removed \...\ inside strings
clasohm
parents: 934
diff changeset
    29
    "te_rec(te,c,h) ==   
928a16e02f9f removed \...\ inside strings
clasohm
parents: 934
diff changeset
    30
    Vrec(te,%te g.TyEnv_case(c,%tem x t.h(tem,x,t,g`tem),te))"
916
d03bb9f50b3b New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
    31
  
d03bb9f50b3b New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
    32
consts
1401
0c439768f45c removed quotes from consts and syntax sections
clasohm
parents: 1155
diff changeset
    33
  te_dom :: i => i
0c439768f45c removed quotes from consts and syntax sections
clasohm
parents: 1155
diff changeset
    34
  te_app :: [i,i] => i
934
2e0203309287 Replaced rules by defs. Also got rid of tyconstU by
lcp
parents: 916
diff changeset
    35
defs
916
d03bb9f50b3b New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
    36
  te_dom_def "te_dom(te) == te_rec(te,0,% te x t r.r Un {x})"
d03bb9f50b3b New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
    37
  te_app_def "te_app(te,x) == te_rec(te,0, % te y t r.if(x=y,t,r))"
d03bb9f50b3b New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
    38
  
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