author | lcp |
Fri, 28 Apr 1995 11:24:32 +0200 | |
changeset 1074 | d60f203eeddf |
parent 802 | 2f2fbf0a7e4f |
child 1461 | 6bcb44e4d6e5 |
permissions | -rw-r--r-- |
516 | 1 |
(* Title: ZF/Datatype.ML |
0 | 2 |
ID: $Id$ |
516 | 3 |
Author: Lawrence C Paulson, Cambridge University Computer Laboratory |
0 | 4 |
Copyright 1993 University of Cambridge |
5 |
||
120 | 6 |
(Co)Datatype Definitions for Zermelo-Fraenkel Set Theory |
0 | 7 |
*) |
8 |
||
9 |
||
10 |
(*For most datatypes involving univ*) |
|
70
8a29f8b4aca1
ZF/ind-syntax/fold_con_tac: deleted, since fold_tac now works
lcp
parents:
55
diff
changeset
|
11 |
val datatype_intrs = |
0 | 12 |
[SigmaI, InlI, InrI, |
13 |
Pair_in_univ, Inl_in_univ, Inr_in_univ, |
|
55 | 14 |
zero_in_univ, A_into_univ, nat_into_univ, UnCI]; |
0 | 15 |
|
55 | 16 |
(*Needed for mutual recursion*) |
70
8a29f8b4aca1
ZF/ind-syntax/fold_con_tac: deleted, since fold_tac now works
lcp
parents:
55
diff
changeset
|
17 |
val datatype_elims = [make_elim InlD, make_elim InrD]; |
0 | 18 |
|
120 | 19 |
(*For most codatatypes involving quniv*) |
20 |
val codatatype_intrs = |
|
0 | 21 |
[QSigmaI, QInlI, QInrI, |
22 |
QPair_in_quniv, QInl_in_quniv, QInr_in_quniv, |
|
55 | 23 |
zero_in_quniv, A_into_quniv, nat_into_quniv, UnCI]; |
0 | 24 |
|
120 | 25 |
val codatatype_elims = [make_elim QInlD, make_elim QInrD]; |
55 | 26 |
|
516 | 27 |
signature INDUCTIVE_THMS = |
28 |
sig |
|
29 |
val monos : thm list (*monotonicity of each M operator*) |
|
30 |
val type_intrs : thm list (*type-checking intro rules*) |
|
31 |
val type_elims : thm list (*type-checking elim rules*) |
|
32 |
end; |
|
33 |
||
34 |
functor Data_section_Fun |
|
35 |
(Arg: sig include CONSTRUCTOR_ARG INDUCTIVE_I INDUCTIVE_THMS end) |
|
36 |
: sig include CONSTRUCTOR_RESULT INTR_ELIM INDRULE end = |
|
37 |
struct |
|
38 |
||
39 |
structure Con = Constructor_Fun |
|
40 |
(structure Const = Arg and Pr=Standard_Prod and Su=Standard_Sum); |
|
41 |
||
42 |
structure Inductive = Ind_section_Fun |
|
43 |
(open Arg; |
|
44 |
val con_defs = Con.con_defs |
|
45 |
val type_intrs = Arg.type_intrs @ datatype_intrs |
|
46 |
val type_elims = Arg.type_elims @ datatype_elims); |
|
47 |
||
48 |
open Inductive Con |
|
49 |
end; |
|
50 |
||
51 |
||
52 |
functor CoData_section_Fun |
|
53 |
(Arg: sig include CONSTRUCTOR_ARG INDUCTIVE_I INDUCTIVE_THMS end) |
|
54 |
: sig include CONSTRUCTOR_RESULT INTR_ELIM COINDRULE end = |
|
55 |
struct |
|
56 |
||
57 |
structure Con = Constructor_Fun |
|
58 |
(structure Const = Arg and Pr=Quine_Prod and Su=Quine_Sum); |
|
59 |
||
60 |
structure CoInductive = CoInd_section_Fun |
|
61 |
(open Arg; |
|
62 |
val con_defs = Con.con_defs |
|
63 |
val type_intrs = Arg.type_intrs @ codatatype_intrs |
|
64 |
val type_elims = Arg.type_elims @ codatatype_elims); |
|
65 |
||
66 |
open CoInductive Con |
|
67 |
end; |
|
68 |
||
69 |