equal
deleted
inserted
replaced
130 : prover_result => |
130 : prover_result => |
131 min (new_timeout timeout run_time) |
131 min (new_timeout timeout run_time) |
132 (filter_used_facts true used_facts xs) |
132 (filter_used_facts true used_facts xs) |
133 (filter_used_facts false used_facts seen, result) |
133 (filter_used_facts false used_facts seen, result) |
134 | _ => min timeout xs (x :: seen, result) |
134 | _ => min timeout xs (x :: seen, result) |
135 in min timeout (rev xs) ([], result) end |
135 in min timeout xs ([], result) end |
136 |
136 |
137 fun binary_minimize test timeout result xs = |
137 fun binary_minimize test timeout result xs = |
138 let |
138 let |
139 fun min depth (result as {run_time, ...} : prover_result) sup |
139 fun min depth (result as {run_time, ...} : prover_result) sup |
140 (xs as _ :: _ :: _) = |
140 (xs as _ :: _ :: _) = |
191 val ctxt = Proof.context_of state |
191 val ctxt = Proof.context_of state |
192 val prover = |
192 val prover = |
193 get_prover ctxt (if silent then Auto_Minimize else Minimize) prover_name |
193 get_prover ctxt (if silent then Auto_Minimize else Minimize) prover_name |
194 fun test timeout = test_facts params silent prover timeout i n state |
194 fun test timeout = test_facts params silent prover timeout i n state |
195 val (chained, non_chained) = List.partition is_fact_chained facts |
195 val (chained, non_chained) = List.partition is_fact_chained facts |
196 (* Pull chained facts to the front, so that they are less likely to be |
196 (* Push chained facts to the back, so that they are less likely to be |
197 kicked out by the minimization algorithms (cf. "rev" in |
197 kicked out by the linear minimization algorithm. *) |
198 "linear_minimize"). *) |
|
199 val facts = non_chained @ chained |
198 val facts = non_chained @ chained |
200 in |
199 in |
201 (print silent (fn () => "Sledgehammer minimizer: " ^ |
200 (print silent (fn () => "Sledgehammer minimizer: " ^ |
202 quote prover_name ^ "."); |
201 quote prover_name ^ "."); |
203 case test timeout facts of |
202 case test timeout facts of |