src/ZF/Datatype.ML
author paulson
Mon, 28 Dec 1998 16:59:28 +0100
changeset 6053 8a1059aa01f0
parent 1461 6bcb44e4d6e5
child 6112 5e4871c5136b
permissions -rw-r--r--
new inductive, datatype and primrec packages, etc.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
516
1957113f0d7d installation of new inductive/datatype sections
lcp
parents: 477
diff changeset
     1
(*  Title:      ZF/Datatype.ML
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     2
    ID:         $Id$
516
1957113f0d7d installation of new inductive/datatype sections
lcp
parents: 477
diff changeset
     3
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     4
    Copyright   1993  University of Cambridge
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     5
120
09287f26bfb8 changed all co- and co_ to co
lcp
parents: 70
diff changeset
     6
(Co)Datatype Definitions for Zermelo-Fraenkel Set Theory
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     7
*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     8
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     9
6053
8a1059aa01f0 new inductive, datatype and primrec packages, etc.
paulson
parents: 1461
diff changeset
    10
(*Typechecking rules for most datatypes involving univ*)
8a1059aa01f0 new inductive, datatype and primrec packages, etc.
paulson
parents: 1461
diff changeset
    11
structure Data_Arg =
8a1059aa01f0 new inductive, datatype and primrec packages, etc.
paulson
parents: 1461
diff changeset
    12
  struct
8a1059aa01f0 new inductive, datatype and primrec packages, etc.
paulson
parents: 1461
diff changeset
    13
  val intrs = 
8a1059aa01f0 new inductive, datatype and primrec packages, etc.
paulson
parents: 1461
diff changeset
    14
      [SigmaI, InlI, InrI,
8a1059aa01f0 new inductive, datatype and primrec packages, etc.
paulson
parents: 1461
diff changeset
    15
       Pair_in_univ, Inl_in_univ, Inr_in_univ, 
8a1059aa01f0 new inductive, datatype and primrec packages, etc.
paulson
parents: 1461
diff changeset
    16
       zero_in_univ, A_into_univ, nat_into_univ, UnCI];
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    17
6053
8a1059aa01f0 new inductive, datatype and primrec packages, etc.
paulson
parents: 1461
diff changeset
    18
  (*Needed for mutual recursion*)
8a1059aa01f0 new inductive, datatype and primrec packages, etc.
paulson
parents: 1461
diff changeset
    19
  val elims = [make_elim InlD, make_elim InrD];
516
1957113f0d7d installation of new inductive/datatype sections
lcp
parents: 477
diff changeset
    20
  end;
1957113f0d7d installation of new inductive/datatype sections
lcp
parents: 477
diff changeset
    21
1957113f0d7d installation of new inductive/datatype sections
lcp
parents: 477
diff changeset
    22
6053
8a1059aa01f0 new inductive, datatype and primrec packages, etc.
paulson
parents: 1461
diff changeset
    23
structure Data_Package = 
8a1059aa01f0 new inductive, datatype and primrec packages, etc.
paulson
parents: 1461
diff changeset
    24
    Add_datatype_def_Fun
8a1059aa01f0 new inductive, datatype and primrec packages, etc.
paulson
parents: 1461
diff changeset
    25
      (structure Fp=Lfp and Pr=Standard_Prod and CP=Standard_CP
8a1059aa01f0 new inductive, datatype and primrec packages, etc.
paulson
parents: 1461
diff changeset
    26
       and Su=Standard_Sum
8a1059aa01f0 new inductive, datatype and primrec packages, etc.
paulson
parents: 1461
diff changeset
    27
       and Ind_Package = Ind_Package
8a1059aa01f0 new inductive, datatype and primrec packages, etc.
paulson
parents: 1461
diff changeset
    28
       and Datatype_Arg = Data_Arg);
516
1957113f0d7d installation of new inductive/datatype sections
lcp
parents: 477
diff changeset
    29
1957113f0d7d installation of new inductive/datatype sections
lcp
parents: 477
diff changeset
    30
6053
8a1059aa01f0 new inductive, datatype and primrec packages, etc.
paulson
parents: 1461
diff changeset
    31
(*Typechecking rules for most codatatypes involving quniv*)
8a1059aa01f0 new inductive, datatype and primrec packages, etc.
paulson
parents: 1461
diff changeset
    32
structure CoData_Arg =
8a1059aa01f0 new inductive, datatype and primrec packages, etc.
paulson
parents: 1461
diff changeset
    33
  struct
8a1059aa01f0 new inductive, datatype and primrec packages, etc.
paulson
parents: 1461
diff changeset
    34
  val intrs = 
8a1059aa01f0 new inductive, datatype and primrec packages, etc.
paulson
parents: 1461
diff changeset
    35
      [QSigmaI, QInlI, QInrI,
8a1059aa01f0 new inductive, datatype and primrec packages, etc.
paulson
parents: 1461
diff changeset
    36
       QPair_in_quniv, QInl_in_quniv, QInr_in_quniv, 
8a1059aa01f0 new inductive, datatype and primrec packages, etc.
paulson
parents: 1461
diff changeset
    37
       zero_in_quniv, A_into_quniv, nat_into_quniv, UnCI];
516
1957113f0d7d installation of new inductive/datatype sections
lcp
parents: 477
diff changeset
    38
6053
8a1059aa01f0 new inductive, datatype and primrec packages, etc.
paulson
parents: 1461
diff changeset
    39
  val elims = [make_elim QInlD, make_elim QInrD];
8a1059aa01f0 new inductive, datatype and primrec packages, etc.
paulson
parents: 1461
diff changeset
    40
  end;
516
1957113f0d7d installation of new inductive/datatype sections
lcp
parents: 477
diff changeset
    41
6053
8a1059aa01f0 new inductive, datatype and primrec packages, etc.
paulson
parents: 1461
diff changeset
    42
structure CoData_Package = 
8a1059aa01f0 new inductive, datatype and primrec packages, etc.
paulson
parents: 1461
diff changeset
    43
    Add_datatype_def_Fun(structure Fp=Gfp and Pr=Quine_Prod and CP=Quine_CP
8a1059aa01f0 new inductive, datatype and primrec packages, etc.
paulson
parents: 1461
diff changeset
    44
                          and Su=Quine_Sum
8a1059aa01f0 new inductive, datatype and primrec packages, etc.
paulson
parents: 1461
diff changeset
    45
			  and Ind_Package = CoInd_Package
8a1059aa01f0 new inductive, datatype and primrec packages, etc.
paulson
parents: 1461
diff changeset
    46
			  and Datatype_Arg = CoData_Arg);
516
1957113f0d7d installation of new inductive/datatype sections
lcp
parents: 477
diff changeset
    47