76 {outcome : atp_failure option, |
77 {outcome : atp_failure option, |
77 used_facts : (string * stature) list, |
78 used_facts : (string * stature) list, |
78 used_from : fact list, |
79 used_from : fact list, |
79 preferred_methss : proof_method * proof_method list list, |
80 preferred_methss : proof_method * proof_method list list, |
80 run_time : Time.time, |
81 run_time : Time.time, |
81 message : (unit -> (string * stature) list * (proof_method * play_outcome)) -> string} |
82 message : (unit -> (Pretty.T * stature) list * (proof_method * play_outcome)) -> string} |
82 |
83 |
83 type prover = params -> prover_problem -> prover_slice -> prover_result |
84 type prover = params -> prover_problem -> prover_slice -> prover_result |
84 |
85 |
85 val SledgehammerN : string |
86 val SledgehammerN : string |
86 val default_abduce_max_candidates : int |
87 val default_abduce_max_candidates : int |
87 val str_of_mode : mode -> string |
88 val str_of_mode : mode -> string |
88 val overlord_file_location_of_prover : string -> string * string |
89 val overlord_file_location_of_prover : string -> string * string |
89 val proof_banner : mode -> string -> string |
90 val proof_banner : mode -> string -> string |
90 val is_atp : string -> bool |
91 val is_atp : string -> bool |
91 val bunches_of_proof_methods : Proof.context -> bool -> bool -> string -> proof_method list list |
92 val bunches_of_metis_methods : Proof.context -> bool -> bool -> proof_method list list |
|
93 val bunches_of_smt_methods : Proof.context -> proof_method list list |
|
94 val bunches_of_proof_methods : Proof.context -> bool -> bool -> bool -> proof_method list list |
92 val facts_of_filter : string -> (string * fact list) list -> fact list |
95 val facts_of_filter : string -> (string * fact list) list -> fact list |
93 val facts_of_basic_slice : base_slice -> (string * fact list) list -> fact list |
96 val facts_of_basic_slice : base_slice -> (string * fact list) list -> fact list |
94 val is_fact_chained : (('a * stature) * 'b) -> bool |
97 val is_fact_chained : (('a * stature) * 'b) -> bool |
95 val filter_used_facts : bool -> (''a * stature) list -> ((''a * stature) * 'b) list -> |
98 val filter_used_facts : bool -> (''a * stature) list -> ((''a * stature) * 'b) list -> |
96 ((''a * stature) * 'b) list |
99 ((''a * stature) * 'b) list |
199 {outcome : atp_failure option, |
202 {outcome : atp_failure option, |
200 used_facts : (string * stature) list, |
203 used_facts : (string * stature) list, |
201 used_from : fact list, |
204 used_from : fact list, |
202 preferred_methss : proof_method * proof_method list list, |
205 preferred_methss : proof_method * proof_method list list, |
203 run_time : Time.time, |
206 run_time : Time.time, |
204 message : (unit -> (string * stature) list * (proof_method * play_outcome)) -> string} |
207 message : (unit -> (Pretty.T * stature) list * (proof_method * play_outcome)) -> string} |
205 |
208 |
206 type prover = params -> prover_problem -> prover_slice -> prover_result |
209 type prover = params -> prover_problem -> prover_slice -> prover_result |
207 |
210 |
208 fun overlord_file_location_of_prover prover = (getenv "ISABELLE_HOME_USER", "prob_" ^ prover) |
211 fun overlord_file_location_of_prover prover = (getenv "ISABELLE_HOME_USER", "prob_" ^ prover) |
209 |
212 |
210 fun proof_banner mode prover_name = |
213 fun proof_banner mode prover_name = |
211 (case mode of |
214 (case mode of |
212 Auto_Try => "Auto Sledgehammer (" ^ prover_name ^ ") found a proof: " |
215 Auto_Try => "Auto Sledgehammer (" ^ prover_name ^ ") found a proof:" |
213 | Try => "Sledgehammer (" ^ prover_name ^ ") found a proof: " |
216 | Try => "Sledgehammer (" ^ prover_name ^ ") found a proof:" |
214 | _ => "Try this: ") |
217 | _ => "Try this:") |
215 |
218 |
216 fun bunches_of_proof_methods ctxt smt_proofs needs_full_types desperate_lam_trans = |
219 fun bunches_of_metis_methods ctxt needs_full_types needs_lam_defs = |
|
220 let |
|
221 (* metis without options (preferred) *) |
|
222 val preferred_method = Metis_Method (NONE, NONE, []) |
|
223 |
|
224 (* metis with different options *) |
|
225 val desperate_lam_trans = if needs_lam_defs then liftingN else opaque_liftingN |
|
226 val option_methods = |
|
227 Metis_Method (SOME full_typesN, NONE, []) :: |
|
228 Metis_Method (NONE, SOME liftingN, []) :: |
|
229 Metis_Method (SOME really_full_type_enc, SOME desperate_lam_trans, []) :: |
|
230 (if needs_full_types then |
|
231 [Metis_Method (SOME really_full_type_enc, NONE, []), |
|
232 Metis_Method (SOME full_typesN, SOME desperate_lam_trans, [])] |
|
233 else |
|
234 [Metis_Method (SOME no_typesN, SOME desperate_lam_trans, [])]) |
|
235 |
|
236 (* metis with extensionality (often needed for lifting) *) |
|
237 val ext_facts = [short_thm_name ctxt ext] |
|
238 val ext_methods = |
|
239 Metis_Method (NONE, SOME liftingN, ext_facts) :: |
|
240 (if not needs_lam_defs then |
|
241 [] |
|
242 else if needs_full_types then |
|
243 [Metis_Method (SOME full_typesN, SOME liftingN, ext_facts)] |
|
244 else |
|
245 [Metis_Method (SOME no_typesN, SOME liftingN, ext_facts)]) |
|
246 in |
|
247 [[preferred_method], option_methods, ext_methods] |
|
248 end |
|
249 |
|
250 fun bunches_of_smt_methods ctxt = |
|
251 [map (SMT_Method o SMT_Verit) (Verit_Strategies.all_veriT_stgies (Context.Proof ctxt)), |
|
252 [SMT_Method SMT_Z3]] |
|
253 |
|
254 fun bunches_of_proof_methods ctxt smt_proofs needs_full_types needs_lam_defs = |
217 let |
255 let |
218 val misc_methodss = |
256 val misc_methodss = |
219 [[Simp_Method, Auto_Method, Blast_Method, Linarith_Method, Meson_Method, |
257 [[Simp_Method, Auto_Method, Blast_Method, Linarith_Method, Meson_Method, |
220 Metis_Method (NONE, NONE), Fastforce_Method, Force_Method, Presburger_Method, |
258 Metis_Method (NONE, NONE, []), Fastforce_Method, Force_Method, Presburger_Method, |
221 Argo_Method, Order_Method]] |
259 Argo_Method, Order_Method]] |
222 |
260 |
223 val metis_methodss = |
261 val metis_methodss = |
224 [Metis_Method (SOME full_typesN, NONE) :: |
262 tl (bunches_of_metis_methods ctxt needs_full_types needs_lam_defs) |
225 Metis_Method (SOME really_full_type_enc, SOME desperate_lam_trans) :: |
|
226 (if needs_full_types then |
|
227 [Metis_Method (SOME really_full_type_enc, NONE), |
|
228 Metis_Method (SOME full_typesN, SOME desperate_lam_trans)] |
|
229 else |
|
230 [Metis_Method (SOME no_typesN, SOME desperate_lam_trans)])] |
|
231 |
263 |
232 val smt_methodss = |
264 val smt_methodss = |
233 if smt_proofs then |
265 if smt_proofs then |
234 [map (SMT_Method o SMT_Verit) (Verit_Strategies.all_veriT_stgies (Context.Proof ctxt)), |
266 bunches_of_smt_methods ctxt |
235 [SMT_Method SMT_Z3]] |
|
236 else |
267 else |
237 [] |
268 [] |
238 in |
269 in |
239 misc_methodss @ metis_methodss @ smt_methodss |
270 misc_methodss @ metis_methodss @ smt_methodss |
240 end |
271 end |