| author | desharna |
| Wed, 18 Nov 2020 13:44:34 +0100 | |
| changeset 72641 | 4eea17b3ac58 |
| parent 72482 | 11f645d25498 |
| child 72667 | b83988b436dc |
| permissions | -rw-r--r-- |
| 58061 | 1 |
(* Title: HOL/Tools/SMT/smt_systems.ML |
|
56078
624faeda77b5
moved 'SMT2' (SMT-LIB-2-based SMT module) into Isabelle
blanchet
parents:
diff
changeset
|
2 |
Author: Sascha Boehme, TU Muenchen |
|
624faeda77b5
moved 'SMT2' (SMT-LIB-2-based SMT module) into Isabelle
blanchet
parents:
diff
changeset
|
3 |
|
|
624faeda77b5
moved 'SMT2' (SMT-LIB-2-based SMT module) into Isabelle
blanchet
parents:
diff
changeset
|
4 |
Setup SMT solvers. |
|
624faeda77b5
moved 'SMT2' (SMT-LIB-2-based SMT module) into Isabelle
blanchet
parents:
diff
changeset
|
5 |
*) |
|
624faeda77b5
moved 'SMT2' (SMT-LIB-2-based SMT module) into Isabelle
blanchet
parents:
diff
changeset
|
6 |
|
| 58061 | 7 |
signature SMT_SYSTEMS = |
|
56078
624faeda77b5
moved 'SMT2' (SMT-LIB-2-based SMT module) into Isabelle
blanchet
parents:
diff
changeset
|
8 |
sig |
|
59960
372ddff01244
updated SMT module and Sledgehammer to fully open source Z3
blanchet
parents:
59035
diff
changeset
|
9 |
val cvc4_extensions: bool Config.T |
|
56078
624faeda77b5
moved 'SMT2' (SMT-LIB-2-based SMT module) into Isabelle
blanchet
parents:
diff
changeset
|
10 |
val z3_extensions: bool Config.T |
| 57229 | 11 |
end; |
|
56078
624faeda77b5
moved 'SMT2' (SMT-LIB-2-based SMT module) into Isabelle
blanchet
parents:
diff
changeset
|
12 |
|
| 58061 | 13 |
structure SMT_Systems: SMT_SYSTEMS = |
|
56078
624faeda77b5
moved 'SMT2' (SMT-LIB-2-based SMT module) into Isabelle
blanchet
parents:
diff
changeset
|
14 |
struct |
|
624faeda77b5
moved 'SMT2' (SMT-LIB-2-based SMT module) into Isabelle
blanchet
parents:
diff
changeset
|
15 |
|
|
624faeda77b5
moved 'SMT2' (SMT-LIB-2-based SMT module) into Isabelle
blanchet
parents:
diff
changeset
|
16 |
(* helper functions *) |
|
624faeda77b5
moved 'SMT2' (SMT-LIB-2-based SMT module) into Isabelle
blanchet
parents:
diff
changeset
|
17 |
|
|
72478
b452242dce36
proper Isabelle component settings: prefer standard terminology "ISABELLE_VERIT", avoid conflict of "VERIT_VERSION" with processing of implicit options by veriT;
wenzelm
parents:
72458
diff
changeset
|
18 |
fun check_tool var () = |
|
b452242dce36
proper Isabelle component settings: prefer standard terminology "ISABELLE_VERIT", avoid conflict of "VERIT_VERSION" with processing of implicit options by veriT;
wenzelm
parents:
72458
diff
changeset
|
19 |
(case getenv var of |
|
b452242dce36
proper Isabelle component settings: prefer standard terminology "ISABELLE_VERIT", avoid conflict of "VERIT_VERSION" with processing of implicit options by veriT;
wenzelm
parents:
72458
diff
changeset
|
20 |
"" => NONE |
| 72479 | 21 |
| s => |
22 |
if File.is_file (Path.variable var |> Path.expand |> Path.platform_exe) |
|
23 |
then SOME [s] else NONE); |
|
|
72478
b452242dce36
proper Isabelle component settings: prefer standard terminology "ISABELLE_VERIT", avoid conflict of "VERIT_VERSION" with processing of implicit options by veriT;
wenzelm
parents:
72458
diff
changeset
|
24 |
|
|
56078
624faeda77b5
moved 'SMT2' (SMT-LIB-2-based SMT module) into Isabelle
blanchet
parents:
diff
changeset
|
25 |
fun make_avail name () = getenv (name ^ "_SOLVER") <> "" |
|
624faeda77b5
moved 'SMT2' (SMT-LIB-2-based SMT module) into Isabelle
blanchet
parents:
diff
changeset
|
26 |
|
|
624faeda77b5
moved 'SMT2' (SMT-LIB-2-based SMT module) into Isabelle
blanchet
parents:
diff
changeset
|
27 |
fun make_command name () = [getenv (name ^ "_SOLVER")] |
|
624faeda77b5
moved 'SMT2' (SMT-LIB-2-based SMT module) into Isabelle
blanchet
parents:
diff
changeset
|
28 |
|
|
70327
c04d4951a155
handle timeouts gracefully in 'smt' proof method (patch due to Mathias Fleury)
blanchet
parents:
69593
diff
changeset
|
29 |
fun outcome_of unsat sat unknown timeout solver_name line = |
| 58061 | 30 |
if String.isPrefix unsat line then SMT_Solver.Unsat |
31 |
else if String.isPrefix sat line then SMT_Solver.Sat |
|
32 |
else if String.isPrefix unknown line then SMT_Solver.Unknown |
|
|
70327
c04d4951a155
handle timeouts gracefully in 'smt' proof method (patch due to Mathias Fleury)
blanchet
parents:
69593
diff
changeset
|
33 |
else if String.isPrefix timeout line then SMT_Solver.Time_Out |
| 58061 | 34 |
else raise SMT_Failure.SMT (SMT_Failure.Other_Failure ("Solver " ^ quote solver_name ^
|
35 |
" failed -- enable tracing using the " ^ quote (Config.name_of SMT_Config.trace) ^ |
|
| 56094 | 36 |
" option for details")) |
|
56078
624faeda77b5
moved 'SMT2' (SMT-LIB-2-based SMT module) into Isabelle
blanchet
parents:
diff
changeset
|
37 |
|
| 60201 | 38 |
fun is_blank_or_error_line "" = true |
39 |
| is_blank_or_error_line s = String.isPrefix "(error " s |
|
40 |
||
| 57239 | 41 |
fun on_first_line test_outcome solver_name lines = |
|
56078
624faeda77b5
moved 'SMT2' (SMT-LIB-2-based SMT module) into Isabelle
blanchet
parents:
diff
changeset
|
42 |
let |
|
624faeda77b5
moved 'SMT2' (SMT-LIB-2-based SMT module) into Isabelle
blanchet
parents:
diff
changeset
|
43 |
val split_first = (fn [] => ("", []) | l :: ls => (l, ls))
|
| 67522 | 44 |
val (l, ls) = split_first (drop_prefix is_blank_or_error_line lines) |
|
56078
624faeda77b5
moved 'SMT2' (SMT-LIB-2-based SMT module) into Isabelle
blanchet
parents:
diff
changeset
|
45 |
in (test_outcome solver_name l, ls) end |
|
624faeda77b5
moved 'SMT2' (SMT-LIB-2-based SMT module) into Isabelle
blanchet
parents:
diff
changeset
|
46 |
|
| 57704 | 47 |
fun on_first_non_unsupported_line test_outcome solver_name lines = |
|
67405
e9ab4ad7bd15
uniform use of Standard ML op-infix -- eliminated warnings;
wenzelm
parents:
67399
diff
changeset
|
48 |
on_first_line test_outcome solver_name (filter (curry (op <>) "unsupported") lines) |
|
56078
624faeda77b5
moved 'SMT2' (SMT-LIB-2-based SMT module) into Isabelle
blanchet
parents:
diff
changeset
|
49 |
|
|
624faeda77b5
moved 'SMT2' (SMT-LIB-2-based SMT module) into Isabelle
blanchet
parents:
diff
changeset
|
50 |
(* CVC3 *) |
|
624faeda77b5
moved 'SMT2' (SMT-LIB-2-based SMT module) into Isabelle
blanchet
parents:
diff
changeset
|
51 |
|
|
624faeda77b5
moved 'SMT2' (SMT-LIB-2-based SMT module) into Isabelle
blanchet
parents:
diff
changeset
|
52 |
local |
|
624faeda77b5
moved 'SMT2' (SMT-LIB-2-based SMT module) into Isabelle
blanchet
parents:
diff
changeset
|
53 |
fun cvc3_options ctxt = [ |
| 58061 | 54 |
"-seed", string_of_int (Config.get ctxt SMT_Config.random_seed), |
| 57239 | 55 |
"-lang", "smt2", |
| 58061 | 56 |
"-timeout", string_of_int (Real.ceil (Config.get ctxt SMT_Config.timeout))] |
|
56078
624faeda77b5
moved 'SMT2' (SMT-LIB-2-based SMT module) into Isabelle
blanchet
parents:
diff
changeset
|
57 |
in |
|
624faeda77b5
moved 'SMT2' (SMT-LIB-2-based SMT module) into Isabelle
blanchet
parents:
diff
changeset
|
58 |
|
| 58061 | 59 |
val cvc3: SMT_Solver.solver_config = {
|
|
57209
7ffa0f7e2775
removed '_new' sufffix in SMT2 solver names (in some cases)
blanchet
parents:
57168
diff
changeset
|
60 |
name = "cvc3", |
| 58061 | 61 |
class = K SMTLIB_Interface.smtlibC, |
|
57210
5d61d875076a
rationalized CVC3 and Yices environment variable -- no need (unlike for Z3) to distinguish between old and new versions
blanchet
parents:
57209
diff
changeset
|
62 |
avail = make_avail "CVC3", |
|
5d61d875076a
rationalized CVC3 and Yices environment variable -- no need (unlike for Z3) to distinguish between old and new versions
blanchet
parents:
57209
diff
changeset
|
63 |
command = make_command "CVC3", |
|
56078
624faeda77b5
moved 'SMT2' (SMT-LIB-2-based SMT module) into Isabelle
blanchet
parents:
diff
changeset
|
64 |
options = cvc3_options, |
| 57239 | 65 |
smt_options = [], |
|
56078
624faeda77b5
moved 'SMT2' (SMT-LIB-2-based SMT module) into Isabelle
blanchet
parents:
diff
changeset
|
66 |
default_max_relevant = 400 (* FUDGE *), |
|
70327
c04d4951a155
handle timeouts gracefully in 'smt' proof method (patch due to Mathias Fleury)
blanchet
parents:
69593
diff
changeset
|
67 |
outcome = on_first_line (outcome_of "unsat" "sat" "unknown" "timeout"), |
| 57157 | 68 |
parse_proof = NONE, |
|
56078
624faeda77b5
moved 'SMT2' (SMT-LIB-2-based SMT module) into Isabelle
blanchet
parents:
diff
changeset
|
69 |
replay = NONE } |
|
624faeda77b5
moved 'SMT2' (SMT-LIB-2-based SMT module) into Isabelle
blanchet
parents:
diff
changeset
|
70 |
|
|
624faeda77b5
moved 'SMT2' (SMT-LIB-2-based SMT module) into Isabelle
blanchet
parents:
diff
changeset
|
71 |
end |
|
624faeda77b5
moved 'SMT2' (SMT-LIB-2-based SMT module) into Isabelle
blanchet
parents:
diff
changeset
|
72 |
|
| 66551 | 73 |
|
| 57240 | 74 |
(* CVC4 *) |
75 |
||
| 69593 | 76 |
val cvc4_extensions = Attrib.setup_config_bool \<^binding>\<open>cvc4_extensions\<close> (K false) |
| 58360 | 77 |
|
| 57240 | 78 |
local |
79 |
fun cvc4_options ctxt = [ |
|
|
64461
be149db8207a
disable CVC4 statistics, and hence crashes upon user interruptions
blanchet
parents:
63102
diff
changeset
|
80 |
"--no-statistics", |
| 58061 | 81 |
"--random-seed=" ^ string_of_int (Config.get ctxt SMT_Config.random_seed), |
| 57240 | 82 |
"--lang=smt2", |
| 60201 | 83 |
"--continued-execution", |
| 58061 | 84 |
"--tlimit", string_of_int (Real.ceil (1000.0 * Config.get ctxt SMT_Config.timeout))] |
| 58360 | 85 |
|
86 |
fun select_class ctxt = |
|
| 66551 | 87 |
if Config.get ctxt cvc4_extensions then |
88 |
if Config.get ctxt SMT_Config.higher_order then |
|
89 |
CVC4_Interface.hosmtlib_cvc4C |
|
90 |
else |
|
91 |
CVC4_Interface.smtlib_cvc4C |
|
92 |
else |
|
93 |
if Config.get ctxt SMT_Config.higher_order then |
|
94 |
SMTLIB_Interface.hosmtlibC |
|
95 |
else |
|
96 |
SMTLIB_Interface.smtlibC |
|
| 57240 | 97 |
in |
98 |
||
| 58061 | 99 |
val cvc4: SMT_Solver.solver_config = {
|
| 57240 | 100 |
name = "cvc4", |
| 58360 | 101 |
class = select_class, |
| 57240 | 102 |
avail = make_avail "CVC4", |
103 |
command = make_command "CVC4", |
|
104 |
options = cvc4_options, |
|
| 59015 | 105 |
smt_options = [(":produce-unsat-cores", "true")],
|
| 57240 | 106 |
default_max_relevant = 400 (* FUDGE *), |
|
70327
c04d4951a155
handle timeouts gracefully in 'smt' proof method (patch due to Mathias Fleury)
blanchet
parents:
69593
diff
changeset
|
107 |
outcome = on_first_line (outcome_of "unsat" "sat" "unknown" "timeout"), |
| 59015 | 108 |
parse_proof = SOME (K CVC4_Proof_Parse.parse_proof), |
| 57240 | 109 |
replay = NONE } |
110 |
||
111 |
end |
|
112 |
||
| 66551 | 113 |
|
| 57704 | 114 |
(* veriT *) |
115 |
||
| 66551 | 116 |
local |
117 |
fun select_class ctxt = |
|
118 |
if Config.get ctxt SMT_Config.higher_order then |
|
119 |
SMTLIB_Interface.hosmtlibC |
|
120 |
else |
|
121 |
SMTLIB_Interface.smtlibC |
|
122 |
in |
|
123 |
||
| 58061 | 124 |
val veriT: SMT_Solver.solver_config = {
|
|
59035
3a2153676705
renamed 'veriT' to 'verit', to stick to all-lowercase rule for prover names
blanchet
parents:
59015
diff
changeset
|
125 |
name = "verit", |
| 66551 | 126 |
class = select_class, |
|
72478
b452242dce36
proper Isabelle component settings: prefer standard terminology "ISABELLE_VERIT", avoid conflict of "VERIT_VERSION" with processing of implicit options by veriT;
wenzelm
parents:
72458
diff
changeset
|
127 |
avail = is_some o check_tool "ISABELLE_VERIT", |
|
b452242dce36
proper Isabelle component settings: prefer standard terminology "ISABELLE_VERIT", avoid conflict of "VERIT_VERSION" with processing of implicit options by veriT;
wenzelm
parents:
72458
diff
changeset
|
128 |
command = the o check_tool "ISABELLE_VERIT", |
| 57704 | 129 |
options = (fn ctxt => [ |
|
72458
b44e894796d5
add reconstruction for the SMT solver veriT
Mathias Fleury <Mathias.Fleury@mpi-inf.mpg.de>
parents:
70327
diff
changeset
|
130 |
"--proof-with-sharing", |
|
b44e894796d5
add reconstruction for the SMT solver veriT
Mathias Fleury <Mathias.Fleury@mpi-inf.mpg.de>
parents:
70327
diff
changeset
|
131 |
"--proof-define-skolems", |
| 57704 | 132 |
"--proof-prune", |
133 |
"--proof-merge", |
|
134 |
"--disable-print-success", |
|
|
72482
11f645d25498
remove unsupported max-time option from veriT calls
Mathias Fleury <Mathias.Fleury@mpi-inf.mpg.de>
parents:
72479
diff
changeset
|
135 |
"--disable-banner"] @ |
|
72458
b44e894796d5
add reconstruction for the SMT solver veriT
Mathias Fleury <Mathias.Fleury@mpi-inf.mpg.de>
parents:
70327
diff
changeset
|
136 |
Verit_Proof.veriT_current_strategy (Context.Proof ctxt)), |
|
61587
c3974cd2d381
updating options to verit
fleury <Mathias.Fleury@mpi-inf.mpg.de>
parents:
60201
diff
changeset
|
137 |
smt_options = [(":produce-proofs", "true")],
|
|
58496
2ba52ecc4996
give more facts to veriT -- it seems to be able to cope with them
blanchet
parents:
58491
diff
changeset
|
138 |
default_max_relevant = 200 (* FUDGE *), |
|
70327
c04d4951a155
handle timeouts gracefully in 'smt' proof method (patch due to Mathias Fleury)
blanchet
parents:
69593
diff
changeset
|
139 |
outcome = on_first_non_unsupported_line (outcome_of "unsat" "sat" "unknown" "timeout"), |
| 58491 | 140 |
parse_proof = SOME (K VeriT_Proof_Parse.parse_proof), |
|
69205
8050734eee3e
add reconstruction by veriT in method smt
fleury <Mathias.Fleury@mpi-inf.mpg.de>
parents:
67522
diff
changeset
|
141 |
replay = SOME Verit_Replay.replay } |
| 57240 | 142 |
|
| 66551 | 143 |
end |
144 |
||
145 |
||
|
56078
624faeda77b5
moved 'SMT2' (SMT-LIB-2-based SMT module) into Isabelle
blanchet
parents:
diff
changeset
|
146 |
(* Z3 *) |
|
624faeda77b5
moved 'SMT2' (SMT-LIB-2-based SMT module) into Isabelle
blanchet
parents:
diff
changeset
|
147 |
|
| 69593 | 148 |
val z3_extensions = Attrib.setup_config_bool \<^binding>\<open>z3_extensions\<close> (K false) |
|
56078
624faeda77b5
moved 'SMT2' (SMT-LIB-2-based SMT module) into Isabelle
blanchet
parents:
diff
changeset
|
149 |
|
|
624faeda77b5
moved 'SMT2' (SMT-LIB-2-based SMT module) into Isabelle
blanchet
parents:
diff
changeset
|
150 |
local |
|
624faeda77b5
moved 'SMT2' (SMT-LIB-2-based SMT module) into Isabelle
blanchet
parents:
diff
changeset
|
151 |
fun z3_options ctxt = |
| 58061 | 152 |
["smt.random_seed=" ^ string_of_int (Config.get ctxt SMT_Config.random_seed), |
| 57168 | 153 |
"smt.refine_inj_axioms=false", |
| 58061 | 154 |
"-T:" ^ string_of_int (Real.ceil (Config.get ctxt SMT_Config.timeout)), |
|
56078
624faeda77b5
moved 'SMT2' (SMT-LIB-2-based SMT module) into Isabelle
blanchet
parents:
diff
changeset
|
155 |
"-smt2"] |
|
624faeda77b5
moved 'SMT2' (SMT-LIB-2-based SMT module) into Isabelle
blanchet
parents:
diff
changeset
|
156 |
|
|
624faeda77b5
moved 'SMT2' (SMT-LIB-2-based SMT module) into Isabelle
blanchet
parents:
diff
changeset
|
157 |
fun select_class ctxt = |
| 58061 | 158 |
if Config.get ctxt z3_extensions then Z3_Interface.smtlib_z3C else SMTLIB_Interface.smtlibC |
|
56078
624faeda77b5
moved 'SMT2' (SMT-LIB-2-based SMT module) into Isabelle
blanchet
parents:
diff
changeset
|
159 |
in |
|
624faeda77b5
moved 'SMT2' (SMT-LIB-2-based SMT module) into Isabelle
blanchet
parents:
diff
changeset
|
160 |
|
| 58061 | 161 |
val z3: SMT_Solver.solver_config = {
|
|
57209
7ffa0f7e2775
removed '_new' sufffix in SMT2 solver names (in some cases)
blanchet
parents:
57168
diff
changeset
|
162 |
name = "z3", |
|
56078
624faeda77b5
moved 'SMT2' (SMT-LIB-2-based SMT module) into Isabelle
blanchet
parents:
diff
changeset
|
163 |
class = select_class, |
|
59960
372ddff01244
updated SMT module and Sledgehammer to fully open source Z3
blanchet
parents:
59035
diff
changeset
|
164 |
avail = make_avail "Z3", |
|
372ddff01244
updated SMT module and Sledgehammer to fully open source Z3
blanchet
parents:
59035
diff
changeset
|
165 |
command = make_command "Z3", |
|
56078
624faeda77b5
moved 'SMT2' (SMT-LIB-2-based SMT module) into Isabelle
blanchet
parents:
diff
changeset
|
166 |
options = z3_options, |
| 57239 | 167 |
smt_options = [(":produce-proofs", "true")],
|
|
56078
624faeda77b5
moved 'SMT2' (SMT-LIB-2-based SMT module) into Isabelle
blanchet
parents:
diff
changeset
|
168 |
default_max_relevant = 350 (* FUDGE *), |
|
70327
c04d4951a155
handle timeouts gracefully in 'smt' proof method (patch due to Mathias Fleury)
blanchet
parents:
69593
diff
changeset
|
169 |
outcome = on_first_line (outcome_of "unsat" "sat" "unknown" "timeout"), |
| 58061 | 170 |
parse_proof = SOME Z3_Replay.parse_proof, |
171 |
replay = SOME Z3_Replay.replay } |
|
|
56078
624faeda77b5
moved 'SMT2' (SMT-LIB-2-based SMT module) into Isabelle
blanchet
parents:
diff
changeset
|
172 |
|
|
624faeda77b5
moved 'SMT2' (SMT-LIB-2-based SMT module) into Isabelle
blanchet
parents:
diff
changeset
|
173 |
end |
|
624faeda77b5
moved 'SMT2' (SMT-LIB-2-based SMT module) into Isabelle
blanchet
parents:
diff
changeset
|
174 |
|
|
72458
b44e894796d5
add reconstruction for the SMT solver veriT
Mathias Fleury <Mathias.Fleury@mpi-inf.mpg.de>
parents:
70327
diff
changeset
|
175 |
(* smt tactic *) |
|
b44e894796d5
add reconstruction for the SMT solver veriT
Mathias Fleury <Mathias.Fleury@mpi-inf.mpg.de>
parents:
70327
diff
changeset
|
176 |
val parse_smt_options = |
|
b44e894796d5
add reconstruction for the SMT solver veriT
Mathias Fleury <Mathias.Fleury@mpi-inf.mpg.de>
parents:
70327
diff
changeset
|
177 |
Scan.optional |
|
b44e894796d5
add reconstruction for the SMT solver veriT
Mathias Fleury <Mathias.Fleury@mpi-inf.mpg.de>
parents:
70327
diff
changeset
|
178 |
(Args.parens (Args.name -- Scan.option (\<^keyword>\<open>,\<close> |-- Args.name)) >> apfst SOME) |
|
b44e894796d5
add reconstruction for the SMT solver veriT
Mathias Fleury <Mathias.Fleury@mpi-inf.mpg.de>
parents:
70327
diff
changeset
|
179 |
(NONE, NONE) |
|
b44e894796d5
add reconstruction for the SMT solver veriT
Mathias Fleury <Mathias.Fleury@mpi-inf.mpg.de>
parents:
70327
diff
changeset
|
180 |
|
|
b44e894796d5
add reconstruction for the SMT solver veriT
Mathias Fleury <Mathias.Fleury@mpi-inf.mpg.de>
parents:
70327
diff
changeset
|
181 |
fun smt_method ((solver, stgy), thms) ctxt facts = |
|
b44e894796d5
add reconstruction for the SMT solver veriT
Mathias Fleury <Mathias.Fleury@mpi-inf.mpg.de>
parents:
70327
diff
changeset
|
182 |
let |
|
b44e894796d5
add reconstruction for the SMT solver veriT
Mathias Fleury <Mathias.Fleury@mpi-inf.mpg.de>
parents:
70327
diff
changeset
|
183 |
val default_solver = SMT_Config.solver_of ctxt |
|
b44e894796d5
add reconstruction for the SMT solver veriT
Mathias Fleury <Mathias.Fleury@mpi-inf.mpg.de>
parents:
70327
diff
changeset
|
184 |
val solver = the_default default_solver solver |
|
b44e894796d5
add reconstruction for the SMT solver veriT
Mathias Fleury <Mathias.Fleury@mpi-inf.mpg.de>
parents:
70327
diff
changeset
|
185 |
val _ = |
|
b44e894796d5
add reconstruction for the SMT solver veriT
Mathias Fleury <Mathias.Fleury@mpi-inf.mpg.de>
parents:
70327
diff
changeset
|
186 |
if solver = "z3" andalso stgy <> NONE |
|
b44e894796d5
add reconstruction for the SMT solver veriT
Mathias Fleury <Mathias.Fleury@mpi-inf.mpg.de>
parents:
70327
diff
changeset
|
187 |
then warning ("No strategy is available for z3. Ignoring " ^ quote (the stgy))
|
|
b44e894796d5
add reconstruction for the SMT solver veriT
Mathias Fleury <Mathias.Fleury@mpi-inf.mpg.de>
parents:
70327
diff
changeset
|
188 |
else () |
|
b44e894796d5
add reconstruction for the SMT solver veriT
Mathias Fleury <Mathias.Fleury@mpi-inf.mpg.de>
parents:
70327
diff
changeset
|
189 |
val ctxt = |
|
b44e894796d5
add reconstruction for the SMT solver veriT
Mathias Fleury <Mathias.Fleury@mpi-inf.mpg.de>
parents:
70327
diff
changeset
|
190 |
ctxt |
|
b44e894796d5
add reconstruction for the SMT solver veriT
Mathias Fleury <Mathias.Fleury@mpi-inf.mpg.de>
parents:
70327
diff
changeset
|
191 |
|> (if stgy <> NONE then Context.proof_map (Verit_Proof.select_veriT_stgy (the stgy)) else I) |
|
b44e894796d5
add reconstruction for the SMT solver veriT
Mathias Fleury <Mathias.Fleury@mpi-inf.mpg.de>
parents:
70327
diff
changeset
|
192 |
|> Context.Proof |
|
b44e894796d5
add reconstruction for the SMT solver veriT
Mathias Fleury <Mathias.Fleury@mpi-inf.mpg.de>
parents:
70327
diff
changeset
|
193 |
|> SMT_Config.select_solver solver |
|
b44e894796d5
add reconstruction for the SMT solver veriT
Mathias Fleury <Mathias.Fleury@mpi-inf.mpg.de>
parents:
70327
diff
changeset
|
194 |
|> Context.proof_of |
|
b44e894796d5
add reconstruction for the SMT solver veriT
Mathias Fleury <Mathias.Fleury@mpi-inf.mpg.de>
parents:
70327
diff
changeset
|
195 |
in |
|
b44e894796d5
add reconstruction for the SMT solver veriT
Mathias Fleury <Mathias.Fleury@mpi-inf.mpg.de>
parents:
70327
diff
changeset
|
196 |
HEADGOAL (SOLVED' (SMT_Solver.smt_tac ctxt (thms @ facts))) |
|
b44e894796d5
add reconstruction for the SMT solver veriT
Mathias Fleury <Mathias.Fleury@mpi-inf.mpg.de>
parents:
70327
diff
changeset
|
197 |
end |
|
b44e894796d5
add reconstruction for the SMT solver veriT
Mathias Fleury <Mathias.Fleury@mpi-inf.mpg.de>
parents:
70327
diff
changeset
|
198 |
|
|
b44e894796d5
add reconstruction for the SMT solver veriT
Mathias Fleury <Mathias.Fleury@mpi-inf.mpg.de>
parents:
70327
diff
changeset
|
199 |
val _ = |
|
b44e894796d5
add reconstruction for the SMT solver veriT
Mathias Fleury <Mathias.Fleury@mpi-inf.mpg.de>
parents:
70327
diff
changeset
|
200 |
Theory.setup |
|
b44e894796d5
add reconstruction for the SMT solver veriT
Mathias Fleury <Mathias.Fleury@mpi-inf.mpg.de>
parents:
70327
diff
changeset
|
201 |
(Method.setup \<^binding>\<open>smt\<close> |
|
b44e894796d5
add reconstruction for the SMT solver veriT
Mathias Fleury <Mathias.Fleury@mpi-inf.mpg.de>
parents:
70327
diff
changeset
|
202 |
(Scan.lift parse_smt_options -- Attrib.thms >> (METHOD oo smt_method)) |
|
b44e894796d5
add reconstruction for the SMT solver veriT
Mathias Fleury <Mathias.Fleury@mpi-inf.mpg.de>
parents:
70327
diff
changeset
|
203 |
"Call to the SMT solvers veriT or z3") |
|
56078
624faeda77b5
moved 'SMT2' (SMT-LIB-2-based SMT module) into Isabelle
blanchet
parents:
diff
changeset
|
204 |
|
|
624faeda77b5
moved 'SMT2' (SMT-LIB-2-based SMT module) into Isabelle
blanchet
parents:
diff
changeset
|
205 |
(* overall setup *) |
|
624faeda77b5
moved 'SMT2' (SMT-LIB-2-based SMT module) into Isabelle
blanchet
parents:
diff
changeset
|
206 |
|
|
624faeda77b5
moved 'SMT2' (SMT-LIB-2-based SMT module) into Isabelle
blanchet
parents:
diff
changeset
|
207 |
val _ = Theory.setup ( |
| 58061 | 208 |
SMT_Solver.add_solver cvc3 #> |
209 |
SMT_Solver.add_solver cvc4 #> |
|
210 |
SMT_Solver.add_solver veriT #> |
|
211 |
SMT_Solver.add_solver z3) |
|
|
56078
624faeda77b5
moved 'SMT2' (SMT-LIB-2-based SMT module) into Isabelle
blanchet
parents:
diff
changeset
|
212 |
|
| 57229 | 213 |
end; |