69 val smt_monomorphize_limit : int Unsynchronized.ref |
69 val smt_monomorphize_limit : int Unsynchronized.ref |
70 |
70 |
71 val das_Tool : string |
71 val das_Tool : string |
72 val select_smt_solver : string -> Proof.context -> Proof.context |
72 val select_smt_solver : string -> Proof.context -> Proof.context |
73 val is_smt_prover : Proof.context -> string -> bool |
73 val is_smt_prover : Proof.context -> string -> bool |
74 val is_prover_available : Proof.context -> string -> bool |
74 val is_prover_supported : Proof.context -> string -> bool |
75 val is_prover_installed : Proof.context -> string -> bool |
75 val is_prover_installed : Proof.context -> string -> bool |
76 val default_max_relevant_for_prover : Proof.context -> string -> int |
76 val default_max_relevant_for_prover : Proof.context -> string -> int |
77 val is_built_in_const_for_prover : |
77 val is_built_in_const_for_prover : |
78 Proof.context -> string -> string * typ -> term list -> bool * term list |
78 Proof.context -> string -> string * typ -> term list -> bool * term list |
79 val atp_relevance_fudge : relevance_fudge |
79 val atp_relevance_fudge : relevance_fudge |
87 -> (string * locality) * (int option * thm) |
87 -> (string * locality) * (int option * thm) |
88 val untranslated_fact : prover_fact -> (string * locality) * thm |
88 val untranslated_fact : prover_fact -> (string * locality) * thm |
89 val smt_weighted_fact : |
89 val smt_weighted_fact : |
90 theory -> int -> prover_fact * int |
90 theory -> int -> prover_fact * int |
91 -> (string * locality) * (int option * thm) |
91 -> (string * locality) * (int option * thm) |
92 val available_provers : Proof.context -> unit |
92 val supported_provers : Proof.context -> unit |
93 val kill_provers : unit -> unit |
93 val kill_provers : unit -> unit |
94 val running_provers : unit -> unit |
94 val running_provers : unit -> unit |
95 val messages : int option -> unit |
95 val messages : int option -> unit |
96 val get_prover : Proof.context -> bool -> string -> prover |
96 val get_prover : Proof.context -> bool -> string -> prover |
97 val setup : theory -> theory |
97 val setup : theory -> theory |
119 Context.proof_map o SMT_Config.select_solver |
119 Context.proof_map o SMT_Config.select_solver |
120 |
120 |
121 fun is_smt_prover ctxt name = |
121 fun is_smt_prover ctxt name = |
122 member (op =) (SMT_Solver.available_solvers_of ctxt) name |
122 member (op =) (SMT_Solver.available_solvers_of ctxt) name |
123 |
123 |
124 fun is_prover_available ctxt name = |
124 fun is_prover_supported ctxt name = |
125 let val thy = ProofContext.theory_of ctxt in |
125 let val thy = ProofContext.theory_of ctxt in |
126 is_smt_prover ctxt name orelse member (op =) (available_atps thy) name |
126 is_smt_prover ctxt name orelse member (op =) (supported_atps thy) name |
127 end |
127 end |
128 |
128 |
129 fun is_prover_installed ctxt = |
129 fun is_prover_installed ctxt = |
130 is_smt_prover ctxt orf is_atp_installed (ProofContext.theory_of ctxt) |
130 is_smt_prover ctxt orf is_atp_installed (ProofContext.theory_of ctxt) |
131 |
|
132 fun available_smt_solvers ctxt = SMT_Solver.available_solvers_of ctxt |
|
133 |
131 |
134 fun default_max_relevant_for_prover ctxt name = |
132 fun default_max_relevant_for_prover ctxt name = |
135 let val thy = ProofContext.theory_of ctxt in |
133 let val thy = ProofContext.theory_of ctxt in |
136 if is_smt_prover ctxt name then |
134 if is_smt_prover ctxt name then |
137 SMT_Solver.default_max_relevant ctxt name |
135 SMT_Solver.default_max_relevant ctxt name |
203 ridiculous_threshold = #ridiculous_threshold atp_relevance_fudge} |
201 ridiculous_threshold = #ridiculous_threshold atp_relevance_fudge} |
204 |
202 |
205 fun relevance_fudge_for_prover ctxt name = |
203 fun relevance_fudge_for_prover ctxt name = |
206 if is_smt_prover ctxt name then smt_relevance_fudge else atp_relevance_fudge |
204 if is_smt_prover ctxt name then smt_relevance_fudge else atp_relevance_fudge |
207 |
205 |
208 fun available_provers ctxt = |
206 fun supported_provers ctxt = |
209 let |
207 let |
210 val thy = ProofContext.theory_of ctxt |
208 val thy = ProofContext.theory_of ctxt |
211 val (remote_provers, local_provers) = |
209 val (remote_provers, local_provers) = |
212 sort_strings (available_atps thy) @ |
210 sort_strings (supported_atps thy) @ |
213 sort_strings (available_smt_solvers ctxt) |
211 sort_strings (SMT_Solver.available_solvers_of ctxt) |
214 |> List.partition (String.isPrefix remote_prefix) |
212 |> List.partition (String.isPrefix remote_prefix) |
215 in |
213 in |
216 Output.urgent_message ("Available provers: " ^ |
214 Output.urgent_message ("Supported provers: " ^ |
217 commas (local_provers @ remote_provers) ^ ".") |
215 commas (local_provers @ remote_provers) ^ ".") |
218 end |
216 end |
219 |
217 |
220 fun kill_provers () = Async_Manager.kill_threads das_Tool "provers" |
218 fun kill_provers () = Async_Manager.kill_threads das_Tool "provers" |
221 fun running_provers () = Async_Manager.running_threads das_Tool "provers" |
219 fun running_provers () = Async_Manager.running_threads das_Tool "provers" |
670 |
668 |
671 fun get_prover ctxt auto name = |
669 fun get_prover ctxt auto name = |
672 let val thy = ProofContext.theory_of ctxt in |
670 let val thy = ProofContext.theory_of ctxt in |
673 if is_smt_prover ctxt name then |
671 if is_smt_prover ctxt name then |
674 run_smt_solver auto name |
672 run_smt_solver auto name |
675 else if member (op =) (available_atps thy) name then |
673 else if member (op =) (supported_atps thy) name then |
676 run_atp auto name (get_atp thy name) |
674 run_atp auto name (get_atp thy name) |
677 else |
675 else |
678 error ("No such prover: " ^ name ^ ".") |
676 error ("No such prover: " ^ name ^ ".") |
679 end |
677 end |
680 |
678 |