7 signature BASIC_GOAL = |
7 signature BASIC_GOAL = |
8 sig |
8 sig |
9 val skip_proofs: bool Unsynchronized.ref |
9 val skip_proofs: bool Unsynchronized.ref |
10 val parallel_proofs: int Unsynchronized.ref |
10 val parallel_proofs: int Unsynchronized.ref |
11 val SELECT_GOAL: tactic -> int -> tactic |
11 val SELECT_GOAL: tactic -> int -> tactic |
|
12 val PREFER_GOAL: tactic -> int -> tactic |
12 val CONJUNCTS: tactic -> int -> tactic |
13 val CONJUNCTS: tactic -> int -> tactic |
13 val PRECISE_CONJUNCTS: int -> tactic -> int -> tactic |
14 val PRECISE_CONJUNCTS: int -> tactic -> int -> tactic |
14 val PARALLEL_CHOICE: tactic list -> tactic |
15 val PARALLEL_CHOICE: tactic list -> tactic |
15 val PARALLEL_GOALS: tactic -> tactic |
16 val PARALLEL_GOALS: tactic -> tactic |
16 end; |
17 end; |
50 ({prems: thm list, context: Proof.context} -> tactic) -> thm |
51 ({prems: thm list, context: Proof.context} -> tactic) -> thm |
51 val prove_sorry_global: theory -> string list -> term list -> term -> |
52 val prove_sorry_global: theory -> string list -> term list -> term -> |
52 ({prems: thm list, context: Proof.context} -> tactic) -> thm |
53 ({prems: thm list, context: Proof.context} -> tactic) -> thm |
53 val extract: int -> int -> thm -> thm Seq.seq |
54 val extract: int -> int -> thm -> thm Seq.seq |
54 val retrofit: int -> int -> thm -> thm -> thm Seq.seq |
55 val retrofit: int -> int -> thm -> thm -> thm Seq.seq |
|
56 val restrict: int -> int -> thm -> thm |
|
57 val unrestrict: int -> thm -> thm |
55 val conjunction_tac: int -> tactic |
58 val conjunction_tac: int -> tactic |
56 val precise_conjunction_tac: int -> int -> tactic |
59 val precise_conjunction_tac: int -> int -> tactic |
57 val recover_conjunction_tac: tactic |
60 val recover_conjunction_tac: tactic |
58 val norm_hhf_tac: int -> tactic |
61 val norm_hhf_tac: int -> tactic |
59 val assume_rule_tac: Proof.context -> int -> tactic |
62 val assume_rule_tac: Proof.context -> int -> tactic |
359 (if n = 1 then st |
362 (if n = 1 then st |
360 else st |> Drule.with_subgoal i (Conjunction.uncurry_balanced n)) |
363 else st |> Drule.with_subgoal i (Conjunction.uncurry_balanced n)) |
361 |> Thm.bicompose {flatten = false, match = false, incremented = false} |
364 |> Thm.bicompose {flatten = false, match = false, incremented = false} |
362 (false, conclude st', Thm.nprems_of st') i; |
365 (false, conclude st', Thm.nprems_of st') i; |
363 |
366 |
|
367 |
|
368 (* rearrange subgoals *) |
|
369 |
|
370 fun restrict i n st = |
|
371 if i < 1 orelse n < 1 orelse i + n - 1 > Thm.nprems_of st |
|
372 then raise THM ("Goal.restrict", i, [st]) |
|
373 else rotate_prems (i - 1) st |> protect n; |
|
374 |
|
375 fun unrestrict i = conclude #> rotate_prems (1 - i); |
|
376 |
|
377 (*with structural marker*) |
364 fun SELECT_GOAL tac i st = |
378 fun SELECT_GOAL tac i st = |
365 if Thm.nprems_of st = 1 andalso i = 1 then tac st |
379 if Thm.nprems_of st = 1 andalso i = 1 then tac st |
366 else Seq.lifts (retrofit i 1) (Seq.maps tac (extract i 1 st)) st; |
380 else (PRIMITIVE (restrict i 1) THEN tac THEN PRIMITIVE (unrestrict i)) st; |
|
381 |
|
382 (*without structural marker*) |
|
383 fun PREFER_GOAL tac i st = |
|
384 if i < 1 orelse i > Thm.nprems_of st then Seq.empty |
|
385 else (PRIMITIVE (rotate_prems (i - 1)) THEN tac THEN PRIMITIVE (rotate_prems (1 - i))) st; |
367 |
386 |
368 |
387 |
369 (* multiple goals *) |
388 (* multiple goals *) |
370 |
389 |
371 fun precise_conjunction_tac 0 i = eq_assume_tac i |
390 fun precise_conjunction_tac 0 i = eq_assume_tac i |