| author | wenzelm | 
| Tue, 05 Oct 1999 18:26:34 +0200 | |
| changeset 7742 | 01386eb4eab0 | 
| parent 5137 | 60205b0de9b9 | 
| child 11316 | b4e71bd751e4 | 
| 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 | |
| 5068 | 12 | Goal "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: 
515diff
changeset | 13 | let open data; val rew = rewrite_rule con_defs in | 
| 4091 | 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: 
515diff
changeset | 15 | end; | 
| 782 
200a16083201
added bind_thm for theorems defined by "standard ..."
 clasohm parents: 
529diff
changeset | 16 | qed "data_unfold"; | 
| 56 | 17 | |
| 18 | (** Lemmas to justify using "data" in other recursive type definitions **) | |
| 19 | ||
| 5137 | 20 | Goalw data.defs "[| 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: 
529diff
changeset | 24 | qed "data_mono"; | 
| 56 | 25 | |
| 5068 | 26 | Goalw (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); | |
| 4091 | 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: 
529diff
changeset | 31 | qed "data_univ"; | 
| 56 | 32 | |
| 782 
200a16083201
added bind_thm for theorems defined by "standard ..."
 clasohm parents: 
529diff
changeset | 33 | bind_thm ("data_subset_univ", ([data_mono, data_univ] MRS subset_trans));
 | 
| 56 | 34 | |
| 35 |