author | Christian Urban <urbanc@in.tum.de> |
Sun, 25 Oct 2009 23:44:41 +0100 | |
changeset 185 | 929bc55efff7 |
parent 182 | c7eff9882bd8 |
child 187 | f8fc085db38f |
permissions | -rw-r--r-- |
0 | 1 |
theory QuotMain |
6 | 2 |
imports QuotScript QuotList Prove |
71
35be65791f1d
exported parts of QuotMain into a separate ML-file
Christian Urban <urbanc@in.tum.de>
parents:
70
diff
changeset
|
3 |
uses ("quotient.ML") |
0 | 4 |
begin |
5 |
||
6 |
locale QUOT_TYPE = |
|
7 |
fixes R :: "'a \<Rightarrow> 'a \<Rightarrow> bool" |
|
8 |
and Abs :: "('a \<Rightarrow> bool) \<Rightarrow> 'b" |
|
9 |
and Rep :: "'b \<Rightarrow> ('a \<Rightarrow> bool)" |
|
10 |
assumes equiv: "EQUIV R" |
|
11 |
and rep_prop: "\<And>y. \<exists>x. Rep y = R x" |
|
12 |
and rep_inverse: "\<And>x. Abs (Rep x) = x" |
|
13 |
and abs_inverse: "\<And>x. (Rep (Abs (R x))) = (R x)" |
|
14 |
and rep_inject: "\<And>x y. (Rep x = Rep y) = (x = y)" |
|
15 | 15 |
begin |
0 | 16 |
|
17 |
definition |
|
18 |
"ABS x \<equiv> Abs (R x)" |
|
19 |
||
20 |
definition |
|
21 |
"REP a = Eps (Rep a)" |
|
22 |
||
15 | 23 |
lemma lem9: |
0 | 24 |
shows "R (Eps (R x)) = R x" |
25 |
proof - |
|
26 |
have a: "R x x" using equiv by (simp add: EQUIV_REFL_SYM_TRANS REFL_def) |
|
27 |
then have "R x (Eps (R x))" by (rule someI) |
|
15 | 28 |
then show "R (Eps (R x)) = R x" |
0 | 29 |
using equiv unfolding EQUIV_def by simp |
30 |
qed |
|
31 |
||
32 |
theorem thm10: |
|
24
6885fa184e89
Merged with my changes from the morning:
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
23
diff
changeset
|
33 |
shows "ABS (REP a) \<equiv> a" |
6885fa184e89
Merged with my changes from the morning:
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
23
diff
changeset
|
34 |
apply (rule eq_reflection) |
6885fa184e89
Merged with my changes from the morning:
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
23
diff
changeset
|
35 |
unfolding ABS_def REP_def |
0 | 36 |
proof - |
15 | 37 |
from rep_prop |
0 | 38 |
obtain x where eq: "Rep a = R x" by auto |
39 |
have "Abs (R (Eps (Rep a))) = Abs (R (Eps (R x)))" using eq by simp |
|
40 |
also have "\<dots> = Abs (R x)" using lem9 by simp |
|
41 |
also have "\<dots> = Abs (Rep a)" using eq by simp |
|
42 |
also have "\<dots> = a" using rep_inverse by simp |
|
43 |
finally |
|
44 |
show "Abs (R (Eps (Rep a))) = a" by simp |
|
45 |
qed |
|
46 |
||
15 | 47 |
lemma REP_refl: |
0 | 48 |
shows "R (REP a) (REP a)" |
49 |
unfolding REP_def |
|
50 |
by (simp add: equiv[simplified EQUIV_def]) |
|
51 |
||
52 |
lemma lem7: |
|
22 | 53 |
shows "(R x = R y) = (Abs (R x) = Abs (R y))" |
0 | 54 |
apply(rule iffI) |
55 |
apply(simp) |
|
56 |
apply(drule rep_inject[THEN iffD2]) |
|
57 |
apply(simp add: abs_inverse) |
|
58 |
done |
|
15 | 59 |
|
0 | 60 |
theorem thm11: |
61 |
shows "R r r' = (ABS r = ABS r')" |
|
62 |
unfolding ABS_def |
|
63 |
by (simp only: equiv[simplified EQUIV_def] lem7) |
|
64 |
||
4 | 65 |
|
2 | 66 |
lemma REP_ABS_rsp: |
4 | 67 |
shows "R f (REP (ABS g)) = R f g" |
68 |
and "R (REP (ABS g)) f = R g f" |
|
23 | 69 |
by (simp_all add: thm10 thm11) |
4 | 70 |
|
0 | 71 |
lemma QUOTIENT: |
72 |
"QUOTIENT R ABS REP" |
|
73 |
apply(unfold QUOTIENT_def) |
|
74 |
apply(simp add: thm10) |
|
75 |
apply(simp add: REP_refl) |
|
76 |
apply(subst thm11[symmetric]) |
|
77 |
apply(simp add: equiv[simplified EQUIV_def]) |
|
78 |
done |
|
79 |
||
21
d15121412caa
Added more useful quotient facts.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
20
diff
changeset
|
80 |
lemma R_trans: |
49 | 81 |
assumes ab: "R a b" |
82 |
and bc: "R b c" |
|
22 | 83 |
shows "R a c" |
21
d15121412caa
Added more useful quotient facts.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
20
diff
changeset
|
84 |
proof - |
d15121412caa
Added more useful quotient facts.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
20
diff
changeset
|
85 |
have tr: "TRANS R" using equiv EQUIV_REFL_SYM_TRANS[of R] by simp |
d15121412caa
Added more useful quotient facts.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
20
diff
changeset
|
86 |
moreover have ab: "R a b" by fact |
d15121412caa
Added more useful quotient facts.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
20
diff
changeset
|
87 |
moreover have bc: "R b c" by fact |
22 | 88 |
ultimately show "R a c" unfolding TRANS_def by blast |
21
d15121412caa
Added more useful quotient facts.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
20
diff
changeset
|
89 |
qed |
d15121412caa
Added more useful quotient facts.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
20
diff
changeset
|
90 |
|
d15121412caa
Added more useful quotient facts.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
20
diff
changeset
|
91 |
lemma R_sym: |
49 | 92 |
assumes ab: "R a b" |
22 | 93 |
shows "R b a" |
21
d15121412caa
Added more useful quotient facts.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
20
diff
changeset
|
94 |
proof - |
d15121412caa
Added more useful quotient facts.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
20
diff
changeset
|
95 |
have re: "SYM R" using equiv EQUIV_REFL_SYM_TRANS[of R] by simp |
22 | 96 |
then show "R b a" using ab unfolding SYM_def by blast |
21
d15121412caa
Added more useful quotient facts.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
20
diff
changeset
|
97 |
qed |
d15121412caa
Added more useful quotient facts.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
20
diff
changeset
|
98 |
|
49 | 99 |
lemma R_trans2: |
100 |
assumes ac: "R a c" |
|
22 | 101 |
and bd: "R b d" |
21
d15121412caa
Added more useful quotient facts.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
20
diff
changeset
|
102 |
shows "R a b = R c d" |
d15121412caa
Added more useful quotient facts.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
20
diff
changeset
|
103 |
proof |
23 | 104 |
assume "R a b" |
21
d15121412caa
Added more useful quotient facts.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
20
diff
changeset
|
105 |
then have "R b a" using R_sym by blast |
d15121412caa
Added more useful quotient facts.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
20
diff
changeset
|
106 |
then have "R b c" using ac R_trans by blast |
d15121412caa
Added more useful quotient facts.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
20
diff
changeset
|
107 |
then have "R c b" using R_sym by blast |
d15121412caa
Added more useful quotient facts.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
20
diff
changeset
|
108 |
then show "R c d" using bd R_trans by blast |
d15121412caa
Added more useful quotient facts.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
20
diff
changeset
|
109 |
next |
23 | 110 |
assume "R c d" |
21
d15121412caa
Added more useful quotient facts.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
20
diff
changeset
|
111 |
then have "R a d" using ac R_trans by blast |
d15121412caa
Added more useful quotient facts.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
20
diff
changeset
|
112 |
then have "R d a" using R_sym by blast |
d15121412caa
Added more useful quotient facts.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
20
diff
changeset
|
113 |
then have "R b a" using bd R_trans by blast |
d15121412caa
Added more useful quotient facts.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
20
diff
changeset
|
114 |
then show "R a b" using R_sym by blast |
d15121412caa
Added more useful quotient facts.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
20
diff
changeset
|
115 |
qed |
d15121412caa
Added more useful quotient facts.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
20
diff
changeset
|
116 |
|
d15121412caa
Added more useful quotient facts.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
20
diff
changeset
|
117 |
lemma REPS_same: |
25
9020ee23a020
The tactic with REPEAT, CHANGED and a proper simpset.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
24
diff
changeset
|
118 |
shows "R (REP a) (REP b) \<equiv> (a = b)" |
38 | 119 |
proof - |
120 |
have "R (REP a) (REP b) = (a = b)" |
|
121 |
proof |
|
122 |
assume as: "R (REP a) (REP b)" |
|
123 |
from rep_prop |
|
124 |
obtain x y |
|
125 |
where eqs: "Rep a = R x" "Rep b = R y" by blast |
|
126 |
from eqs have "R (Eps (R x)) (Eps (R y))" using as unfolding REP_def by simp |
|
127 |
then have "R x (Eps (R y))" using lem9 by simp |
|
128 |
then have "R (Eps (R y)) x" using R_sym by blast |
|
129 |
then have "R y x" using lem9 by simp |
|
130 |
then have "R x y" using R_sym by blast |
|
131 |
then have "ABS x = ABS y" using thm11 by simp |
|
132 |
then have "Abs (Rep a) = Abs (Rep b)" using eqs unfolding ABS_def by simp |
|
133 |
then show "a = b" using rep_inverse by simp |
|
134 |
next |
|
135 |
assume ab: "a = b" |
|
136 |
have "REFL R" using equiv EQUIV_REFL_SYM_TRANS[of R] by simp |
|
137 |
then show "R (REP a) (REP b)" unfolding REFL_def using ab by auto |
|
138 |
qed |
|
139 |
then show "R (REP a) (REP b) \<equiv> (a = b)" by simp |
|
21
d15121412caa
Added more useful quotient facts.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
20
diff
changeset
|
140 |
qed |
d15121412caa
Added more useful quotient facts.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
20
diff
changeset
|
141 |
|
0 | 142 |
end |
143 |
||
127
b054cf6bd179
the command "quotient" can now define more than one quotient at the same time; quotients need to be separated by and
Christian Urban <urbanc@in.tum.de>
parents:
126
diff
changeset
|
144 |
|
0 | 145 |
section {* type definition for the quotient type *} |
146 |
||
185
929bc55efff7
added code for declaring map-functions
Christian Urban <urbanc@in.tum.de>
parents:
182
diff
changeset
|
147 |
ML {* Toplevel.theory *} |
929bc55efff7
added code for declaring map-functions
Christian Urban <urbanc@in.tum.de>
parents:
182
diff
changeset
|
148 |
|
71
35be65791f1d
exported parts of QuotMain into a separate ML-file
Christian Urban <urbanc@in.tum.de>
parents:
70
diff
changeset
|
149 |
use "quotient.ML" |
0 | 150 |
|
185
929bc55efff7
added code for declaring map-functions
Christian Urban <urbanc@in.tum.de>
parents:
182
diff
changeset
|
151 |
declare [[map list = (map, LIST_REL)]] |
929bc55efff7
added code for declaring map-functions
Christian Urban <urbanc@in.tum.de>
parents:
182
diff
changeset
|
152 |
declare [[map * = (prod_fun, prod_rel)]] |
929bc55efff7
added code for declaring map-functions
Christian Urban <urbanc@in.tum.de>
parents:
182
diff
changeset
|
153 |
declare [[map "fun" = (fun_map, FUN_REL)]] |
929bc55efff7
added code for declaring map-functions
Christian Urban <urbanc@in.tum.de>
parents:
182
diff
changeset
|
154 |
|
929bc55efff7
added code for declaring map-functions
Christian Urban <urbanc@in.tum.de>
parents:
182
diff
changeset
|
155 |
ML {* maps_lookup @{theory} "List.list" *} |
929bc55efff7
added code for declaring map-functions
Christian Urban <urbanc@in.tum.de>
parents:
182
diff
changeset
|
156 |
ML {* maps_lookup @{theory} "*" *} |
929bc55efff7
added code for declaring map-functions
Christian Urban <urbanc@in.tum.de>
parents:
182
diff
changeset
|
157 |
ML {* maps_lookup @{theory} "fun" *} |
174
09048a951dca
moved the map_funs setup into QuotMain
Christian Urban <urbanc@in.tum.de>
parents:
170
diff
changeset
|
158 |
|
14
5f6ee943c697
Generalized interpretation, works for all examples.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
13
diff
changeset
|
159 |
ML {* |
5f6ee943c697
Generalized interpretation, works for all examples.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
13
diff
changeset
|
160 |
val no_vars = Thm.rule_attribute (fn context => fn th => |
5f6ee943c697
Generalized interpretation, works for all examples.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
13
diff
changeset
|
161 |
let |
5f6ee943c697
Generalized interpretation, works for all examples.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
13
diff
changeset
|
162 |
val ctxt = Variable.set_body false (Context.proof_of context); |
5f6ee943c697
Generalized interpretation, works for all examples.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
13
diff
changeset
|
163 |
val ((_, [th']), _) = Variable.import true [th] ctxt; |
5f6ee943c697
Generalized interpretation, works for all examples.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
13
diff
changeset
|
164 |
in th' end); |
5f6ee943c697
Generalized interpretation, works for all examples.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
13
diff
changeset
|
165 |
*} |
5f6ee943c697
Generalized interpretation, works for all examples.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
13
diff
changeset
|
166 |
|
0 | 167 |
section {* lifting of constants *} |
168 |
||
169 |
ML {* |
|
185
929bc55efff7
added code for declaring map-functions
Christian Urban <urbanc@in.tum.de>
parents:
182
diff
changeset
|
170 |
|
929bc55efff7
added code for declaring map-functions
Christian Urban <urbanc@in.tum.de>
parents:
182
diff
changeset
|
171 |
*} |
929bc55efff7
added code for declaring map-functions
Christian Urban <urbanc@in.tum.de>
parents:
182
diff
changeset
|
172 |
|
929bc55efff7
added code for declaring map-functions
Christian Urban <urbanc@in.tum.de>
parents:
182
diff
changeset
|
173 |
ML {* |
118
1c30d48bfc15
slightly simplified get_fun function
Christian Urban <urbanc@in.tum.de>
parents:
117
diff
changeset
|
174 |
(* calculates the aggregate abs and rep functions for a given type; |
1c30d48bfc15
slightly simplified get_fun function
Christian Urban <urbanc@in.tum.de>
parents:
117
diff
changeset
|
175 |
repF is for constants' arguments; absF is for constants; |
1c30d48bfc15
slightly simplified get_fun function
Christian Urban <urbanc@in.tum.de>
parents:
117
diff
changeset
|
176 |
function types need to be treated specially, since repF and absF |
163
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
162
diff
changeset
|
177 |
change |
118
1c30d48bfc15
slightly simplified get_fun function
Christian Urban <urbanc@in.tum.de>
parents:
117
diff
changeset
|
178 |
*) |
46 | 179 |
datatype flag = absF | repF |
0 | 180 |
|
109
386671ef36bd
fixed the problem with function types; but only type_of works; cterm_of does not work
Christian Urban <urbanc@in.tum.de>
parents:
108
diff
changeset
|
181 |
fun negF absF = repF |
386671ef36bd
fixed the problem with function types; but only type_of works; cterm_of does not work
Christian Urban <urbanc@in.tum.de>
parents:
108
diff
changeset
|
182 |
| negF repF = absF |
386671ef36bd
fixed the problem with function types; but only type_of works; cterm_of does not work
Christian Urban <urbanc@in.tum.de>
parents:
108
diff
changeset
|
183 |
|
46 | 184 |
fun get_fun flag rty qty lthy ty = |
0 | 185 |
let |
186 |
val qty_name = Long_Name.base_name (fst (dest_Type qty)) |
|
15 | 187 |
|
0 | 188 |
fun get_fun_aux s fs_tys = |
189 |
let |
|
190 |
val (fs, tys) = split_list fs_tys |
|
15 | 191 |
val (otys, ntys) = split_list tys |
0 | 192 |
val oty = Type (s, otys) |
193 |
val nty = Type (s, ntys) |
|
194 |
val ftys = map (op -->) tys |
|
195 |
in |
|
130
8e8ba210f0f7
moved the map-info and fun-info section to quotient.ML
Christian Urban <urbanc@in.tum.de>
parents:
129
diff
changeset
|
196 |
(case (maps_lookup (ProofContext.theory_of lthy) s) of |
110
f5f641c05794
A fix for one fun_map; doesn't work for more.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
109
diff
changeset
|
197 |
SOME info => (list_comb (Const (#mapfun info, ftys ---> (oty --> nty)), fs), (oty, nty)) |
f5f641c05794
A fix for one fun_map; doesn't work for more.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
109
diff
changeset
|
198 |
| NONE => raise ERROR ("no map association for type " ^ s)) |
f5f641c05794
A fix for one fun_map; doesn't work for more.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
109
diff
changeset
|
199 |
end |
f5f641c05794
A fix for one fun_map; doesn't work for more.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
109
diff
changeset
|
200 |
|
118
1c30d48bfc15
slightly simplified get_fun function
Christian Urban <urbanc@in.tum.de>
parents:
117
diff
changeset
|
201 |
fun get_fun_fun fs_tys = |
110
f5f641c05794
A fix for one fun_map; doesn't work for more.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
109
diff
changeset
|
202 |
let |
f5f641c05794
A fix for one fun_map; doesn't work for more.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
109
diff
changeset
|
203 |
val (fs, tys) = split_list fs_tys |
f5f641c05794
A fix for one fun_map; doesn't work for more.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
109
diff
changeset
|
204 |
val ([oty1, oty2], [nty1, nty2]) = split_list tys |
128 | 205 |
val oty = nty1 --> oty2 |
206 |
val nty = oty1 --> nty2 |
|
110
f5f641c05794
A fix for one fun_map; doesn't work for more.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
109
diff
changeset
|
207 |
val ftys = map (op -->) tys |
f5f641c05794
A fix for one fun_map; doesn't work for more.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
109
diff
changeset
|
208 |
in |
118
1c30d48bfc15
slightly simplified get_fun function
Christian Urban <urbanc@in.tum.de>
parents:
117
diff
changeset
|
209 |
(list_comb (Const (@{const_name "fun_map"}, ftys ---> oty --> nty), fs), (oty, nty)) |
0 | 210 |
end |
211 |
||
170 | 212 |
val thy = ProofContext.theory_of lthy |
213 |
||
214 |
fun get_const absF = (Const (Sign.full_bname thy ("ABS_" ^ qty_name), rty --> qty), (rty, qty)) |
|
215 |
| get_const repF = (Const (Sign.full_bname thy ("REP_" ^ qty_name), qty --> rty), (qty, rty)) |
|
41
72d63aa8af68
added ctxt as explicit argument to build_goal; tuned
Christian Urban <urbanc@in.tum.de>
parents:
40
diff
changeset
|
216 |
|
70
f3cbda066c3a
consistent usage of rty (for the raw, unquotient type); tuned a bit the Isar
Christian Urban <urbanc@in.tum.de>
parents:
69
diff
changeset
|
217 |
fun mk_identity ty = Abs ("", ty, Bound 0) |
41
72d63aa8af68
added ctxt as explicit argument to build_goal; tuned
Christian Urban <urbanc@in.tum.de>
parents:
40
diff
changeset
|
218 |
|
0 | 219 |
in |
220 |
if ty = qty |
|
46 | 221 |
then (get_const flag) |
0 | 222 |
else (case ty of |
41
72d63aa8af68
added ctxt as explicit argument to build_goal; tuned
Christian Urban <urbanc@in.tum.de>
parents:
40
diff
changeset
|
223 |
TFree _ => (mk_identity ty, (ty, ty)) |
118
1c30d48bfc15
slightly simplified get_fun function
Christian Urban <urbanc@in.tum.de>
parents:
117
diff
changeset
|
224 |
| Type (_, []) => (mk_identity ty, (ty, ty)) |
109
386671ef36bd
fixed the problem with function types; but only type_of works; cterm_of does not work
Christian Urban <urbanc@in.tum.de>
parents:
108
diff
changeset
|
225 |
| Type ("fun" , [ty1, ty2]) => |
118
1c30d48bfc15
slightly simplified get_fun function
Christian Urban <urbanc@in.tum.de>
parents:
117
diff
changeset
|
226 |
get_fun_fun [get_fun (negF flag) rty qty lthy ty1, get_fun flag rty qty lthy ty2] |
46 | 227 |
| Type (s, tys) => get_fun_aux s (map (get_fun flag rty qty lthy) tys) |
41
72d63aa8af68
added ctxt as explicit argument to build_goal; tuned
Christian Urban <urbanc@in.tum.de>
parents:
40
diff
changeset
|
228 |
| _ => raise ERROR ("no type variables") |
0 | 229 |
) |
230 |
end |
|
231 |
*} |
|
232 |
||
180
fcacca9588b4
changed the definitions of liftet constants to use fun_maps
Christian Urban <urbanc@in.tum.de>
parents:
174
diff
changeset
|
233 |
|
41
72d63aa8af68
added ctxt as explicit argument to build_goal; tuned
Christian Urban <urbanc@in.tum.de>
parents:
40
diff
changeset
|
234 |
text {* produces the definition for a lifted constant *} |
86 | 235 |
|
2 | 236 |
ML {* |
0 | 237 |
fun get_const_def nconst oconst rty qty lthy = |
238 |
let |
|
239 |
val ty = fastype_of nconst |
|
240 |
val (arg_tys, res_ty) = strip_type ty |
|
14
5f6ee943c697
Generalized interpretation, works for all examples.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
13
diff
changeset
|
241 |
|
0 | 242 |
val fresh_args = arg_tys |> map (pair "x") |
15 | 243 |
|> Variable.variant_frees lthy [nconst, oconst] |
0 | 244 |
|> map Free |
245 |
||
46 | 246 |
val rep_fns = map (fst o get_fun repF rty qty lthy) arg_tys |
247 |
val abs_fn = (fst o get_fun absF rty qty lthy) res_ty |
|
0 | 248 |
|
180
fcacca9588b4
changed the definitions of liftet constants to use fun_maps
Christian Urban <urbanc@in.tum.de>
parents:
174
diff
changeset
|
249 |
fun mk_fun_map (t1,t2) = Const (@{const_name "fun_map"}, dummyT) $ t1 $ t2 |
fcacca9588b4
changed the definitions of liftet constants to use fun_maps
Christian Urban <urbanc@in.tum.de>
parents:
174
diff
changeset
|
250 |
|
fcacca9588b4
changed the definitions of liftet constants to use fun_maps
Christian Urban <urbanc@in.tum.de>
parents:
174
diff
changeset
|
251 |
val fns = Library.foldr (mk_fun_map) (rep_fns, abs_fn) |
fcacca9588b4
changed the definitions of liftet constants to use fun_maps
Christian Urban <urbanc@in.tum.de>
parents:
174
diff
changeset
|
252 |
|> Syntax.check_term lthy |
0 | 253 |
in |
180
fcacca9588b4
changed the definitions of liftet constants to use fun_maps
Christian Urban <urbanc@in.tum.de>
parents:
174
diff
changeset
|
254 |
fns $ oconst |
0 | 255 |
end |
256 |
*} |
|
257 |
||
258 |
ML {* |
|
15 | 259 |
fun exchange_ty rty qty ty = |
49 | 260 |
if ty = rty |
41
72d63aa8af68
added ctxt as explicit argument to build_goal; tuned
Christian Urban <urbanc@in.tum.de>
parents:
40
diff
changeset
|
261 |
then qty |
15 | 262 |
else |
0 | 263 |
(case ty of |
264 |
Type (s, tys) => Type (s, map (exchange_ty rty qty) tys) |
|
41
72d63aa8af68
added ctxt as explicit argument to build_goal; tuned
Christian Urban <urbanc@in.tum.de>
parents:
40
diff
changeset
|
265 |
| _ => ty |
72d63aa8af68
added ctxt as explicit argument to build_goal; tuned
Christian Urban <urbanc@in.tum.de>
parents:
40
diff
changeset
|
266 |
) |
0 | 267 |
*} |
268 |
||
269 |
ML {* |
|
17
55b646c6c4cd
More naming/binding suggestions from Makarius
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
16
diff
changeset
|
270 |
fun make_const_def nconst_bname oconst mx rty qty lthy = |
0 | 271 |
let |
272 |
val oconst_ty = fastype_of oconst |
|
273 |
val nconst_ty = exchange_ty rty qty oconst_ty |
|
17
55b646c6c4cd
More naming/binding suggestions from Makarius
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
16
diff
changeset
|
274 |
val nconst = Const (Binding.name_of nconst_bname, nconst_ty) |
0 | 275 |
val def_trm = get_const_def nconst oconst rty qty lthy |
276 |
in |
|
79
c0c41fefeb06
added quotient command (you need to update isar-keywords-prove.el)
Christian Urban <urbanc@in.tum.de>
parents:
77
diff
changeset
|
277 |
define (nconst_bname, mx, def_trm) lthy |
15 | 278 |
end |
0 | 279 |
*} |
280 |
||
139 | 281 |
section {* ATOMIZE *} |
282 |
||
283 |
text {* |
|
284 |
Unabs_def converts a definition given as |
|
285 |
||
286 |
c \<equiv> %x. %y. f x y |
|
287 |
||
288 |
to a theorem of the form |
|
289 |
||
290 |
c x y \<equiv> f x y |
|
291 |
||
292 |
This function is needed to rewrite the right-hand |
|
293 |
side to the left-hand side. |
|
294 |
*} |
|
295 |
||
296 |
ML {* |
|
297 |
fun unabs_def ctxt def = |
|
298 |
let |
|
299 |
val (lhs, rhs) = Thm.dest_equals (cprop_of def) |
|
300 |
val xs = strip_abs_vars (term_of rhs) |
|
301 |
val (_, ctxt') = Variable.add_fixes (map fst xs) ctxt |
|
302 |
||
303 |
val thy = ProofContext.theory_of ctxt' |
|
304 |
val cxs = map (cterm_of thy o Free) xs |
|
305 |
val new_lhs = Drule.list_comb (lhs, cxs) |
|
306 |
||
307 |
fun get_conv [] = Conv.rewr_conv def |
|
308 |
| get_conv (x::xs) = Conv.fun_conv (get_conv xs) |
|
309 |
in |
|
310 |
get_conv xs new_lhs |> |
|
311 |
singleton (ProofContext.export ctxt' ctxt) |
|
312 |
end |
|
313 |
*} |
|
314 |
||
315 |
lemma atomize_eqv[atomize]: |
|
316 |
shows "(Trueprop A \<equiv> Trueprop B) \<equiv> (A \<equiv> B)" |
|
317 |
proof |
|
318 |
assume "A \<equiv> B" |
|
319 |
then show "Trueprop A \<equiv> Trueprop B" by unfold |
|
320 |
next |
|
321 |
assume *: "Trueprop A \<equiv> Trueprop B" |
|
322 |
have "A = B" |
|
323 |
proof (cases A) |
|
324 |
case True |
|
325 |
have "A" by fact |
|
326 |
then show "A = B" using * by simp |
|
327 |
next |
|
328 |
case False |
|
329 |
have "\<not>A" by fact |
|
330 |
then show "A = B" using * by auto |
|
331 |
qed |
|
332 |
then show "A \<equiv> B" by (rule eq_reflection) |
|
333 |
qed |
|
334 |
||
335 |
ML {* |
|
336 |
fun atomize_thm thm = |
|
337 |
let |
|
338 |
val thm' = forall_intr_vars thm |
|
339 |
val thm'' = ObjectLogic.atomize (cprop_of thm') |
|
340 |
in |
|
140
00d141f2daa7
Further reorganizing the file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
139
diff
changeset
|
341 |
Thm.freezeT (Simplifier.rewrite_rule [thm''] thm') |
139 | 342 |
end |
343 |
*} |
|
344 |
||
140
00d141f2daa7
Further reorganizing the file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
139
diff
changeset
|
345 |
ML {* atomize_thm @{thm list.induct} *} |
139 | 346 |
|
347 |
section {* REGULARIZE *} |
|
348 |
||
349 |
text {* tyRel takes a type and builds a relation that a quantifier over this |
|
350 |
type needs to respect. *} |
|
351 |
ML {* |
|
352 |
fun tyRel ty rty rel lthy = |
|
353 |
if ty = rty |
|
354 |
then rel |
|
355 |
else (case ty of |
|
356 |
Type (s, tys) => |
|
357 |
let |
|
358 |
val tys_rel = map (fn ty => ty --> ty --> @{typ bool}) tys; |
|
359 |
val ty_out = ty --> ty --> @{typ bool}; |
|
360 |
val tys_out = tys_rel ---> ty_out; |
|
361 |
in |
|
362 |
(case (maps_lookup (ProofContext.theory_of lthy) s) of |
|
363 |
SOME (info) => list_comb (Const (#relfun info, tys_out), map (fn ty => tyRel ty rty rel lthy) tys) |
|
364 |
| NONE => HOLogic.eq_const ty |
|
365 |
) |
|
366 |
end |
|
367 |
| _ => HOLogic.eq_const ty) |
|
368 |
*} |
|
369 |
||
370 |
definition |
|
371 |
Babs :: "('a \<Rightarrow> bool) \<Rightarrow> ('a \<Rightarrow> 'b) \<Rightarrow> 'a \<Rightarrow> 'b" |
|
372 |
where |
|
373 |
"(x \<in> p) \<Longrightarrow> (Babs p m x = m x)" |
|
374 |
(* TODO: Consider defining it with an "if"; sth like: |
|
375 |
Babs p m = \<lambda>x. if x \<in> p then m x else undefined |
|
376 |
*) |
|
377 |
||
378 |
ML {* |
|
379 |
fun needs_lift (rty as Type (rty_s, _)) ty = |
|
380 |
case ty of |
|
381 |
Type (s, tys) => |
|
382 |
(s = rty_s) orelse (exists (needs_lift rty) tys) |
|
383 |
| _ => false |
|
384 |
||
385 |
*} |
|
386 |
||
387 |
ML {* |
|
388 |
(* trm \<Rightarrow> new_trm *) |
|
389 |
fun regularise trm rty rel lthy = |
|
390 |
case trm of |
|
391 |
Abs (x, T, t) => |
|
392 |
if (needs_lift rty T) then let |
|
393 |
val ([x'], lthy2) = Variable.variant_fixes [x] lthy; |
|
394 |
val v = Free (x', T); |
|
395 |
val t' = subst_bound (v, t); |
|
396 |
val rec_term = regularise t' rty rel lthy2; |
|
397 |
val lam_term = Term.lambda_name (x, v) rec_term; |
|
398 |
val sub_res_term = tyRel T rty rel lthy; |
|
399 |
val respects = Const (@{const_name Respects}, (fastype_of sub_res_term) --> T --> @{typ bool}); |
|
400 |
val res_term = respects $ sub_res_term; |
|
401 |
val ty = fastype_of trm; |
|
402 |
val rabs = Const (@{const_name Babs}, (fastype_of res_term) --> ty --> ty); |
|
403 |
val rabs_term = (rabs $ res_term) $ lam_term; |
|
404 |
in |
|
405 |
rabs_term |
|
406 |
end else let |
|
407 |
val ([x'], lthy2) = Variable.variant_fixes [x] lthy; |
|
408 |
val v = Free (x', T); |
|
409 |
val t' = subst_bound (v, t); |
|
410 |
val rec_term = regularise t' rty rel lthy2; |
|
411 |
in |
|
412 |
Term.lambda_name (x, v) rec_term |
|
413 |
end |
|
414 |
| ((Const (@{const_name "All"}, at)) $ (Abs (x, T, t))) => |
|
415 |
if (needs_lift rty T) then let |
|
416 |
val ([x'], lthy2) = Variable.variant_fixes [x] lthy; |
|
417 |
val v = Free (x', T); |
|
418 |
val t' = subst_bound (v, t); |
|
419 |
val rec_term = regularise t' rty rel lthy2; |
|
420 |
val lam_term = Term.lambda_name (x, v) rec_term; |
|
421 |
val sub_res_term = tyRel T rty rel lthy; |
|
422 |
val respects = Const (@{const_name Respects}, (fastype_of sub_res_term) --> T --> @{typ bool}); |
|
423 |
val res_term = respects $ sub_res_term; |
|
424 |
val ty = fastype_of lam_term; |
|
425 |
val rall = Const (@{const_name Ball}, (fastype_of res_term) --> ty --> @{typ bool}); |
|
426 |
val rall_term = (rall $ res_term) $ lam_term; |
|
427 |
in |
|
428 |
rall_term |
|
429 |
end else let |
|
430 |
val ([x'], lthy2) = Variable.variant_fixes [x] lthy; |
|
431 |
val v = Free (x', T); |
|
432 |
val t' = subst_bound (v, t); |
|
433 |
val rec_term = regularise t' rty rel lthy2; |
|
434 |
val lam_term = Term.lambda_name (x, v) rec_term |
|
435 |
in |
|
436 |
Const(@{const_name "All"}, at) $ lam_term |
|
437 |
end |
|
438 |
| ((Const (@{const_name "All"}, at)) $ P) => |
|
439 |
let |
|
440 |
val (_, [al, _]) = dest_Type (fastype_of P); |
|
441 |
val ([x], lthy2) = Variable.variant_fixes [""] lthy; |
|
442 |
val v = (Free (x, al)); |
|
443 |
val abs = Term.lambda_name (x, v) (P $ v); |
|
444 |
in regularise ((Const (@{const_name "All"}, at)) $ abs) rty rel lthy2 end |
|
445 |
| ((Const (@{const_name "Ex"}, at)) $ (Abs (x, T, t))) => |
|
446 |
if (needs_lift rty T) then let |
|
447 |
val ([x'], lthy2) = Variable.variant_fixes [x] lthy; |
|
448 |
val v = Free (x', T); |
|
449 |
val t' = subst_bound (v, t); |
|
450 |
val rec_term = regularise t' rty rel lthy2; |
|
451 |
val lam_term = Term.lambda_name (x, v) rec_term; |
|
452 |
val sub_res_term = tyRel T rty rel lthy; |
|
453 |
val respects = Const (@{const_name Respects}, (fastype_of sub_res_term) --> T --> @{typ bool}); |
|
454 |
val res_term = respects $ sub_res_term; |
|
455 |
val ty = fastype_of lam_term; |
|
456 |
val rall = Const (@{const_name Bex}, (fastype_of res_term) --> ty --> @{typ bool}); |
|
457 |
val rall_term = (rall $ res_term) $ lam_term; |
|
458 |
in |
|
459 |
rall_term |
|
460 |
end else let |
|
461 |
val ([x'], lthy2) = Variable.variant_fixes [x] lthy; |
|
462 |
val v = Free (x', T); |
|
463 |
val t' = subst_bound (v, t); |
|
464 |
val rec_term = regularise t' rty rel lthy2; |
|
465 |
val lam_term = Term.lambda_name (x, v) rec_term |
|
466 |
in |
|
467 |
Const(@{const_name "Ex"}, at) $ lam_term |
|
468 |
end |
|
469 |
| ((Const (@{const_name "Ex"}, at)) $ P) => |
|
470 |
let |
|
471 |
val (_, [al, _]) = dest_Type (fastype_of P); |
|
472 |
val ([x], lthy2) = Variable.variant_fixes [""] lthy; |
|
473 |
val v = (Free (x, al)); |
|
474 |
val abs = Term.lambda_name (x, v) (P $ v); |
|
475 |
in regularise ((Const (@{const_name "Ex"}, at)) $ abs) rty rel lthy2 end |
|
476 |
| a $ b => (regularise a rty rel lthy) $ (regularise b rty rel lthy) |
|
477 |
| _ => trm |
|
478 |
||
479 |
*} |
|
480 |
||
481 |
(* my version of regularise *) |
|
482 |
(****************************) |
|
483 |
||
484 |
(* some helper functions *) |
|
485 |
||
486 |
||
487 |
ML {* |
|
488 |
fun mk_babs ty ty' = Const (@{const_name "Babs"}, [ty' --> @{typ bool}, ty] ---> ty) |
|
489 |
fun mk_ball ty = Const (@{const_name "Ball"}, [ty, ty] ---> @{typ bool}) |
|
490 |
fun mk_bex ty = Const (@{const_name "Bex"}, [ty, ty] ---> @{typ bool}) |
|
491 |
fun mk_resp ty = Const (@{const_name Respects}, [[ty, ty] ---> @{typ bool}, ty] ---> @{typ bool}) |
|
492 |
*} |
|
493 |
||
494 |
(* applies f to the subterm of an abstractions, otherwise to the given term *) |
|
495 |
ML {* |
|
496 |
fun apply_subt f trm = |
|
497 |
case trm of |
|
145 | 498 |
Abs (x, T, t) => |
499 |
let |
|
500 |
val (x', t') = Term.dest_abs (x, T, t) |
|
501 |
in |
|
502 |
Term.absfree (x', T, f t') |
|
503 |
end |
|
139 | 504 |
| _ => f trm |
505 |
*} |
|
506 |
||
507 |
||
508 |
(* FIXME: assumes always the typ is qty! *) |
|
509 |
(* FIXME: if there are more than one quotient, then you have to look up the relation *) |
|
510 |
ML {* |
|
511 |
fun my_reg rel trm = |
|
512 |
case trm of |
|
513 |
Abs (x, T, t) => |
|
514 |
let |
|
515 |
val ty1 = fastype_of trm |
|
516 |
in |
|
146 | 517 |
(mk_babs ty1 T) $ (mk_resp T $ rel) $ (apply_subt (my_reg rel) trm) |
139 | 518 |
end |
519 |
| Const (@{const_name "All"}, ty) $ t => |
|
520 |
let |
|
521 |
val ty1 = domain_type ty |
|
522 |
val ty2 = domain_type ty1 |
|
523 |
in |
|
524 |
(mk_ball ty1) $ (mk_resp ty2 $ rel) $ (apply_subt (my_reg rel) t) |
|
525 |
end |
|
526 |
| Const (@{const_name "Ex"}, ty) $ t => |
|
527 |
let |
|
528 |
val ty1 = domain_type ty |
|
529 |
val ty2 = domain_type ty1 |
|
530 |
in |
|
531 |
(mk_bex ty1) $ (mk_resp ty2 $ rel) $ (apply_subt (my_reg rel) t) |
|
532 |
end |
|
533 |
| t1 $ t2 => (my_reg rel t1) $ (my_reg rel t2) |
|
534 |
| _ => trm |
|
535 |
*} |
|
536 |
||
537 |
||
538 |
(*fun prove_reg trm \<Rightarrow> thm (we might need some facts to do this) |
|
539 |
trm == new_trm |
|
540 |
*) |
|
541 |
||
141
0ffc37761e53
Further reorganization
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
140
diff
changeset
|
542 |
text {* Assumes that the given theorem is atomized *} |
140
00d141f2daa7
Further reorganizing the file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
139
diff
changeset
|
543 |
ML {* |
00d141f2daa7
Further reorganizing the file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
139
diff
changeset
|
544 |
fun build_regularize_goal thm rty rel lthy = |
00d141f2daa7
Further reorganizing the file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
139
diff
changeset
|
545 |
Logic.mk_implies |
00d141f2daa7
Further reorganizing the file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
139
diff
changeset
|
546 |
((prop_of thm), |
00d141f2daa7
Further reorganizing the file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
139
diff
changeset
|
547 |
(regularise (prop_of thm) rty rel lthy)) |
00d141f2daa7
Further reorganizing the file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
139
diff
changeset
|
548 |
*} |
00d141f2daa7
Further reorganizing the file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
139
diff
changeset
|
549 |
|
00d141f2daa7
Further reorganizing the file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
139
diff
changeset
|
550 |
section {* RepAbs injection *} |
139 | 551 |
|
161
2ee03759a22f
Trying to get a simpler lemma with the whole infrastructure
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
160
diff
changeset
|
552 |
(* Needed to have a meta-equality *) |
2ee03759a22f
Trying to get a simpler lemma with the whole infrastructure
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
160
diff
changeset
|
553 |
lemma id_def_sym: "(\<lambda>x. x) \<equiv> id" |
2ee03759a22f
Trying to get a simpler lemma with the whole infrastructure
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
160
diff
changeset
|
554 |
by (simp add: id_def) |
2ee03759a22f
Trying to get a simpler lemma with the whole infrastructure
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
160
diff
changeset
|
555 |
|
139 | 556 |
ML {* |
140
00d141f2daa7
Further reorganizing the file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
139
diff
changeset
|
557 |
fun build_repabs_term lthy thm constructors rty qty = |
139 | 558 |
let |
559 |
fun mk_rep tm = |
|
560 |
let |
|
561 |
val ty = exchange_ty rty qty (fastype_of tm) |
|
562 |
in fst (get_fun repF rty qty lthy ty) $ tm end |
|
563 |
||
564 |
fun mk_abs tm = |
|
565 |
let |
|
566 |
val ty = exchange_ty rty qty (fastype_of tm) in |
|
567 |
fst (get_fun absF rty qty lthy ty) $ tm end |
|
568 |
||
569 |
fun is_constructor (Const (x, _)) = member (op =) constructors x |
|
570 |
| is_constructor _ = false; |
|
571 |
||
572 |
fun build_aux lthy tm = |
|
573 |
case tm of |
|
574 |
Abs (a as (_, vty, _)) => |
|
575 |
let |
|
576 |
val (vs, t) = Term.dest_abs a; |
|
577 |
val v = Free(vs, vty); |
|
578 |
val t' = lambda v (build_aux lthy t) |
|
579 |
in |
|
580 |
if (not (needs_lift rty (fastype_of tm))) then t' |
|
581 |
else mk_rep (mk_abs ( |
|
582 |
if not (needs_lift rty vty) then t' |
|
583 |
else |
|
584 |
let |
|
585 |
val v' = mk_rep (mk_abs v); |
|
586 |
val t1 = Envir.beta_norm (t' $ v') |
|
587 |
in |
|
588 |
lambda v t1 |
|
589 |
end |
|
590 |
)) |
|
591 |
end |
|
592 |
| x => |
|
593 |
let |
|
594 |
val (opp, tms0) = Term.strip_comb tm |
|
595 |
val tms = map (build_aux lthy) tms0 |
|
596 |
val ty = fastype_of tm |
|
597 |
in |
|
598 |
if (((fst (Term.dest_Const opp)) = @{const_name Respects}) handle _ => false) |
|
599 |
then (list_comb (opp, (hd tms0) :: (tl tms))) |
|
600 |
else if (is_constructor opp andalso needs_lift rty ty) then |
|
601 |
mk_rep (mk_abs (list_comb (opp,tms))) |
|
602 |
else if ((Term.is_Free opp) andalso (length tms > 0) andalso (needs_lift rty ty)) then |
|
149
7cf1d7adfc5f
Removed some debugging messages
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
148
diff
changeset
|
603 |
mk_rep(mk_abs(list_comb(opp,tms))) |
139 | 604 |
else if tms = [] then opp |
605 |
else list_comb(opp, tms) |
|
606 |
end |
|
607 |
in |
|
161
2ee03759a22f
Trying to get a simpler lemma with the whole infrastructure
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
160
diff
changeset
|
608 |
MetaSimplifier.rewrite_term @{theory} @{thms id_def_sym} [] |
2ee03759a22f
Trying to get a simpler lemma with the whole infrastructure
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
160
diff
changeset
|
609 |
(build_aux lthy (Thm.prop_of thm)) |
139 | 610 |
end |
611 |
*} |
|
612 |
||
141
0ffc37761e53
Further reorganization
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
140
diff
changeset
|
613 |
text {* Assumes that it is given a regularized theorem *} |
139 | 614 |
ML {* |
140
00d141f2daa7
Further reorganizing the file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
139
diff
changeset
|
615 |
fun build_repabs_goal ctxt thm cons rty qty = |
00d141f2daa7
Further reorganizing the file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
139
diff
changeset
|
616 |
Logic.mk_equals ((Thm.prop_of thm), (build_repabs_term ctxt thm cons rty qty)) |
139 | 617 |
*} |
618 |
||
152
53277fbb2dba
Simplified the proof with some tactic... Still hangs sometimes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
151
diff
changeset
|
619 |
end |