952
+ − 1
(* Title: quotient_tacs.thy
+ − 2
Author: Cezary Kaliszyk and Christian Urban
+ − 3
+ − 4
Tactics for solving goal arising from lifting
+ − 5
theorems to quotient types.
+ − 6
*)
+ − 7
758
+ − 8
signature QUOTIENT_TACS =
+ − 9
sig
853
+ − 10
val regularize_tac: Proof.context -> int -> tactic
+ − 11
val injection_tac: Proof.context -> int -> tactic
+ − 12
val all_injection_tac: Proof.context -> int -> tactic
+ − 13
val clean_tac: Proof.context -> int -> tactic
+ − 14
val procedure_tac: Proof.context -> thm -> int -> tactic
896
4e0b89d886ac
liftin and lifing_tac can now lift several "and"-separated goals at once; the raw-theorems have to be given in the order of goals
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 15
val lift_tac: Proof.context -> thm list -> int -> tactic
853
+ − 16
val quotient_tac: Proof.context -> int -> tactic
+ − 17
val quot_true_tac: Proof.context -> (term -> term) -> int -> tactic
758
+ − 18
end;
+ − 19
+ − 20
structure Quotient_Tacs: QUOTIENT_TACS =
+ − 21
struct
+ − 22
762
+ − 23
open Quotient_Info;
+ − 24
open Quotient_Term;
+ − 25
848
+ − 26
+ − 27
(** various helper fuctions **)
802
+ − 28
769
d89851ebac9b
cleaned a bit calculate_inst a bit; eta-contraction seems to be not necessary? (all examples go through)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 29
(* Since HOL_basic_ss is too "big" for us, we *)
d89851ebac9b
cleaned a bit calculate_inst a bit; eta-contraction seems to be not necessary? (all examples go through)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 30
(* need to set up our own minimal simpset. *)
758
+ − 31
fun mk_minimal_ss ctxt =
+ − 32
Simplifier.context ctxt empty_ss
+ − 33
setsubgoaler asm_simp_tac
+ − 34
setmksimps (mksimps [])
+ − 35
785
+ − 36
(* composition of two theorems, used in maps *)
758
+ − 37
fun OF1 thm1 thm2 = thm2 RS thm1
+ − 38
802
+ − 39
(* prints a warning, if the subgoal is not solved *)
758
+ − 40
fun WARN (tac, msg) i st =
857
0ce025c02ef3
added SOLVED' which is now part of Isabelle....must be removed eventually
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 41
case Seq.pull ((SOLVED' tac) i st) of
758
+ − 42
NONE => (warning msg; Seq.single st)
+ − 43
| seqcell => Seq.make (fn () => seqcell)
+ − 44
802
+ − 45
fun RANGE_WARN tacs = RANGE (map WARN tacs)
758
+ − 46
+ − 47
fun atomize_thm thm =
+ − 48
let
804
+ − 49
val thm' = Thm.freezeT (forall_intr_vars thm) (* FIXME/TODO: is this proper Isar-technology? *)
758
+ − 50
val thm'' = ObjectLogic.atomize (cprop_of thm')
+ − 51
in
+ − 52
@{thm equal_elim_rule1} OF [thm'', thm']
+ − 53
end
+ − 54
+ − 55
848
+ − 56
+ − 57
(*** Regularize Tactic ***)
758
+ − 58
848
+ − 59
(** solvers for equivp and quotient assumptions **)
+ − 60
+ − 61
fun equiv_tac ctxt =
758
+ − 62
REPEAT_ALL_NEW (resolve_tac (equiv_rules_get ctxt))
+ − 63
+ − 64
fun equiv_solver_tac ss = equiv_tac (Simplifier.the_context ss)
+ − 65
val equiv_solver = Simplifier.mk_solver' "Equivalence goal solver" equiv_solver_tac
+ − 66
870
2a19e0a37131
Remove SOLVED from quotient_tac. Move atomize_eqv to 'Unused'.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 67
fun quotient_tac ctxt =
773
d6acae26d027
tuned comments; renamed QUOT_TRUE to Quot_True; atomize_eqv seems to not be neccessary (has it been added to Isabelle)...it is now comented out and everything still works
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 68
(REPEAT_ALL_NEW (FIRST'
d6acae26d027
tuned comments; renamed QUOT_TRUE to Quot_True; atomize_eqv seems to not be neccessary (has it been added to Isabelle)...it is now comented out and everything still works
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 69
[rtac @{thm identity_quotient},
d6acae26d027
tuned comments; renamed QUOT_TRUE to Quot_True; atomize_eqv seems to not be neccessary (has it been added to Isabelle)...it is now comented out and everything still works
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 70
resolve_tac (quotient_rules_get ctxt)]))
d6acae26d027
tuned comments; renamed QUOT_TRUE to Quot_True; atomize_eqv seems to not be neccessary (has it been added to Isabelle)...it is now comented out and everything still works
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 71
d6acae26d027
tuned comments; renamed QUOT_TRUE to Quot_True; atomize_eqv seems to not be neccessary (has it been added to Isabelle)...it is now comented out and everything still works
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 72
fun quotient_solver_tac ss = quotient_tac (Simplifier.the_context ss)
853
+ − 73
val quotient_solver =
+ − 74
Simplifier.mk_solver' "Quotient goal solver" quotient_solver_tac
773
d6acae26d027
tuned comments; renamed QUOT_TRUE to Quot_True; atomize_eqv seems to not be neccessary (has it been added to Isabelle)...it is now comented out and everything still works
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 75
d6acae26d027
tuned comments; renamed QUOT_TRUE to Quot_True; atomize_eqv seems to not be neccessary (has it been added to Isabelle)...it is now comented out and everything still works
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 76
fun solve_quotient_assm ctxt thm =
d6acae26d027
tuned comments; renamed QUOT_TRUE to Quot_True; atomize_eqv seems to not be neccessary (has it been added to Isabelle)...it is now comented out and everything still works
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 77
case Seq.pull (quotient_tac ctxt 1 thm) of
d6acae26d027
tuned comments; renamed QUOT_TRUE to Quot_True; atomize_eqv seems to not be neccessary (has it been added to Isabelle)...it is now comented out and everything still works
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 78
SOME (t, _) => t
802
+ − 79
| _ => error "Solve_quotient_assm failed. Possibly a quotient theorem is missing."
773
d6acae26d027
tuned comments; renamed QUOT_TRUE to Quot_True; atomize_eqv seems to not be neccessary (has it been added to Isabelle)...it is now comented out and everything still works
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 80
d6acae26d027
tuned comments; renamed QUOT_TRUE to Quot_True; atomize_eqv seems to not be neccessary (has it been added to Isabelle)...it is now comented out and everything still works
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 81
758
+ − 82
fun prep_trm thy (x, (T, t)) =
+ − 83
(cterm_of thy (Var (x, T)), cterm_of thy t)
+ − 84
+ − 85
fun prep_ty thy (x, (S, ty)) =
+ − 86
(ctyp_of thy (TVar (x, S)), ctyp_of thy ty)
+ − 87
772
a95f6bb081cf
on the hunt for what condition raises which exception in the CLEVER CODE of calculate_inst
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 88
fun get_match_inst thy pat trm =
758
+ − 89
let
+ − 90
val univ = Unify.matchers thy [(pat, trm)]
853
+ − 91
val SOME (env, _) = Seq.pull univ (* raises BIND, if no unifier *)
758
+ − 92
val tenv = Vartab.dest (Envir.term_env env)
+ − 93
val tyenv = Vartab.dest (Envir.type_env env)
+ − 94
in
+ − 95
(map (prep_ty thy) tyenv, map (prep_trm thy) tenv)
+ − 96
end
+ − 97
837
+ − 98
(* Calculates the instantiations for the lemmas:
858
+ − 99
837
+ − 100
ball_reg_eqv_range and bex_reg_eqv_range
858
+ − 101
837
+ − 102
Since the left-hand-side contains a non-pattern '?P (f ?x)'
+ − 103
we rely on unification/instantiation to check whether the
858
+ − 104
theorem applies and return NONE if it doesn't.
+ − 105
*)
773
d6acae26d027
tuned comments; renamed QUOT_TRUE to Quot_True; atomize_eqv seems to not be neccessary (has it been added to Isabelle)...it is now comented out and everything still works
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 106
fun calculate_inst ctxt ball_bex_thm redex R1 R2 =
758
+ − 107
let
951
+ − 108
val thy = ProofContext.theory_of ctxt
771
b2231990b059
simplified calculate_instance; worked around some clever code; clever code is unfortunately still there...needs to be removed
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 109
fun get_lhs thm = fst (Logic.dest_equals (Thm.concl_of thm))
951
+ − 110
val ty_inst = map (SOME o ctyp_of thy) [domain_type (fastype_of R2)]
+ − 111
val trm_inst = map (SOME o cterm_of thy) [R2, R1]
758
+ − 112
in
951
+ − 113
case try (Drule.instantiate' ty_inst trm_inst) ball_bex_thm of
837
+ − 114
NONE => NONE
+ − 115
| SOME thm' =>
+ − 116
(case try (get_match_inst thy (get_lhs thm')) redex of
+ − 117
NONE => NONE
+ − 118
| SOME inst2 => try (Drule.instantiate inst2) thm')
758
+ − 119
end
+ − 120
+ − 121
fun ball_bex_range_simproc ss redex =
+ − 122
let
+ − 123
val ctxt = Simplifier.the_context ss
+ − 124
in
772
a95f6bb081cf
on the hunt for what condition raises which exception in the CLEVER CODE of calculate_inst
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 125
case redex of
758
+ − 126
(Const (@{const_name "Ball"}, _) $ (Const (@{const_name "Respects"}, _) $
+ − 127
(Const (@{const_name "fun_rel"}, _) $ R1 $ R2)) $ _) =>
773
d6acae26d027
tuned comments; renamed QUOT_TRUE to Quot_True; atomize_eqv seems to not be neccessary (has it been added to Isabelle)...it is now comented out and everything still works
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 128
calculate_inst ctxt @{thm ball_reg_eqv_range[THEN eq_reflection]} redex R1 R2
758
+ − 129
+ − 130
| (Const (@{const_name "Bex"}, _) $ (Const (@{const_name "Respects"}, _) $
+ − 131
(Const (@{const_name "fun_rel"}, _) $ R1 $ R2)) $ _) =>
773
d6acae26d027
tuned comments; renamed QUOT_TRUE to Quot_True; atomize_eqv seems to not be neccessary (has it been added to Isabelle)...it is now comented out and everything still works
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 132
calculate_inst ctxt @{thm bex_reg_eqv_range[THEN eq_reflection]} redex R1 R2
d6acae26d027
tuned comments; renamed QUOT_TRUE to Quot_True; atomize_eqv seems to not be neccessary (has it been added to Isabelle)...it is now comented out and everything still works
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 133
758
+ − 134
| _ => NONE
+ − 135
end
+ − 136
858
+ − 137
(* Regularize works as follows:
853
+ − 138
858
+ − 139
0. preliminary simplification step according to
+ − 140
ball_reg_eqv bex_reg_eqv babs_reg_eqv ball_reg_eqv_range bex_reg_eqv_range
853
+ − 141
1074
+ − 142
1. eliminating simple Ball/Bex instances (ball_reg_right bex_reg_left)
858
+ − 143
+ − 144
2. monos
758
+ − 145
858
+ − 146
3. commutation rules for ball and bex (ball_all_comm bex_ex_comm)
+ − 147
+ − 148
4. then rel-equalities, which need to be instantiated with 'eq_imp_rel'
+ − 149
to avoid loops
853
+ − 150
858
+ − 151
5. then simplification like 0
853
+ − 152
858
+ − 153
finally jump back to 1
+ − 154
*)
758
+ − 155
fun regularize_tac ctxt =
+ − 156
let
+ − 157
val thy = ProofContext.theory_of ctxt
772
a95f6bb081cf
on the hunt for what condition raises which exception in the CLEVER CODE of calculate_inst
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 158
val ball_pat = @{term "Ball (Respects (R1 ===> R2)) P"}
a95f6bb081cf
on the hunt for what condition raises which exception in the CLEVER CODE of calculate_inst
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 159
val bex_pat = @{term "Bex (Respects (R1 ===> R2)) P"}
a95f6bb081cf
on the hunt for what condition raises which exception in the CLEVER CODE of calculate_inst
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 160
val simproc = Simplifier.simproc_i thy "" [ball_pat, bex_pat] (K (ball_bex_range_simproc))
758
+ − 161
val simpset = (mk_minimal_ss ctxt)
845
+ − 162
addsimps @{thms ball_reg_eqv bex_reg_eqv babs_reg_eqv babs_simp}
772
a95f6bb081cf
on the hunt for what condition raises which exception in the CLEVER CODE of calculate_inst
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 163
addsimprocs [simproc]
a95f6bb081cf
on the hunt for what condition raises which exception in the CLEVER CODE of calculate_inst
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 164
addSolver equiv_solver addSolver quotient_solver
758
+ − 165
val eq_eqvs = map (OF1 @{thm eq_imp_rel}) (equiv_rules_get ctxt)
+ − 166
in
+ − 167
simp_tac simpset THEN'
773
d6acae26d027
tuned comments; renamed QUOT_TRUE to Quot_True; atomize_eqv seems to not be neccessary (has it been added to Isabelle)...it is now comented out and everything still works
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 168
REPEAT_ALL_NEW (CHANGED o FIRST'
946
+ − 169
[resolve_tac @{thms ball_reg_right bex_reg_left bex1_bexeq_reg},
773
d6acae26d027
tuned comments; renamed QUOT_TRUE to Quot_True; atomize_eqv seems to not be neccessary (has it been added to Isabelle)...it is now comented out and everything still works
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 170
resolve_tac (Inductive.get_monos ctxt),
d6acae26d027
tuned comments; renamed QUOT_TRUE to Quot_True; atomize_eqv seems to not be neccessary (has it been added to Isabelle)...it is now comented out and everything still works
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 171
resolve_tac @{thms ball_all_comm bex_ex_comm},
d6acae26d027
tuned comments; renamed QUOT_TRUE to Quot_True; atomize_eqv seems to not be neccessary (has it been added to Isabelle)...it is now comented out and everything still works
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 172
resolve_tac eq_eqvs,
d6acae26d027
tuned comments; renamed QUOT_TRUE to Quot_True; atomize_eqv seems to not be neccessary (has it been added to Isabelle)...it is now comented out and everything still works
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 173
simp_tac simpset])
758
+ − 174
end
+ − 175
+ − 176
848
+ − 177
+ − 178
(*** Injection Tactic ***)
758
+ − 179
848
+ − 180
(* Looks for Quot_True assumtions, and in case its parameter
858
+ − 181
is an application, it returns the function and the argument.
+ − 182
*)
758
+ − 183
fun find_qt_asm asms =
+ − 184
let
+ − 185
fun find_fun trm =
+ − 186
case trm of
773
d6acae26d027
tuned comments; renamed QUOT_TRUE to Quot_True; atomize_eqv seems to not be neccessary (has it been added to Isabelle)...it is now comented out and everything still works
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 187
(Const(@{const_name Trueprop}, _) $ (Const (@{const_name Quot_True}, _) $ _)) => true
758
+ − 188
| _ => false
+ − 189
in
+ − 190
case find_first find_fun asms of
+ − 191
SOME (_ $ (_ $ (f $ a))) => SOME (f, a)
+ − 192
| _ => NONE
+ − 193
end
+ − 194
+ − 195
fun quot_true_simple_conv ctxt fnctn ctrm =
+ − 196
case (term_of ctrm) of
773
d6acae26d027
tuned comments; renamed QUOT_TRUE to Quot_True; atomize_eqv seems to not be neccessary (has it been added to Isabelle)...it is now comented out and everything still works
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 197
(Const (@{const_name Quot_True}, _) $ x) =>
758
+ − 198
let
+ − 199
val fx = fnctn x;
+ − 200
val thy = ProofContext.theory_of ctxt;
+ − 201
val cx = cterm_of thy x;
+ − 202
val cfx = cterm_of thy fx;
+ − 203
val cxt = ctyp_of thy (fastype_of x);
+ − 204
val cfxt = ctyp_of thy (fastype_of fx);
773
d6acae26d027
tuned comments; renamed QUOT_TRUE to Quot_True; atomize_eqv seems to not be neccessary (has it been added to Isabelle)...it is now comented out and everything still works
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 205
val thm = Drule.instantiate' [SOME cxt, SOME cfxt] [SOME cx, SOME cfx] @{thm QT_imp}
758
+ − 206
in
+ − 207
Conv.rewr_conv thm ctrm
+ − 208
end
+ − 209
+ − 210
fun quot_true_conv ctxt fnctn ctrm =
+ − 211
case (term_of ctrm) of
773
d6acae26d027
tuned comments; renamed QUOT_TRUE to Quot_True; atomize_eqv seems to not be neccessary (has it been added to Isabelle)...it is now comented out and everything still works
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 212
(Const (@{const_name Quot_True}, _) $ _) =>
758
+ − 213
quot_true_simple_conv ctxt fnctn ctrm
+ − 214
| _ $ _ => Conv.comb_conv (quot_true_conv ctxt fnctn) ctrm
+ − 215
| Abs _ => Conv.abs_conv (fn (_, ctxt) => quot_true_conv ctxt fnctn) ctxt ctrm
+ − 216
| _ => Conv.all_conv ctrm
+ − 217
+ − 218
fun quot_true_tac ctxt fnctn =
+ − 219
CONVERSION
+ − 220
((Conv.params_conv ~1 (fn ctxt =>
+ − 221
(Conv.prems_conv ~1 (quot_true_conv ctxt fnctn)))) ctxt)
+ − 222
+ − 223
fun dest_comb (f $ a) = (f, a)
+ − 224
fun dest_bcomb ((_ $ l) $ r) = (l, r)
+ − 225
+ − 226
fun unlam t =
+ − 227
case t of
+ − 228
(Abs a) => snd (Term.dest_abs a)
+ − 229
| _ => unlam (Abs("", domain_type (fastype_of t), (incr_boundvars 1 t) $ (Bound 0)))
+ − 230
+ − 231
fun dest_fun_type (Type("fun", [T, S])) = (T, S)
+ − 232
| dest_fun_type _ = error "dest_fun_type"
+ − 233
+ − 234
val bare_concl = HOLogic.dest_Trueprop o Logic.strip_assums_concl
+ − 235
848
+ − 236
(* We apply apply_rsp only in case if the type needs lifting.
+ − 237
This is the case if the type of the data in the Quot_True
858
+ − 238
assumption is different from the corresponding type in the goal.
+ − 239
*)
758
+ − 240
val apply_rsp_tac =
+ − 241
Subgoal.FOCUS (fn {concl, asms, context,...} =>
+ − 242
let
+ − 243
val bare_concl = HOLogic.dest_Trueprop (term_of concl)
+ − 244
val qt_asm = find_qt_asm (map term_of asms)
+ − 245
in
+ − 246
case (bare_concl, qt_asm) of
+ − 247
(R2 $ (f $ x) $ (g $ y), SOME (qt_fun, qt_arg)) =>
848
+ − 248
if (fastype_of qt_fun) = (fastype_of f)
+ − 249
then no_tac
+ − 250
else
758
+ − 251
let
+ − 252
val ty_x = fastype_of x
+ − 253
val ty_b = fastype_of qt_arg
848
+ − 254
val ty_f = range_type (fastype_of f)
758
+ − 255
val thy = ProofContext.theory_of context
+ − 256
val ty_inst = map (SOME o (ctyp_of thy)) [ty_x, ty_b, ty_f]
+ − 257
val t_inst = map (SOME o (cterm_of thy)) [R2, f, g, x, y];
848
+ − 258
val inst_thm = Drule.instantiate' ty_inst
+ − 259
([NONE, NONE, NONE] @ t_inst) @{thm apply_rsp}
758
+ − 260
in
+ − 261
(rtac inst_thm THEN' quotient_tac context) 1
+ − 262
end
+ − 263
| _ => no_tac
+ − 264
end)
+ − 265
842
+ − 266
(* Instantiates and applies 'equals_rsp'. Since the theorem is
858
+ − 267
complex we rely on instantiation to tell us if it applies
+ − 268
*)
758
+ − 269
fun equals_rsp_tac R ctxt =
+ − 270
let
+ − 271
val thy = ProofContext.theory_of ctxt
+ − 272
in
842
+ − 273
case try (cterm_of thy) R of (* There can be loose bounds in R *)
+ − 274
SOME ctm =>
+ − 275
let
+ − 276
val ty = domain_type (fastype_of R)
+ − 277
in
+ − 278
case try (Drule.instantiate' [SOME (ctyp_of thy ty)]
+ − 279
[SOME (cterm_of thy R)]) @{thm equals_rsp} of
+ − 280
SOME thm => rtac thm THEN' quotient_tac ctxt
+ − 281
| NONE => K no_tac
+ − 282
end
+ − 283
| _ => K no_tac
758
+ − 284
end
+ − 285
847
+ − 286
fun rep_abs_rsp_tac ctxt =
758
+ − 287
SUBGOAL (fn (goal, i) =>
847
+ − 288
case (try bare_concl goal) of
+ − 289
SOME (rel $ _ $ (rep $ (abs $ _))) =>
+ − 290
let
+ − 291
val thy = ProofContext.theory_of ctxt;
+ − 292
val (ty_a, ty_b) = dest_fun_type (fastype_of abs);
+ − 293
val ty_inst = map (SOME o (ctyp_of thy)) [ty_a, ty_b];
+ − 294
in
+ − 295
case try (map (SOME o (cterm_of thy))) [rel, abs, rep] of
+ − 296
SOME t_inst =>
+ − 297
(case try (Drule.instantiate' ty_inst t_inst) @{thm rep_abs_rsp} of
+ − 298
SOME inst_thm => (rtac inst_thm THEN' quotient_tac ctxt) i
+ − 299
| NONE => no_tac)
+ − 300
| NONE => no_tac
+ − 301
end
758
+ − 302
| _ => no_tac)
+ − 303
+ − 304
858
+ − 305
+ − 306
(* Injection means to prove that the regularised theorem implies
+ − 307
the abs/rep injected one.
758
+ − 308
858
+ − 309
The deterministic part:
+ − 310
- remove lambdas from both sides
+ − 311
- prove Ball/Bex/Babs equalities using ball_rsp, bex_rsp, babs_rsp
+ − 312
- prove Ball/Bex relations unfolding fun_rel_id
+ − 313
- reflexivity of equality
+ − 314
- prove equality of relations using equals_rsp
+ − 315
- use user-supplied RSP theorems
+ − 316
- solve 'relation of relations' goals using quot_rel_rsp
+ − 317
- remove rep_abs from the right side
+ − 318
(Lambdas under respects may have left us some assumptions)
+ − 319
+ − 320
Then in order:
+ − 321
- split applications of lifted type (apply_rsp)
+ − 322
- split applications of non-lifted type (cong_tac)
+ − 323
- apply extentionality
+ − 324
- assumption
+ − 325
- reflexivity of the relation
758
+ − 326
*)
773
d6acae26d027
tuned comments; renamed QUOT_TRUE to Quot_True; atomize_eqv seems to not be neccessary (has it been added to Isabelle)...it is now comented out and everything still works
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 327
fun injection_match_tac ctxt = SUBGOAL (fn (goal, i) =>
758
+ − 328
(case (bare_concl goal) of
+ − 329
(* (R1 ===> R2) (%x...) (%x...) ----> [|R1 x y|] ==> R2 (...x) (...y) *)
+ − 330
(Const (@{const_name fun_rel}, _) $ _ $ _) $ (Abs _) $ (Abs _)
+ − 331
=> rtac @{thm fun_rel_id} THEN' quot_true_tac ctxt unlam
+ − 332
+ − 333
(* (op =) (Ball...) (Ball...) ----> (op =) (...) (...) *)
+ − 334
| (Const (@{const_name "op ="},_) $
+ − 335
(Const(@{const_name Ball},_) $ (Const (@{const_name Respects}, _) $ _) $ _) $
+ − 336
(Const(@{const_name Ball},_) $ (Const (@{const_name Respects}, _) $ _) $ _))
+ − 337
=> rtac @{thm ball_rsp} THEN' dtac @{thm QT_all}
+ − 338
+ − 339
(* (R1 ===> op =) (Ball...) (Ball...) ----> [|R1 x y|] ==> (Ball...x) = (Ball...y) *)
+ − 340
| (Const (@{const_name fun_rel}, _) $ _ $ _) $
+ − 341
(Const(@{const_name Ball},_) $ (Const (@{const_name Respects}, _) $ _) $ _) $
+ − 342
(Const(@{const_name Ball},_) $ (Const (@{const_name Respects}, _) $ _) $ _)
+ − 343
=> rtac @{thm fun_rel_id} THEN' quot_true_tac ctxt unlam
+ − 344
+ − 345
(* (op =) (Bex...) (Bex...) ----> (op =) (...) (...) *)
+ − 346
| Const (@{const_name "op ="},_) $
+ − 347
(Const(@{const_name Bex},_) $ (Const (@{const_name Respects}, _) $ _) $ _) $
+ − 348
(Const(@{const_name Bex},_) $ (Const (@{const_name Respects}, _) $ _) $ _)
+ − 349
=> rtac @{thm bex_rsp} THEN' dtac @{thm QT_ex}
+ − 350
+ − 351
(* (R1 ===> op =) (Bex...) (Bex...) ----> [|R1 x y|] ==> (Bex...x) = (Bex...y) *)
+ − 352
| (Const (@{const_name fun_rel}, _) $ _ $ _) $
+ − 353
(Const(@{const_name Bex},_) $ (Const (@{const_name Respects}, _) $ _) $ _) $
+ − 354
(Const(@{const_name Bex},_) $ (Const (@{const_name Respects}, _) $ _) $ _)
+ − 355
=> rtac @{thm fun_rel_id} THEN' quot_true_tac ctxt unlam
+ − 356
911
+ − 357
| (Const (@{const_name fun_rel}, _) $ _ $ _) $
980
+ − 358
(Const(@{const_name Bex1_rel},_) $ _) $ (Const(@{const_name Bex1_rel},_) $ _)
911
+ − 359
=> rtac @{thm bexeq_rsp} THEN' quotient_tac ctxt
+ − 360
758
+ − 361
| (_ $
+ − 362
(Const(@{const_name Babs},_) $ (Const (@{const_name Respects}, _) $ _) $ _) $
+ − 363
(Const(@{const_name Babs},_) $ (Const (@{const_name Respects}, _) $ _) $ _))
+ − 364
=> rtac @{thm babs_rsp} THEN' RANGE [quotient_tac ctxt]
+ − 365
+ − 366
| Const (@{const_name "op ="},_) $ (R $ _ $ _) $ (_ $ _ $ _) =>
+ − 367
(rtac @{thm refl} ORELSE'
+ − 368
(equals_rsp_tac R ctxt THEN' RANGE [
+ − 369
quot_true_tac ctxt (fst o dest_bcomb), quot_true_tac ctxt (snd o dest_bcomb)]))
+ − 370
+ − 371
(* reflexivity of operators arising from Cong_tac *)
+ − 372
| Const (@{const_name "op ="},_) $ _ $ _ => rtac @{thm refl}
+ − 373
+ − 374
(* respectfulness of constants; in particular of a simple relation *)
+ − 375
| _ $ (Const _) $ (Const _) (* fun_rel, list_rel, etc but not equality *)
+ − 376
=> resolve_tac (rsp_rules_get ctxt) THEN_ALL_NEW quotient_tac ctxt
+ − 377
+ − 378
(* R (...) (Rep (Abs ...)) ----> R (...) (...) *)
+ − 379
(* observe fun_map *)
+ − 380
| _ $ _ $ _
+ − 381
=> (rtac @{thm quot_rel_rsp} THEN_ALL_NEW quotient_tac ctxt)
+ − 382
ORELSE' rep_abs_rsp_tac ctxt
+ − 383
+ − 384
| _ => K no_tac
+ − 385
) i)
+ − 386
773
d6acae26d027
tuned comments; renamed QUOT_TRUE to Quot_True; atomize_eqv seems to not be neccessary (has it been added to Isabelle)...it is now comented out and everything still works
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 387
fun injection_step_tac ctxt rel_refl =
758
+ − 388
FIRST' [
773
d6acae26d027
tuned comments; renamed QUOT_TRUE to Quot_True; atomize_eqv seems to not be neccessary (has it been added to Isabelle)...it is now comented out and everything still works
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 389
injection_match_tac ctxt,
d6acae26d027
tuned comments; renamed QUOT_TRUE to Quot_True; atomize_eqv seems to not be neccessary (has it been added to Isabelle)...it is now comented out and everything still works
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 390
853
+ − 391
(* R (t $ ...) (t' $ ...) ----> apply_rsp provided type of t needs lifting *)
758
+ − 392
apply_rsp_tac ctxt THEN'
+ − 393
RANGE [quot_true_tac ctxt (fst o dest_comb), quot_true_tac ctxt (snd o dest_comb)],
+ − 394
+ − 395
(* (op =) (t $ ...) (t' $ ...) ----> Cong provided type of t does not need lifting *)
+ − 396
(* merge with previous tactic *)
+ − 397
Cong_Tac.cong_tac @{thm cong} THEN'
+ − 398
RANGE [quot_true_tac ctxt (fst o dest_comb), quot_true_tac ctxt (snd o dest_comb)],
853
+ − 399
758
+ − 400
(* (op =) (%x...) (%y...) ----> (op =) (...) (...) *)
+ − 401
rtac @{thm ext} THEN' quot_true_tac ctxt unlam,
853
+ − 402
758
+ − 403
(* resolving with R x y assumptions *)
+ − 404
atac,
853
+ − 405
758
+ − 406
(* reflexivity of the basic relations *)
+ − 407
(* R ... ... *)
+ − 408
resolve_tac rel_refl]
+ − 409
773
d6acae26d027
tuned comments; renamed QUOT_TRUE to Quot_True; atomize_eqv seems to not be neccessary (has it been added to Isabelle)...it is now comented out and everything still works
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 410
fun injection_tac ctxt =
758
+ − 411
let
+ − 412
val rel_refl = map (OF1 @{thm equivp_reflp}) (equiv_rules_get ctxt)
+ − 413
in
845
+ − 414
injection_step_tac ctxt rel_refl
758
+ − 415
end
+ − 416
773
d6acae26d027
tuned comments; renamed QUOT_TRUE to Quot_True; atomize_eqv seems to not be neccessary (has it been added to Isabelle)...it is now comented out and everything still works
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 417
fun all_injection_tac ctxt =
d6acae26d027
tuned comments; renamed QUOT_TRUE to Quot_True; atomize_eqv seems to not be neccessary (has it been added to Isabelle)...it is now comented out and everything still works
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 418
REPEAT_ALL_NEW (injection_tac ctxt)
758
+ − 419
+ − 420
+ − 421
858
+ − 422
(*** Cleaning of the Theorem ***)
848
+ − 423
951
+ − 424
(* expands all fun_maps, except in front of the (bound) variables listed in xs *)
758
+ − 425
fun fun_map_simple_conv xs ctrm =
+ − 426
case (term_of ctrm) of
+ − 427
((Const (@{const_name "fun_map"}, _) $ _ $ _) $ h $ _) =>
848
+ − 428
if (member (op=) xs h)
758
+ − 429
then Conv.all_conv ctrm
913
+ − 430
else Conv.rewr_conv @{thm fun_map_def[THEN eq_reflection]} ctrm
758
+ − 431
| _ => Conv.all_conv ctrm
+ − 432
+ − 433
fun fun_map_conv xs ctxt ctrm =
+ − 434
case (term_of ctrm) of
+ − 435
_ $ _ => (Conv.comb_conv (fun_map_conv xs ctxt) then_conv
+ − 436
fun_map_simple_conv xs) ctrm
+ − 437
| Abs _ => Conv.abs_conv (fn (x, ctxt) => fun_map_conv ((term_of x)::xs) ctxt) ctxt ctrm
+ − 438
| _ => Conv.all_conv ctrm
+ − 439
+ − 440
fun fun_map_tac ctxt = CONVERSION (fun_map_conv [] ctxt)
+ − 441
951
+ − 442
(* custom matching functions *)
758
+ − 443
fun mk_abs u i t =
+ − 444
if incr_boundvars i u aconv t then Bound i
+ − 445
else (case t of
+ − 446
t1 $ t2 => (mk_abs u i t1) $ (mk_abs u i t2)
+ − 447
| Abs (s, T, t') => Abs (s, T, mk_abs u (i + 1) t')
+ − 448
| Bound j => if i = j then error "make_inst" else t
+ − 449
| _ => t)
+ − 450
+ − 451
fun make_inst lhs t =
+ − 452
let
+ − 453
val _ $ (Abs (_, _, (_ $ ((f as Var (_, Type ("fun", [T, _]))) $ u)))) = lhs;
+ − 454
val _ $ (Abs (_, _, (_ $ g))) = t;
+ − 455
in
+ − 456
(f, Abs ("x", T, mk_abs u 0 g))
+ − 457
end
+ − 458
+ − 459
fun make_inst_id lhs t =
+ − 460
let
+ − 461
val _ $ (Abs (_, _, (f as Var (_, Type ("fun", [T, _]))) $ u)) = lhs;
+ − 462
val _ $ (Abs (_, _, g)) = t;
+ − 463
in
+ − 464
(f, Abs ("x", T, mk_abs u 0 g))
+ − 465
end
+ − 466
846
+ − 467
(* Simplifies a redex using the 'lambda_prs' theorem.
+ − 468
First instantiates the types and known subterms.
+ − 469
Then solves the quotient assumptions to get Rep2 and Abs1
+ − 470
Finally instantiates the function f using make_inst
+ − 471
If Rep2 is an identity then the pattern is simpler and
858
+ − 472
make_inst_id is used
+ − 473
*)
758
+ − 474
fun lambda_prs_simple_conv ctxt ctrm =
+ − 475
case (term_of ctrm) of
846
+ − 476
(Const (@{const_name fun_map}, _) $ r1 $ a2) $ (Abs _) =>
+ − 477
let
+ − 478
val thy = ProofContext.theory_of ctxt
+ − 479
val (ty_b, ty_a) = dest_fun_type (fastype_of r1)
+ − 480
val (ty_c, ty_d) = dest_fun_type (fastype_of a2)
+ − 481
val tyinst = map (SOME o (ctyp_of thy)) [ty_a, ty_b, ty_c, ty_d]
+ − 482
val tinst = [NONE, NONE, SOME (cterm_of thy r1), NONE, SOME (cterm_of thy a2)]
951
+ − 483
val thm1 = Drule.instantiate' tyinst tinst @{thm lambda_prs[THEN eq_reflection]}
+ − 484
val thm2 = solve_quotient_assm ctxt (solve_quotient_assm ctxt thm1)
+ − 485
val thm3 = MetaSimplifier.rewrite_rule @{thms id_apply[THEN eq_reflection]} thm2
846
+ − 486
val (insp, inst) =
+ − 487
if ty_c = ty_d
951
+ − 488
then make_inst_id (term_of (Thm.lhs_of thm3)) (term_of ctrm)
+ − 489
else make_inst (term_of (Thm.lhs_of thm3)) (term_of ctrm)
+ − 490
val thm4 = Drule.instantiate ([], [(cterm_of thy insp, cterm_of thy inst)]) thm3
846
+ − 491
in
951
+ − 492
Conv.rewr_conv thm4 ctrm
846
+ − 493
end
758
+ − 494
| _ => Conv.all_conv ctrm
+ − 495
773
d6acae26d027
tuned comments; renamed QUOT_TRUE to Quot_True; atomize_eqv seems to not be neccessary (has it been added to Isabelle)...it is now comented out and everything still works
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 496
fun lambda_prs_conv ctxt = More_Conv.top_conv lambda_prs_simple_conv ctxt
758
+ − 497
fun lambda_prs_tac ctxt = CONVERSION (lambda_prs_conv ctxt)
+ − 498
+ − 499
848
+ − 500
(* Cleaning consists of:
858
+ − 501
940
a792bfc1be2b
Combined the simpsets in clean_tac and updated the comment. Now cleaning of splits does work.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 502
1. unfolding of ---> in front of everything, except
951
+ − 503
bound variables (this prevents lambda_prs from
+ − 504
becoming stuck)
848
+ − 505
940
a792bfc1be2b
Combined the simpsets in clean_tac and updated the comment. Now cleaning of splits does work.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 506
2. simplification with lambda_prs
848
+ − 507
951
+ − 508
3. simplification with:
+ − 509
+ − 510
- Quotient_abs_rep Quotient_rel_rep
+ − 511
babs_prs all_prs ex_prs ex1_prs
964
+ − 512
+ − 513
- id_simps and preservation lemmas and
+ − 514
+ − 515
- symmetric versions of the definitions
+ − 516
(that is definitions of quotient constants
+ − 517
are folded)
848
+ − 518
940
a792bfc1be2b
Combined the simpsets in clean_tac and updated the comment. Now cleaning of splits does work.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 519
4. test for refl
858
+ − 520
*)
845
+ − 521
fun clean_tac lthy =
785
+ − 522
let
871
+ − 523
val defs = map (Thm.varifyT o symmetric o #def) (qconsts_dest lthy)
802
+ − 524
(* FIXME: why is the Thm.varifyT needed: example where it fails is LamEx *)
789
+ − 525
val prs = prs_rules_get lthy
+ − 526
val ids = id_simps_get lthy
951
+ − 527
val thms = @{thms Quotient_abs_rep Quotient_rel_rep babs_prs all_prs ex_prs ex1_prs} @ ids @ prs @ defs
853
+ − 528
951
+ − 529
val ss = (mk_minimal_ss lthy) addsimps thms addSolver quotient_solver
785
+ − 530
in
940
a792bfc1be2b
Combined the simpsets in clean_tac and updated the comment. Now cleaning of splits does work.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 531
EVERY' [fun_map_tac lthy,
785
+ − 532
lambda_prs_tac lthy,
940
a792bfc1be2b
Combined the simpsets in clean_tac and updated the comment. Now cleaning of splits does work.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 533
simp_tac ss,
853
+ − 534
TRY o rtac refl]
785
+ − 535
end
758
+ − 536
773
d6acae26d027
tuned comments; renamed QUOT_TRUE to Quot_True; atomize_eqv seems to not be neccessary (has it been added to Isabelle)...it is now comented out and everything still works
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 537
848
+ − 538
+ − 539
(** Tactic for Generalising Free Variables in a Goal **)
+ − 540
758
+ − 541
fun inst_spec ctrm =
+ − 542
Drule.instantiate' [SOME (ctyp_of_term ctrm)] [NONE, SOME ctrm] @{thm spec}
+ − 543
+ − 544
fun inst_spec_tac ctrms =
+ − 545
EVERY' (map (dtac o inst_spec) ctrms)
+ − 546
+ − 547
fun all_list xs trm =
+ − 548
fold (fn (x, T) => fn t' => HOLogic.mk_all (x, T, t')) xs trm
+ − 549
+ − 550
fun apply_under_Trueprop f =
+ − 551
HOLogic.dest_Trueprop #> f #> HOLogic.mk_Trueprop
+ − 552
+ − 553
fun gen_frees_tac ctxt =
853
+ − 554
SUBGOAL (fn (concl, i) =>
+ − 555
let
+ − 556
val thy = ProofContext.theory_of ctxt
+ − 557
val vrs = Term.add_frees concl []
+ − 558
val cvrs = map (cterm_of thy o Free) vrs
+ − 559
val concl' = apply_under_Trueprop (all_list vrs) concl
+ − 560
val goal = Logic.mk_implies (concl', concl)
+ − 561
val rule = Goal.prove ctxt [] [] goal
+ − 562
(K (EVERY1 [inst_spec_tac (rev cvrs), atac]))
+ − 563
in
+ − 564
rtac rule i
+ − 565
end)
758
+ − 566
848
+ − 567
+ − 568
(** The General Shape of the Lifting Procedure **)
+ − 569
+ − 570
(* - A is the original raw theorem
858
+ − 571
- B is the regularized theorem
+ − 572
- C is the rep/abs injected version of B
+ − 573
- D is the lifted theorem
758
+ − 574
858
+ − 575
- 1st prem is the regularization step
+ − 576
- 2nd prem is the rep/abs injection step
+ − 577
- 3rd prem is the cleaning part
848
+ − 578
858
+ − 579
the Quot_True premise in 2nd records the lifted theorem
+ − 580
*)
853
+ − 581
val lifting_procedure_thm =
+ − 582
@{lemma "[|A;
+ − 583
A --> B;
+ − 584
Quot_True D ==> B = C;
+ − 585
C = D|] ==> D"
773
d6acae26d027
tuned comments; renamed QUOT_TRUE to Quot_True; atomize_eqv seems to not be neccessary (has it been added to Isabelle)...it is now comented out and everything still works
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 586
by (simp add: Quot_True_def)}
758
+ − 587
773
d6acae26d027
tuned comments; renamed QUOT_TRUE to Quot_True; atomize_eqv seems to not be neccessary (has it been added to Isabelle)...it is now comented out and everything still works
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 588
fun lift_match_error ctxt str rtrm qtrm =
758
+ − 589
let
+ − 590
val rtrm_str = Syntax.string_of_term ctxt rtrm
+ − 591
val qtrm_str = Syntax.string_of_term ctxt qtrm
773
d6acae26d027
tuned comments; renamed QUOT_TRUE to Quot_True; atomize_eqv seems to not be neccessary (has it been added to Isabelle)...it is now comented out and everything still works
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 592
val msg = cat_lines [enclose "[" "]" str, "The quotient theorem", qtrm_str,
848
+ − 593
"", "does not match with original theorem", rtrm_str]
758
+ − 594
in
+ − 595
error msg
+ − 596
end
848
+ − 597
758
+ − 598
fun procedure_inst ctxt rtrm qtrm =
+ − 599
let
+ − 600
val thy = ProofContext.theory_of ctxt
+ − 601
val rtrm' = HOLogic.dest_Trueprop rtrm
+ − 602
val qtrm' = HOLogic.dest_Trueprop qtrm
776
d1064fa29424
renamed get_fun to absrep_fun; introduced explicit checked versions of the term functions
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 603
val reg_goal = regularize_trm_chk ctxt (rtrm', qtrm')
848
+ − 604
handle (LIFT_MATCH str) => lift_match_error ctxt str rtrm qtrm
776
d1064fa29424
renamed get_fun to absrep_fun; introduced explicit checked versions of the term functions
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 605
val inj_goal = inj_repabs_trm_chk ctxt (reg_goal, qtrm')
848
+ − 606
handle (LIFT_MATCH str) => lift_match_error ctxt str rtrm qtrm
758
+ − 607
in
+ − 608
Drule.instantiate' []
+ − 609
[SOME (cterm_of thy rtrm'),
+ − 610
SOME (cterm_of thy reg_goal),
+ − 611
NONE,
802
+ − 612
SOME (cterm_of thy inj_goal)] lifting_procedure_thm
758
+ − 613
end
+ − 614
+ − 615
(* the tactic leaves three subgoals to be proved *)
+ − 616
fun procedure_tac ctxt rthm =
+ − 617
ObjectLogic.full_atomize_tac
+ − 618
THEN' gen_frees_tac ctxt
785
+ − 619
THEN' SUBGOAL (fn (goal, i) =>
758
+ − 620
let
+ − 621
val rthm' = atomize_thm rthm
785
+ − 622
val rule = procedure_inst ctxt (prop_of rthm') goal
758
+ − 623
in
+ − 624
(rtac rule THEN' rtac rthm') i
+ − 625
end)
+ − 626
+ − 627
+ − 628
(* Automatic Proofs *)
+ − 629
896
4e0b89d886ac
liftin and lifing_tac can now lift several "and"-separated goals at once; the raw-theorems have to be given in the order of goals
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 630
val msg1 = "The regularize proof failed."
4e0b89d886ac
liftin and lifing_tac can now lift several "and"-separated goals at once; the raw-theorems have to be given in the order of goals
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 631
val msg2 = cat_lines ["The injection proof failed.",
758
+ − 632
"This is probably due to missing respects lemmas.",
+ − 633
"Try invoking the injection method manually to see",
+ − 634
"which lemmas are missing."]
896
4e0b89d886ac
liftin and lifing_tac can now lift several "and"-separated goals at once; the raw-theorems have to be given in the order of goals
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 635
val msg3 = "The cleaning proof failed."
758
+ − 636
896
4e0b89d886ac
liftin and lifing_tac can now lift several "and"-separated goals at once; the raw-theorems have to be given in the order of goals
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 637
fun lift_tac ctxt rthms =
4e0b89d886ac
liftin and lifing_tac can now lift several "and"-separated goals at once; the raw-theorems have to be given in the order of goals
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 638
let
4e0b89d886ac
liftin and lifing_tac can now lift several "and"-separated goals at once; the raw-theorems have to be given in the order of goals
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 639
fun mk_tac rthm =
4e0b89d886ac
liftin and lifing_tac can now lift several "and"-separated goals at once; the raw-theorems have to be given in the order of goals
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 640
procedure_tac ctxt rthm
4e0b89d886ac
liftin and lifing_tac can now lift several "and"-separated goals at once; the raw-theorems have to be given in the order of goals
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 641
THEN' RANGE_WARN
4e0b89d886ac
liftin and lifing_tac can now lift several "and"-separated goals at once; the raw-theorems have to be given in the order of goals
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 642
[(regularize_tac ctxt, msg1),
4e0b89d886ac
liftin and lifing_tac can now lift several "and"-separated goals at once; the raw-theorems have to be given in the order of goals
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 643
(all_injection_tac ctxt, msg2),
4e0b89d886ac
liftin and lifing_tac can now lift several "and"-separated goals at once; the raw-theorems have to be given in the order of goals
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 644
(clean_tac ctxt, msg3)]
4e0b89d886ac
liftin and lifing_tac can now lift several "and"-separated goals at once; the raw-theorems have to be given in the order of goals
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 645
in
4e0b89d886ac
liftin and lifing_tac can now lift several "and"-separated goals at once; the raw-theorems have to be given in the order of goals
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 646
simp_tac (mk_minimal_ss ctxt) (* unfolding multiple &&& *)
4e0b89d886ac
liftin and lifing_tac can now lift several "and"-separated goals at once; the raw-theorems have to be given in the order of goals
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 647
THEN' RANGE (map mk_tac rthms)
4e0b89d886ac
liftin and lifing_tac can now lift several "and"-separated goals at once; the raw-theorems have to be given in the order of goals
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 648
end
758
+ − 649
814
+ − 650
end; (* structure *)