author | blanchet |
Wed, 25 Aug 2010 09:02:07 +0200 | |
changeset 38739 | 8b8ed80b5699 |
parent 38699 | 27378b4a776b |
child 38741 | 7635bf8918a1 |
permissions | -rw-r--r-- |
38282
319c59682c51
move Sledgehammer's HOL -> FOL translation to separate file (sledgehammer_translate.ML)
blanchet
parents:
38100
diff
changeset
|
1 |
(* Title: HOL/Tools/Sledgehammer/sledgehammer_fact_minimize.ML |
31037
ac8669134e7a
added Philipp Meyer's implementation of AtpMinimal
immler@in.tum.de
parents:
diff
changeset
|
2 |
Author: Philipp Meyer, TU Muenchen |
36370
a4f601daa175
centralized ATP-specific error handling in "atp_wrapper.ML"
blanchet
parents:
36369
diff
changeset
|
3 |
Author: Jasmin Blanchette, TU Muenchen |
31037
ac8669134e7a
added Philipp Meyer's implementation of AtpMinimal
immler@in.tum.de
parents:
diff
changeset
|
4 |
|
35867 | 5 |
Minimization of theorem list for Metis using automatic theorem provers. |
31037
ac8669134e7a
added Philipp Meyer's implementation of AtpMinimal
immler@in.tum.de
parents:
diff
changeset
|
6 |
*) |
ac8669134e7a
added Philipp Meyer's implementation of AtpMinimal
immler@in.tum.de
parents:
diff
changeset
|
7 |
|
38282
319c59682c51
move Sledgehammer's HOL -> FOL translation to separate file (sledgehammer_translate.ML)
blanchet
parents:
38100
diff
changeset
|
8 |
signature SLEDGEHAMMER_FACT_MINIMIZE = |
32525 | 9 |
sig |
38021
e024504943d1
rename "ATP_Manager" ML module to "Sledgehammer";
blanchet
parents:
38015
diff
changeset
|
10 |
type params = Sledgehammer.params |
35867 | 11 |
|
38050 | 12 |
val minimize_theorems : |
38698
d19c3a7ce38b
clean handling of whether a fact is chained or not;
blanchet
parents:
38696
diff
changeset
|
13 |
params -> int -> int -> Proof.state -> ((string * bool) * thm list) list |
d19c3a7ce38b
clean handling of whether a fact is chained or not;
blanchet
parents:
38696
diff
changeset
|
14 |
-> ((string * bool) * thm list) list option * string |
38282
319c59682c51
move Sledgehammer's HOL -> FOL translation to separate file (sledgehammer_translate.ML)
blanchet
parents:
38100
diff
changeset
|
15 |
val run_minimize : params -> int -> Facts.ref list -> Proof.state -> unit |
35866
513074557e06
move the Sledgehammer Isar commands together into one file;
blanchet
parents:
35865
diff
changeset
|
16 |
end; |
32525 | 17 |
|
38282
319c59682c51
move Sledgehammer's HOL -> FOL translation to separate file (sledgehammer_translate.ML)
blanchet
parents:
38100
diff
changeset
|
18 |
structure Sledgehammer_Fact_Minimize : SLEDGEHAMMER_FACT_MINIMIZE = |
31037
ac8669134e7a
added Philipp Meyer's implementation of AtpMinimal
immler@in.tum.de
parents:
diff
changeset
|
19 |
struct |
ac8669134e7a
added Philipp Meyer's implementation of AtpMinimal
immler@in.tum.de
parents:
diff
changeset
|
20 |
|
38586 | 21 |
open ATP_Systems |
36142
f5e15e9aae10
make Sledgehammer "minimize" output less confusing + round up (not down) time limits to nearest second
blanchet
parents:
36063
diff
changeset
|
22 |
open Sledgehammer_Util |
38045 | 23 |
open Sledgehammer_Fact_Filter |
36063
cdc6855a6387
make Sledgehammer output "by" vs. "apply", "qed" vs. "next", and any necessary "prefer"
blanchet
parents:
35969
diff
changeset
|
24 |
open Sledgehammer_Proof_Reconstruct |
38021
e024504943d1
rename "ATP_Manager" ML module to "Sledgehammer";
blanchet
parents:
38015
diff
changeset
|
25 |
open Sledgehammer |
35866
513074557e06
move the Sledgehammer Isar commands together into one file;
blanchet
parents:
35865
diff
changeset
|
26 |
|
36370
a4f601daa175
centralized ATP-specific error handling in "atp_wrapper.ML"
blanchet
parents:
36369
diff
changeset
|
27 |
(* wrapper for calling external prover *) |
31236 | 28 |
|
36370
a4f601daa175
centralized ATP-specific error handling in "atp_wrapper.ML"
blanchet
parents:
36369
diff
changeset
|
29 |
fun string_for_failure Unprovable = "Unprovable." |
a4f601daa175
centralized ATP-specific error handling in "atp_wrapper.ML"
blanchet
parents:
36369
diff
changeset
|
30 |
| string_for_failure TimedOut = "Timed out." |
38092
81a003f7de0d
speed up the minimizer by using the time taken for the first iteration as a timeout for the following iterations, and fix a subtle bug in "string_for_failure"
blanchet
parents:
38084
diff
changeset
|
31 |
| string_for_failure _ = "Unknown error." |
31236 | 32 |
|
38698
d19c3a7ce38b
clean handling of whether a fact is chained or not;
blanchet
parents:
38696
diff
changeset
|
33 |
fun n_theorems names = |
d19c3a7ce38b
clean handling of whether a fact is chained or not;
blanchet
parents:
38696
diff
changeset
|
34 |
let val n = length names in |
38092
81a003f7de0d
speed up the minimizer by using the time taken for the first iteration as a timeout for the following iterations, and fix a subtle bug in "string_for_failure"
blanchet
parents:
38084
diff
changeset
|
35 |
string_of_int n ^ " theorem" ^ plural_s n ^ |
81a003f7de0d
speed up the minimizer by using the time taken for the first iteration as a timeout for the following iterations, and fix a subtle bug in "string_for_failure"
blanchet
parents:
38084
diff
changeset
|
36 |
(if n > 0 then |
38698
d19c3a7ce38b
clean handling of whether a fact is chained or not;
blanchet
parents:
38696
diff
changeset
|
37 |
": " ^ (names |> map fst |
d19c3a7ce38b
clean handling of whether a fact is chained or not;
blanchet
parents:
38696
diff
changeset
|
38 |
|> sort_distinct string_ord |> space_implode " ") |
38092
81a003f7de0d
speed up the minimizer by using the time taken for the first iteration as a timeout for the following iterations, and fix a subtle bug in "string_for_failure"
blanchet
parents:
38084
diff
changeset
|
39 |
else |
81a003f7de0d
speed up the minimizer by using the time taken for the first iteration as a timeout for the following iterations, and fix a subtle bug in "string_for_failure"
blanchet
parents:
38084
diff
changeset
|
40 |
"") |
81a003f7de0d
speed up the minimizer by using the time taken for the first iteration as a timeout for the following iterations, and fix a subtle bug in "string_for_failure"
blanchet
parents:
38084
diff
changeset
|
41 |
end |
81a003f7de0d
speed up the minimizer by using the time taken for the first iteration as a timeout for the following iterations, and fix a subtle bug in "string_for_failure"
blanchet
parents:
38084
diff
changeset
|
42 |
|
38100
e458a0dd3dc1
use "explicit_apply" in the minimizer whenever it might make a difference to prevent freak failures;
blanchet
parents:
38094
diff
changeset
|
43 |
fun test_theorems ({debug, verbose, overlord, atps, full_types, |
38739
8b8ed80b5699
renamed "relevance_convergence" to "relevance_decay"
blanchet
parents:
38699
diff
changeset
|
44 |
relevance_threshold, relevance_decay, defs_relevant, |
8b8ed80b5699
renamed "relevance_convergence" to "relevance_decay"
blanchet
parents:
38699
diff
changeset
|
45 |
isar_proof, isar_shrink_factor, ...} : params) |
38100
e458a0dd3dc1
use "explicit_apply" in the minimizer whenever it might make a difference to prevent freak failures;
blanchet
parents:
38094
diff
changeset
|
46 |
(prover : prover) explicit_apply timeout subgoal state |
e458a0dd3dc1
use "explicit_apply" in the minimizer whenever it might make a difference to prevent freak failures;
blanchet
parents:
38094
diff
changeset
|
47 |
name_thms_pairs = |
31236 | 48 |
let |
38015 | 49 |
val _ = |
38092
81a003f7de0d
speed up the minimizer by using the time taken for the first iteration as a timeout for the following iterations, and fix a subtle bug in "string_for_failure"
blanchet
parents:
38084
diff
changeset
|
50 |
priority ("Testing " ^ n_theorems (map fst name_thms_pairs) ^ "...") |
38100
e458a0dd3dc1
use "explicit_apply" in the minimizer whenever it might make a difference to prevent freak failures;
blanchet
parents:
38094
diff
changeset
|
51 |
val params = |
e458a0dd3dc1
use "explicit_apply" in the minimizer whenever it might make a difference to prevent freak failures;
blanchet
parents:
38094
diff
changeset
|
52 |
{debug = debug, verbose = verbose, overlord = overlord, atps = atps, |
e458a0dd3dc1
use "explicit_apply" in the minimizer whenever it might make a difference to prevent freak failures;
blanchet
parents:
38094
diff
changeset
|
53 |
full_types = full_types, explicit_apply = explicit_apply, |
e458a0dd3dc1
use "explicit_apply" in the minimizer whenever it might make a difference to prevent freak failures;
blanchet
parents:
38094
diff
changeset
|
54 |
relevance_threshold = relevance_threshold, |
38739
8b8ed80b5699
renamed "relevance_convergence" to "relevance_decay"
blanchet
parents:
38699
diff
changeset
|
55 |
relevance_decay = relevance_decay, max_relevant_per_iter = NONE, |
8b8ed80b5699
renamed "relevance_convergence" to "relevance_decay"
blanchet
parents:
38699
diff
changeset
|
56 |
theory_relevant = NONE, defs_relevant = defs_relevant, |
8b8ed80b5699
renamed "relevance_convergence" to "relevance_decay"
blanchet
parents:
38699
diff
changeset
|
57 |
isar_proof = isar_proof, isar_shrink_factor = isar_shrink_factor, |
8b8ed80b5699
renamed "relevance_convergence" to "relevance_decay"
blanchet
parents:
38699
diff
changeset
|
58 |
timeout = timeout} |
38084
e2aac207d13b
"axiom_clauses" -> "axioms" (these are no longer clauses)
blanchet
parents:
38083
diff
changeset
|
59 |
val axioms = maps (fn (n, ths) => map (pair n) ths) name_thms_pairs |
36263
56bf63d70120
use "Proof.goal" in Sledgehammer's minimizer (just like everywhere else in Sledgehammer), not "Proof.raw_goal"
blanchet
parents:
36232
diff
changeset
|
60 |
val {context = ctxt, facts, goal} = Proof.goal state |
32941
72d48e333b77
eliminated extraneous wrapping of public records;
wenzelm
parents:
32937
diff
changeset
|
61 |
val problem = |
36063
cdc6855a6387
make Sledgehammer output "by" vs. "apply", "qed" vs. "next", and any necessary "prefer"
blanchet
parents:
35969
diff
changeset
|
62 |
{subgoal = subgoal, goal = (ctxt, (facts, goal)), |
35969 | 63 |
relevance_override = {add = [], del = [], only = false}, |
38084
e2aac207d13b
"axiom_clauses" -> "axioms" (these are no longer clauses)
blanchet
parents:
38083
diff
changeset
|
64 |
axioms = SOME axioms} |
38698
d19c3a7ce38b
clean handling of whether a fact is chained or not;
blanchet
parents:
38696
diff
changeset
|
65 |
val result as {outcome, used_thm_names, ...} = prover params (K "") problem |
36223
217ca1273786
make Sledgehammer's minimizer also minimize Isar proofs
blanchet
parents:
36143
diff
changeset
|
66 |
in |
38092
81a003f7de0d
speed up the minimizer by using the time taken for the first iteration as a timeout for the following iterations, and fix a subtle bug in "string_for_failure"
blanchet
parents:
38084
diff
changeset
|
67 |
priority (case outcome of |
81a003f7de0d
speed up the minimizer by using the time taken for the first iteration as a timeout for the following iterations, and fix a subtle bug in "string_for_failure"
blanchet
parents:
38084
diff
changeset
|
68 |
NONE => |
81a003f7de0d
speed up the minimizer by using the time taken for the first iteration as a timeout for the following iterations, and fix a subtle bug in "string_for_failure"
blanchet
parents:
38084
diff
changeset
|
69 |
if length used_thm_names = length name_thms_pairs then |
81a003f7de0d
speed up the minimizer by using the time taken for the first iteration as a timeout for the following iterations, and fix a subtle bug in "string_for_failure"
blanchet
parents:
38084
diff
changeset
|
70 |
"Found proof." |
81a003f7de0d
speed up the minimizer by using the time taken for the first iteration as a timeout for the following iterations, and fix a subtle bug in "string_for_failure"
blanchet
parents:
38084
diff
changeset
|
71 |
else |
81a003f7de0d
speed up the minimizer by using the time taken for the first iteration as a timeout for the following iterations, and fix a subtle bug in "string_for_failure"
blanchet
parents:
38084
diff
changeset
|
72 |
"Found proof with " ^ n_theorems used_thm_names ^ "." |
81a003f7de0d
speed up the minimizer by using the time taken for the first iteration as a timeout for the following iterations, and fix a subtle bug in "string_for_failure"
blanchet
parents:
38084
diff
changeset
|
73 |
| SOME failure => string_for_failure failure); |
81a003f7de0d
speed up the minimizer by using the time taken for the first iteration as a timeout for the following iterations, and fix a subtle bug in "string_for_failure"
blanchet
parents:
38084
diff
changeset
|
74 |
result |
36223
217ca1273786
make Sledgehammer's minimizer also minimize Isar proofs
blanchet
parents:
36143
diff
changeset
|
75 |
end |
31236 | 76 |
|
77 |
(* minimalization of thms *) |
|
78 |
||
38698
d19c3a7ce38b
clean handling of whether a fact is chained or not;
blanchet
parents:
38696
diff
changeset
|
79 |
fun filter_used_facts used = filter (member (op =) used o fst) |
38015 | 80 |
|
81 |
fun sublinear_minimize _ [] p = p |
|
82 |
| sublinear_minimize test (x :: xs) (seen, result) = |
|
83 |
case test (xs @ seen) of |
|
38488 | 84 |
result as {outcome = NONE, proof, used_thm_names, ...} : prover_result => |
38015 | 85 |
sublinear_minimize test (filter_used_facts used_thm_names xs) |
86 |
(filter_used_facts used_thm_names seen, result) |
|
87 |
| _ => sublinear_minimize test xs (x :: seen, result) |
|
88 |
||
38092
81a003f7de0d
speed up the minimizer by using the time taken for the first iteration as a timeout for the following iterations, and fix a subtle bug in "string_for_failure"
blanchet
parents:
38084
diff
changeset
|
89 |
(* Give the ATP some slack. The ATP gets further slack because the Sledgehammer |
81a003f7de0d
speed up the minimizer by using the time taken for the first iteration as a timeout for the following iterations, and fix a subtle bug in "string_for_failure"
blanchet
parents:
38084
diff
changeset
|
90 |
preprocessing time is included in the estimate below but isn't part of the |
81a003f7de0d
speed up the minimizer by using the time taken for the first iteration as a timeout for the following iterations, and fix a subtle bug in "string_for_failure"
blanchet
parents:
38084
diff
changeset
|
91 |
timeout. *) |
38590
bd443b426d56
get rid of "minimize_timeout", now that there's an automatic adaptive timeout mechanism in "minimize"
blanchet
parents:
38589
diff
changeset
|
92 |
val fudge_msecs = 1000 |
38092
81a003f7de0d
speed up the minimizer by using the time taken for the first iteration as a timeout for the following iterations, and fix a subtle bug in "string_for_failure"
blanchet
parents:
38084
diff
changeset
|
93 |
|
81a003f7de0d
speed up the minimizer by using the time taken for the first iteration as a timeout for the following iterations, and fix a subtle bug in "string_for_failure"
blanchet
parents:
38084
diff
changeset
|
94 |
fun minimize_theorems {atps = [], ...} _ _ _ _ = error "No ATP is set." |
81a003f7de0d
speed up the minimizer by using the time taken for the first iteration as a timeout for the following iterations, and fix a subtle bug in "string_for_failure"
blanchet
parents:
38084
diff
changeset
|
95 |
| minimize_theorems |
38589
b03f8fe043ec
added "max_relevant_per_iter" option to Sledgehammer
blanchet
parents:
38586
diff
changeset
|
96 |
(params as {debug, atps = atp :: _, full_types, isar_proof, |
38590
bd443b426d56
get rid of "minimize_timeout", now that there's an automatic adaptive timeout mechanism in "minimize"
blanchet
parents:
38589
diff
changeset
|
97 |
isar_shrink_factor, timeout, ...}) |
38092
81a003f7de0d
speed up the minimizer by using the time taken for the first iteration as a timeout for the following iterations, and fix a subtle bug in "string_for_failure"
blanchet
parents:
38084
diff
changeset
|
98 |
i n state name_thms_pairs = |
31236 | 99 |
let |
36378 | 100 |
val thy = Proof.theory_of state |
38092
81a003f7de0d
speed up the minimizer by using the time taken for the first iteration as a timeout for the following iterations, and fix a subtle bug in "string_for_failure"
blanchet
parents:
38084
diff
changeset
|
101 |
val prover = get_prover_fun thy atp |
38590
bd443b426d56
get rid of "minimize_timeout", now that there's an automatic adaptive timeout mechanism in "minimize"
blanchet
parents:
38589
diff
changeset
|
102 |
val msecs = Time.toMilliseconds timeout |
bd443b426d56
get rid of "minimize_timeout", now that there's an automatic adaptive timeout mechanism in "minimize"
blanchet
parents:
38589
diff
changeset
|
103 |
val _ = priority ("Sledgehammer minimize: ATP " ^ quote atp ^ ".") |
38092
81a003f7de0d
speed up the minimizer by using the time taken for the first iteration as a timeout for the following iterations, and fix a subtle bug in "string_for_failure"
blanchet
parents:
38084
diff
changeset
|
104 |
val {context = ctxt, goal, ...} = Proof.goal state |
38100
e458a0dd3dc1
use "explicit_apply" in the minimizer whenever it might make a difference to prevent freak failures;
blanchet
parents:
38094
diff
changeset
|
105 |
val (_, hyp_ts, concl_t) = strip_subgoal goal i |
e458a0dd3dc1
use "explicit_apply" in the minimizer whenever it might make a difference to prevent freak failures;
blanchet
parents:
38094
diff
changeset
|
106 |
val explicit_apply = |
e458a0dd3dc1
use "explicit_apply" in the minimizer whenever it might make a difference to prevent freak failures;
blanchet
parents:
38094
diff
changeset
|
107 |
not (forall (Meson.is_fol_term thy) |
38586 | 108 |
(concl_t :: hyp_ts @ |
109 |
maps (map prop_of o snd) name_thms_pairs)) |
|
38100
e458a0dd3dc1
use "explicit_apply" in the minimizer whenever it might make a difference to prevent freak failures;
blanchet
parents:
38094
diff
changeset
|
110 |
fun do_test timeout = |
e458a0dd3dc1
use "explicit_apply" in the minimizer whenever it might make a difference to prevent freak failures;
blanchet
parents:
38094
diff
changeset
|
111 |
test_theorems params prover explicit_apply timeout i state |
38092
81a003f7de0d
speed up the minimizer by using the time taken for the first iteration as a timeout for the following iterations, and fix a subtle bug in "string_for_failure"
blanchet
parents:
38084
diff
changeset
|
112 |
val timer = Timer.startRealTimer () |
31236 | 113 |
in |
38590
bd443b426d56
get rid of "minimize_timeout", now that there's an automatic adaptive timeout mechanism in "minimize"
blanchet
parents:
38589
diff
changeset
|
114 |
(case do_test timeout name_thms_pairs of |
38083
c4b57f68ddb3
remove the "extra_clauses" business introduced in 19a5f1c8a844;
blanchet
parents:
38050
diff
changeset
|
115 |
result as {outcome = NONE, pool, used_thm_names, |
c4b57f68ddb3
remove the "extra_clauses" business introduced in 19a5f1c8a844;
blanchet
parents:
38050
diff
changeset
|
116 |
conjecture_shape, ...} => |
38015 | 117 |
let |
38092
81a003f7de0d
speed up the minimizer by using the time taken for the first iteration as a timeout for the following iterations, and fix a subtle bug in "string_for_failure"
blanchet
parents:
38084
diff
changeset
|
118 |
val time = Timer.checkRealTimer timer |
81a003f7de0d
speed up the minimizer by using the time taken for the first iteration as a timeout for the following iterations, and fix a subtle bug in "string_for_failure"
blanchet
parents:
38084
diff
changeset
|
119 |
val new_timeout = |
81a003f7de0d
speed up the minimizer by using the time taken for the first iteration as a timeout for the following iterations, and fix a subtle bug in "string_for_failure"
blanchet
parents:
38084
diff
changeset
|
120 |
Int.min (msecs, Time.toMilliseconds time + fudge_msecs) |
81a003f7de0d
speed up the minimizer by using the time taken for the first iteration as a timeout for the following iterations, and fix a subtle bug in "string_for_failure"
blanchet
parents:
38084
diff
changeset
|
121 |
|> Time.fromMilliseconds |
38282
319c59682c51
move Sledgehammer's HOL -> FOL translation to separate file (sledgehammer_translate.ML)
blanchet
parents:
38100
diff
changeset
|
122 |
val (min_thms, {proof, axiom_names, ...}) = |
38100
e458a0dd3dc1
use "explicit_apply" in the minimizer whenever it might make a difference to prevent freak failures;
blanchet
parents:
38094
diff
changeset
|
123 |
sublinear_minimize (do_test new_timeout) |
38083
c4b57f68ddb3
remove the "extra_clauses" business introduced in 19a5f1c8a844;
blanchet
parents:
38050
diff
changeset
|
124 |
(filter_used_facts used_thm_names name_thms_pairs) ([], result) |
38094 | 125 |
val n = length min_thms |
38015 | 126 |
val _ = priority (cat_lines |
38094 | 127 |
["Minimized: " ^ string_of_int n ^ " theorem" ^ plural_s n] ^ |
38698
d19c3a7ce38b
clean handling of whether a fact is chained or not;
blanchet
parents:
38696
diff
changeset
|
128 |
(case length (filter (snd o fst) min_thms) of |
d19c3a7ce38b
clean handling of whether a fact is chained or not;
blanchet
parents:
38696
diff
changeset
|
129 |
0 => "" |
d19c3a7ce38b
clean handling of whether a fact is chained or not;
blanchet
parents:
38696
diff
changeset
|
130 |
| n => " (including " ^ Int.toString n ^ " chained)") ^ ".") |
38015 | 131 |
in |
132 |
(SOME min_thms, |
|
133 |
proof_text isar_proof |
|
134 |
(pool, debug, isar_shrink_factor, ctxt, conjecture_shape) |
|
38282
319c59682c51
move Sledgehammer's HOL -> FOL translation to separate file (sledgehammer_translate.ML)
blanchet
parents:
38100
diff
changeset
|
135 |
(full_types, K "", proof, axiom_names, goal, i) |> fst) |
38015 | 136 |
end |
137 |
| {outcome = SOME TimedOut, ...} => |
|
138 |
(NONE, "Timeout: You can increase the time limit using the \"timeout\" \ |
|
139 |
\option (e.g., \"timeout = " ^ |
|
140 |
string_of_int (10 + msecs div 1000) ^ " s\").") |
|
141 |
| {outcome = SOME UnknownError, ...} => |
|
142 |
(* Failure sometimes mean timeout, unfortunately. *) |
|
143 |
(NONE, "Failure: No proof was found with the current time limit. You \ |
|
144 |
\can increase the time limit using the \"timeout\" \ |
|
145 |
\option (e.g., \"timeout = " ^ |
|
146 |
string_of_int (10 + msecs div 1000) ^ " s\").") |
|
147 |
| {message, ...} => (NONE, "ATP error: " ^ message)) |
|
37994
b04307085a09
make TPTP generator accept full first-order formulas
blanchet
parents:
37926
diff
changeset
|
148 |
handle ERROR msg => (NONE, "Error: " ^ msg) |
31236 | 149 |
end |
150 |
||
38282
319c59682c51
move Sledgehammer's HOL -> FOL translation to separate file (sledgehammer_translate.ML)
blanchet
parents:
38100
diff
changeset
|
151 |
fun run_minimize params i refs state = |
38045 | 152 |
let |
153 |
val ctxt = Proof.context_of state |
|
38696
4c6b65d6a135
quote facts whose names collide with a keyword or command name (cf. "subclass" in "Jinja/J/TypeSafe.thy")
blanchet
parents:
38617
diff
changeset
|
154 |
val reserved = reserved_isar_keyword_table () |
38045 | 155 |
val chained_ths = #facts (Proof.goal state) |
38696
4c6b65d6a135
quote facts whose names collide with a keyword or command name (cf. "subclass" in "Jinja/J/TypeSafe.thy")
blanchet
parents:
38617
diff
changeset
|
156 |
val name_thms_pairs = |
38699 | 157 |
map (apfst (fn f => f ()) |
158 |
o name_thms_pair_from_ref ctxt reserved chained_ths) refs |
|
38045 | 159 |
in |
160 |
case subgoal_count state of |
|
161 |
0 => priority "No subgoal!" |
|
162 |
| n => |
|
163 |
(kill_atps (); |
|
164 |
priority (#2 (minimize_theorems params i n state name_thms_pairs))) |
|
165 |
end |
|
166 |
||
35866
513074557e06
move the Sledgehammer Isar commands together into one file;
blanchet
parents:
35865
diff
changeset
|
167 |
end; |