author | paulson |
Mon, 29 Sep 1997 11:37:02 +0200 | |
changeset 3724 | f33e301a89f5 |
parent 2496 | 40efb87985b5 |
child 4091 | 771b1f6422a8 |
permissions | -rw-r--r-- |
1461 | 1 |
(* Title: ZF/ex/Data.ML |
56 | 2 |
ID: $Id$ |
1461 | 3 |
Author: Lawrence C Paulson, Cambridge University Computer Laboratory |
56 | 4 |
Copyright 1993 University of Cambridge |
5 |
||
6 |
Sample datatype definition. |
|
7 |
It has four contructors, of arities 0-3, and two parameters A and B. |
|
8 |
*) |
|
9 |
||
515 | 10 |
open Data; |
56 | 11 |
|
515 | 12 |
goal Data.thy "data(A,B) = ({0} + A) + (A*B + A*B*data(A,B))"; |
529
f0d16216e394
ZF/List, ex/Brouwer,Data,LList,Ntree,TF,Term: much simplified proof of _unfold
lcp
parents:
515
diff
changeset
|
13 |
let open data; val rew = rewrite_rule con_defs in |
2496 | 14 |
by (fast_tac (!claset addSIs (map rew intrs) addEs [rew elim]) 1) |
529
f0d16216e394
ZF/List, ex/Brouwer,Data,LList,Ntree,TF,Term: much simplified proof of _unfold
lcp
parents:
515
diff
changeset
|
15 |
end; |
782
200a16083201
added bind_thm for theorems defined by "standard ..."
clasohm
parents:
529
diff
changeset
|
16 |
qed "data_unfold"; |
56 | 17 |
|
18 |
(** Lemmas to justify using "data" in other recursive type definitions **) |
|
19 |
||
515 | 20 |
goalw Data.thy data.defs "!!A B. [| A<=C; B<=D |] ==> data(A,B) <= data(C,D)"; |
56 | 21 |
by (rtac lfp_mono 1); |
515 | 22 |
by (REPEAT (rtac data.bnd_mono 1)); |
56 | 23 |
by (REPEAT (ares_tac (univ_mono::Un_mono::basic_monos) 1)); |
782
200a16083201
added bind_thm for theorems defined by "standard ..."
clasohm
parents:
529
diff
changeset
|
24 |
qed "data_mono"; |
56 | 25 |
|
515 | 26 |
goalw Data.thy (data.defs@data.con_defs) "data(univ(A),univ(A)) <= univ(A)"; |
56 | 27 |
by (rtac lfp_lowerbound 1); |
28 |
by (rtac ([A_subset_univ, Un_upper1] MRS subset_trans RS univ_mono) 2); |
|
2469 | 29 |
by (fast_tac (!claset addSIs [zero_in_univ, Inl_in_univ, Inr_in_univ, |
1461 | 30 |
Pair_in_univ]) 1); |
782
200a16083201
added bind_thm for theorems defined by "standard ..."
clasohm
parents:
529
diff
changeset
|
31 |
qed "data_univ"; |
56 | 32 |
|
782
200a16083201
added bind_thm for theorems defined by "standard ..."
clasohm
parents:
529
diff
changeset
|
33 |
bind_thm ("data_subset_univ", ([data_mono, data_univ] MRS subset_trans)); |
56 | 34 |
|
35 |