author | boehmes |
Mon, 09 Nov 2009 08:57:07 +0100 | |
changeset 33528 | b34511bbc121 |
parent 33521 | a4c54218be62 |
child 33530 | 535789c26230 |
permissions | -rw-r--r-- |
32618
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
1 |
(* Title: HOL/SMT/Tools/smt_solver.ML |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
2 |
Author: Sascha Boehme, TU Muenchen |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
3 |
|
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
4 |
SMT solvers registry and SMT tactic. |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
5 |
*) |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
6 |
|
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
7 |
signature SMT_SOLVER = |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
8 |
sig |
33418
1312e8337ce5
added a specific SMT exception captured by smt_tac (prevents the SMT method from failing with an exception),
boehmes
parents:
33299
diff
changeset
|
9 |
exception SMT of string |
32618
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
10 |
exception SMT_COUNTEREXAMPLE of bool * term list |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
11 |
|
33017
4fb8a33f74d6
eliminated extraneous wrapping of public records,
boehmes
parents:
33010
diff
changeset
|
12 |
type interface = { |
32618
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
13 |
normalize: SMT_Normalize.config list, |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
14 |
translate: SMT_Translate.config } |
33017
4fb8a33f74d6
eliminated extraneous wrapping of public records,
boehmes
parents:
33010
diff
changeset
|
15 |
type proof_data = { |
32618
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
16 |
context: Proof.context, |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
17 |
output: string list, |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
18 |
recon: SMT_Translate.recon, |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
19 |
assms: thm list option } |
33017
4fb8a33f74d6
eliminated extraneous wrapping of public records,
boehmes
parents:
33010
diff
changeset
|
20 |
type solver_config = { |
33472
e88f67d679c4
added documentation for local SMT solver setup and available SMT options,
boehmes
parents:
33418
diff
changeset
|
21 |
command: {env_var: string, remote_name: string option}, |
33010 | 22 |
arguments: string list, |
32618
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
23 |
interface: interface, |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
24 |
reconstruct: proof_data -> thm } |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
25 |
|
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
26 |
(*options*) |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
27 |
val timeout: int Config.T |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
28 |
val with_timeout: Proof.context -> ('a -> 'b) -> 'a -> 'b |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
29 |
val trace: bool Config.T |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
30 |
val trace_msg: Proof.context -> ('a -> string) -> 'a -> unit |
33010 | 31 |
val keep: string Config.T |
32 |
val cert: string Config.T |
|
32618
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
33 |
|
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
34 |
(*solvers*) |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
35 |
type solver = Proof.context -> thm list -> thm |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
36 |
type solver_info = Context.generic -> Pretty.T list |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
37 |
val add_solver: string * (Proof.context -> solver_config) -> theory -> |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
38 |
theory |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
39 |
val all_solver_names_of: theory -> string list |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
40 |
val add_solver_info: string * solver_info -> theory -> theory |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
41 |
val solver_name_of: Context.generic -> string |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
42 |
val select_solver: string -> Context.generic -> Context.generic |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
43 |
val solver_of: Context.generic -> solver |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
44 |
|
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
45 |
(*tactic*) |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
46 |
val smt_tac': bool -> Proof.context -> thm list -> int -> Tactical.tactic |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
47 |
val smt_tac: Proof.context -> thm list -> int -> Tactical.tactic |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
48 |
|
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
49 |
(*setup*) |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
50 |
val setup: theory -> theory |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
51 |
val print_setup: Context.generic -> unit |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
52 |
end |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
53 |
|
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
54 |
structure SMT_Solver: SMT_SOLVER = |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
55 |
struct |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
56 |
|
33418
1312e8337ce5
added a specific SMT exception captured by smt_tac (prevents the SMT method from failing with an exception),
boehmes
parents:
33299
diff
changeset
|
57 |
exception SMT of string |
32618
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
58 |
exception SMT_COUNTEREXAMPLE of bool * term list |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
59 |
|
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
60 |
|
33017
4fb8a33f74d6
eliminated extraneous wrapping of public records,
boehmes
parents:
33010
diff
changeset
|
61 |
type interface = { |
32618
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
62 |
normalize: SMT_Normalize.config list, |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
63 |
translate: SMT_Translate.config } |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
64 |
|
33017
4fb8a33f74d6
eliminated extraneous wrapping of public records,
boehmes
parents:
33010
diff
changeset
|
65 |
type proof_data = { |
32618
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
66 |
context: Proof.context, |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
67 |
output: string list, |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
68 |
recon: SMT_Translate.recon, |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
69 |
assms: thm list option } |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
70 |
|
33017
4fb8a33f74d6
eliminated extraneous wrapping of public records,
boehmes
parents:
33010
diff
changeset
|
71 |
type solver_config = { |
33472
e88f67d679c4
added documentation for local SMT solver setup and available SMT options,
boehmes
parents:
33418
diff
changeset
|
72 |
command: {env_var: string, remote_name: string option}, |
33010 | 73 |
arguments: string list, |
32618
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
74 |
interface: interface, |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
75 |
reconstruct: proof_data -> thm } |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
76 |
|
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
77 |
|
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
78 |
(* SMT options *) |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
79 |
|
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
80 |
val (timeout, setup_timeout) = Attrib.config_int "smt_timeout" 30 |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
81 |
|
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
82 |
fun with_timeout ctxt f x = |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
83 |
TimeLimit.timeLimit (Time.fromSeconds (Config.get ctxt timeout)) f x |
33418
1312e8337ce5
added a specific SMT exception captured by smt_tac (prevents the SMT method from failing with an exception),
boehmes
parents:
33299
diff
changeset
|
84 |
handle TimeLimit.TimeOut => raise SMT "timeout" |
32618
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
85 |
|
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
86 |
val (trace, setup_trace) = Attrib.config_bool "smt_trace" false |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
87 |
|
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
88 |
fun trace_msg ctxt f x = |
32950 | 89 |
if Config.get ctxt trace then tracing (f x) else () |
32618
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
90 |
|
33010 | 91 |
val (keep, setup_keep) = Attrib.config_string "smt_keep" "" |
92 |
val (cert, setup_cert) = Attrib.config_string "smt_cert" "" |
|
93 |
||
32618
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
94 |
|
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
95 |
(* interface to external solvers *) |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
96 |
|
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
97 |
local |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
98 |
|
33472
e88f67d679c4
added documentation for local SMT solver setup and available SMT options,
boehmes
parents:
33418
diff
changeset
|
99 |
fun with_files ctxt f = |
32618
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
100 |
let |
33010 | 101 |
fun make_names n = (n, n ^ ".proof") |
102 |
||
103 |
val keep' = Config.get ctxt keep |
|
104 |
val paths as (problem_path, proof_path) = |
|
105 |
if keep' <> "" andalso File.exists (Path.dir (Path.explode keep')) |
|
106 |
then pairself Path.explode (make_names keep') |
|
107 |
else pairself (File.tmp_path o Path.explode) |
|
108 |
(make_names ("smt-" ^ serial_string ())) |
|
109 |
||
33472
e88f67d679c4
added documentation for local SMT solver setup and available SMT options,
boehmes
parents:
33418
diff
changeset
|
110 |
val y = Exn.capture f (problem_path, proof_path) |
33010 | 111 |
|
112 |
val _ = if keep' = "" then (pairself (try File.rm) paths; ()) else () |
|
32618
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
113 |
in Exn.release y end |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
114 |
|
33472
e88f67d679c4
added documentation for local SMT solver setup and available SMT options,
boehmes
parents:
33418
diff
changeset
|
115 |
fun invoke ctxt output f (paths as (problem_path, proof_path)) = |
32618
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
116 |
let |
33418
1312e8337ce5
added a specific SMT exception captured by smt_tac (prevents the SMT method from failing with an exception),
boehmes
parents:
33299
diff
changeset
|
117 |
fun pretty tag ls = Pretty.string_of (Pretty.big_list tag |
1312e8337ce5
added a specific SMT exception captured by smt_tac (prevents the SMT method from failing with an exception),
boehmes
parents:
33299
diff
changeset
|
118 |
(map Pretty.str ls)) |
1312e8337ce5
added a specific SMT exception captured by smt_tac (prevents the SMT method from failing with an exception),
boehmes
parents:
33299
diff
changeset
|
119 |
|
33472
e88f67d679c4
added documentation for local SMT solver setup and available SMT options,
boehmes
parents:
33418
diff
changeset
|
120 |
val x = File.open_output output problem_path |
33418
1312e8337ce5
added a specific SMT exception captured by smt_tac (prevents the SMT method from failing with an exception),
boehmes
parents:
33299
diff
changeset
|
121 |
val _ = trace_msg ctxt (pretty "SMT problem:" o split_lines o File.read) |
33472
e88f67d679c4
added documentation for local SMT solver setup and available SMT options,
boehmes
parents:
33418
diff
changeset
|
122 |
problem_path |
32618
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
123 |
|
33472
e88f67d679c4
added documentation for local SMT solver setup and available SMT options,
boehmes
parents:
33418
diff
changeset
|
124 |
val _ = with_timeout ctxt f paths |
e88f67d679c4
added documentation for local SMT solver setup and available SMT options,
boehmes
parents:
33418
diff
changeset
|
125 |
fun lines_of path = the_default [] (try (File.fold_lines cons path) []) |
e88f67d679c4
added documentation for local SMT solver setup and available SMT options,
boehmes
parents:
33418
diff
changeset
|
126 |
val ls = rev (dropwhile (equal "") (lines_of proof_path)) |
33418
1312e8337ce5
added a specific SMT exception captured by smt_tac (prevents the SMT method from failing with an exception),
boehmes
parents:
33299
diff
changeset
|
127 |
val _ = trace_msg ctxt (pretty "SMT result:") ls |
32618
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
128 |
in (x, ls) end |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
129 |
|
33472
e88f67d679c4
added documentation for local SMT solver setup and available SMT options,
boehmes
parents:
33418
diff
changeset
|
130 |
val expand_name = Path.implode o Path.expand o Path.explode |
e88f67d679c4
added documentation for local SMT solver setup and available SMT options,
boehmes
parents:
33418
diff
changeset
|
131 |
|
e88f67d679c4
added documentation for local SMT solver setup and available SMT options,
boehmes
parents:
33418
diff
changeset
|
132 |
fun run_perl name args ps = |
e88f67d679c4
added documentation for local SMT solver setup and available SMT options,
boehmes
parents:
33418
diff
changeset
|
133 |
system_out (space_implode " " ("perl -w" :: |
e88f67d679c4
added documentation for local SMT solver setup and available SMT options,
boehmes
parents:
33418
diff
changeset
|
134 |
File.shell_path (Path.explode (getenv name)) :: |
e88f67d679c4
added documentation for local SMT solver setup and available SMT options,
boehmes
parents:
33418
diff
changeset
|
135 |
map File.shell_quote args @ ps)) |
e88f67d679c4
added documentation for local SMT solver setup and available SMT options,
boehmes
parents:
33418
diff
changeset
|
136 |
|
e88f67d679c4
added documentation for local SMT solver setup and available SMT options,
boehmes
parents:
33418
diff
changeset
|
137 |
fun use_certificate ctxt ps = |
e88f67d679c4
added documentation for local SMT solver setup and available SMT options,
boehmes
parents:
33418
diff
changeset
|
138 |
let val name = Config.get ctxt cert |
e88f67d679c4
added documentation for local SMT solver setup and available SMT options,
boehmes
parents:
33418
diff
changeset
|
139 |
in |
e88f67d679c4
added documentation for local SMT solver setup and available SMT options,
boehmes
parents:
33418
diff
changeset
|
140 |
if name = "" then false |
e88f67d679c4
added documentation for local SMT solver setup and available SMT options,
boehmes
parents:
33418
diff
changeset
|
141 |
else |
e88f67d679c4
added documentation for local SMT solver setup and available SMT options,
boehmes
parents:
33418
diff
changeset
|
142 |
(tracing ("Using certificate " ^ quote (expand_name name) ^ " ..."); |
e88f67d679c4
added documentation for local SMT solver setup and available SMT options,
boehmes
parents:
33418
diff
changeset
|
143 |
run_perl "CERT_SMT_SOLVER" [expand_name name] ps; |
e88f67d679c4
added documentation for local SMT solver setup and available SMT options,
boehmes
parents:
33418
diff
changeset
|
144 |
true) |
e88f67d679c4
added documentation for local SMT solver setup and available SMT options,
boehmes
parents:
33418
diff
changeset
|
145 |
end |
e88f67d679c4
added documentation for local SMT solver setup and available SMT options,
boehmes
parents:
33418
diff
changeset
|
146 |
|
e88f67d679c4
added documentation for local SMT solver setup and available SMT options,
boehmes
parents:
33418
diff
changeset
|
147 |
fun run_locally f ctxt env_var args ps = |
e88f67d679c4
added documentation for local SMT solver setup and available SMT options,
boehmes
parents:
33418
diff
changeset
|
148 |
if getenv env_var = "" |
e88f67d679c4
added documentation for local SMT solver setup and available SMT options,
boehmes
parents:
33418
diff
changeset
|
149 |
then f ("Undefined Isabelle environment variable: " ^ quote env_var) |
e88f67d679c4
added documentation for local SMT solver setup and available SMT options,
boehmes
parents:
33418
diff
changeset
|
150 |
else |
e88f67d679c4
added documentation for local SMT solver setup and available SMT options,
boehmes
parents:
33418
diff
changeset
|
151 |
let val app = Path.expand (Path.explode (getenv env_var)) |
e88f67d679c4
added documentation for local SMT solver setup and available SMT options,
boehmes
parents:
33418
diff
changeset
|
152 |
in |
e88f67d679c4
added documentation for local SMT solver setup and available SMT options,
boehmes
parents:
33418
diff
changeset
|
153 |
if not (File.exists app) |
e88f67d679c4
added documentation for local SMT solver setup and available SMT options,
boehmes
parents:
33418
diff
changeset
|
154 |
then f ("No such file: " ^ quote (Path.implode app)) |
e88f67d679c4
added documentation for local SMT solver setup and available SMT options,
boehmes
parents:
33418
diff
changeset
|
155 |
else |
e88f67d679c4
added documentation for local SMT solver setup and available SMT options,
boehmes
parents:
33418
diff
changeset
|
156 |
(tracing ("Invoking local SMT solver " ^ quote (Path.implode app) ^ |
e88f67d679c4
added documentation for local SMT solver setup and available SMT options,
boehmes
parents:
33418
diff
changeset
|
157 |
" ..."); |
e88f67d679c4
added documentation for local SMT solver setup and available SMT options,
boehmes
parents:
33418
diff
changeset
|
158 |
system_out (space_implode " " (File.shell_path app :: |
e88f67d679c4
added documentation for local SMT solver setup and available SMT options,
boehmes
parents:
33418
diff
changeset
|
159 |
map File.shell_quote args @ ps)); ()) |
e88f67d679c4
added documentation for local SMT solver setup and available SMT options,
boehmes
parents:
33418
diff
changeset
|
160 |
end |
e88f67d679c4
added documentation for local SMT solver setup and available SMT options,
boehmes
parents:
33418
diff
changeset
|
161 |
|
e88f67d679c4
added documentation for local SMT solver setup and available SMT options,
boehmes
parents:
33418
diff
changeset
|
162 |
fun run_remote remote_name args ps msg = |
e88f67d679c4
added documentation for local SMT solver setup and available SMT options,
boehmes
parents:
33418
diff
changeset
|
163 |
(case remote_name of |
e88f67d679c4
added documentation for local SMT solver setup and available SMT options,
boehmes
parents:
33418
diff
changeset
|
164 |
NONE => error msg |
e88f67d679c4
added documentation for local SMT solver setup and available SMT options,
boehmes
parents:
33418
diff
changeset
|
165 |
| SOME name => |
e88f67d679c4
added documentation for local SMT solver setup and available SMT options,
boehmes
parents:
33418
diff
changeset
|
166 |
let |
e88f67d679c4
added documentation for local SMT solver setup and available SMT options,
boehmes
parents:
33418
diff
changeset
|
167 |
val url = getenv "REMOTE_SMT_URL" |
e88f67d679c4
added documentation for local SMT solver setup and available SMT options,
boehmes
parents:
33418
diff
changeset
|
168 |
val _ = tracing ("Invoking remote SMT solver " ^ quote name ^ " at " ^ |
e88f67d679c4
added documentation for local SMT solver setup and available SMT options,
boehmes
parents:
33418
diff
changeset
|
169 |
quote url ^ " ...") |
e88f67d679c4
added documentation for local SMT solver setup and available SMT options,
boehmes
parents:
33418
diff
changeset
|
170 |
in (run_perl "REMOTE_SMT_SOLVER" (url :: name :: args) ps; ()) end) |
e88f67d679c4
added documentation for local SMT solver setup and available SMT options,
boehmes
parents:
33418
diff
changeset
|
171 |
|
e88f67d679c4
added documentation for local SMT solver setup and available SMT options,
boehmes
parents:
33418
diff
changeset
|
172 |
fun run ctxt {env_var, remote_name} args (problem_path, proof_path) = |
e88f67d679c4
added documentation for local SMT solver setup and available SMT options,
boehmes
parents:
33418
diff
changeset
|
173 |
let val ps = [File.shell_path problem_path, ">", File.shell_path proof_path] |
e88f67d679c4
added documentation for local SMT solver setup and available SMT options,
boehmes
parents:
33418
diff
changeset
|
174 |
in |
e88f67d679c4
added documentation for local SMT solver setup and available SMT options,
boehmes
parents:
33418
diff
changeset
|
175 |
if use_certificate ctxt ps then () |
e88f67d679c4
added documentation for local SMT solver setup and available SMT options,
boehmes
parents:
33418
diff
changeset
|
176 |
else run_locally (run_remote remote_name args ps) ctxt env_var args ps |
e88f67d679c4
added documentation for local SMT solver setup and available SMT options,
boehmes
parents:
33418
diff
changeset
|
177 |
end |
e88f67d679c4
added documentation for local SMT solver setup and available SMT options,
boehmes
parents:
33418
diff
changeset
|
178 |
|
32618
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
179 |
in |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
180 |
|
33472
e88f67d679c4
added documentation for local SMT solver setup and available SMT options,
boehmes
parents:
33418
diff
changeset
|
181 |
fun run_solver ctxt cmd args output = |
e88f67d679c4
added documentation for local SMT solver setup and available SMT options,
boehmes
parents:
33418
diff
changeset
|
182 |
with_files ctxt (invoke ctxt output (run ctxt cmd args)) |
32618
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
183 |
|
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
184 |
end |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
185 |
|
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
186 |
fun make_proof_data ctxt ((recon, thms), ls) = |
33017
4fb8a33f74d6
eliminated extraneous wrapping of public records,
boehmes
parents:
33010
diff
changeset
|
187 |
{context=ctxt, output=ls, recon=recon, assms=SOME thms} |
32618
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
188 |
|
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
189 |
fun gen_solver solver ctxt prems = |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
190 |
let |
33017
4fb8a33f74d6
eliminated extraneous wrapping of public records,
boehmes
parents:
33010
diff
changeset
|
191 |
val {command, arguments, interface, reconstruct} = solver ctxt |
4fb8a33f74d6
eliminated extraneous wrapping of public records,
boehmes
parents:
33010
diff
changeset
|
192 |
val {normalize=nc, translate=tc} = interface |
32618
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
193 |
val thy = ProofContext.theory_of ctxt |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
194 |
in |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
195 |
SMT_Normalize.normalize nc ctxt prems |
33010 | 196 |
||> run_solver ctxt command arguments o SMT_Translate.translate tc thy |
32618
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
197 |
||> reconstruct o make_proof_data ctxt |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
198 |
|-> fold SMT_Normalize.discharge_definition |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
199 |
end |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
200 |
|
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
201 |
|
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
202 |
(* solver store *) |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
203 |
|
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
204 |
type solver = Proof.context -> thm list -> thm |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
205 |
type solver_info = Context.generic -> Pretty.T list |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
206 |
|
33521 | 207 |
structure Solvers = Theory_Data |
32618
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
208 |
( |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
209 |
type T = ((Proof.context -> solver_config) * solver_info) Symtab.table |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
210 |
val empty = Symtab.empty |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
211 |
val extend = I |
33521 | 212 |
fun merge data = Symtab.merge (K true) data |
32618
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
213 |
handle Symtab.DUP name => error ("Duplicate SMT solver: " ^ quote name) |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
214 |
) |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
215 |
|
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
216 |
val no_solver = "(none)" |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
217 |
val add_solver = Solvers.map o Symtab.update_new o apsnd (rpair (K [])) |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
218 |
val all_solver_names_of = Symtab.keys o Solvers.get |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
219 |
val lookup_solver = Symtab.lookup o Solvers.get |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
220 |
fun add_solver_info (n, i) = Solvers.map (Symtab.map_entry n (apsnd (K i))) |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
221 |
|
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
222 |
|
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
223 |
(* selected solver *) |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
224 |
|
33528
b34511bbc121
made theory merge deterministic wrt. the selected solver
boehmes
parents:
33521
diff
changeset
|
225 |
structure Selected_Solver = Generic_Data |
32618
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
226 |
( |
33528
b34511bbc121
made theory merge deterministic wrt. the selected solver
boehmes
parents:
33521
diff
changeset
|
227 |
type T = string |
b34511bbc121
made theory merge deterministic wrt. the selected solver
boehmes
parents:
33521
diff
changeset
|
228 |
val empty = no_solver |
32618
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
229 |
val extend = I |
33528
b34511bbc121
made theory merge deterministic wrt. the selected solver
boehmes
parents:
33521
diff
changeset
|
230 |
fun merge (_, s) = s |
32618
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
231 |
) |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
232 |
|
33528
b34511bbc121
made theory merge deterministic wrt. the selected solver
boehmes
parents:
33521
diff
changeset
|
233 |
val solver_name_of = Selected_Solver.get |
32618
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
234 |
|
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
235 |
fun select_solver name gen = |
32627 | 236 |
if is_none (lookup_solver (Context.theory_of gen) name) |
32618
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
237 |
then error ("SMT solver not registered: " ^ quote name) |
33528
b34511bbc121
made theory merge deterministic wrt. the selected solver
boehmes
parents:
33521
diff
changeset
|
238 |
else Selected_Solver.map (K name) gen |
32618
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
239 |
|
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
240 |
fun raw_solver_of gen = |
32627 | 241 |
(case lookup_solver (Context.theory_of gen) (solver_name_of gen) of |
32618
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
242 |
NONE => error "No SMT solver selected" |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
243 |
| SOME (s, _) => s) |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
244 |
|
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
245 |
val solver_of = gen_solver o raw_solver_of |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
246 |
|
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
247 |
|
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
248 |
(* SMT tactic *) |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
249 |
|
33418
1312e8337ce5
added a specific SMT exception captured by smt_tac (prevents the SMT method from failing with an exception),
boehmes
parents:
33299
diff
changeset
|
250 |
local |
1312e8337ce5
added a specific SMT exception captured by smt_tac (prevents the SMT method from failing with an exception),
boehmes
parents:
33299
diff
changeset
|
251 |
fun pretty_cex ctxt (real, ex) = |
1312e8337ce5
added a specific SMT exception captured by smt_tac (prevents the SMT method from failing with an exception),
boehmes
parents:
33299
diff
changeset
|
252 |
let |
1312e8337ce5
added a specific SMT exception captured by smt_tac (prevents the SMT method from failing with an exception),
boehmes
parents:
33299
diff
changeset
|
253 |
val msg = if real then "SMT: counterexample found" |
1312e8337ce5
added a specific SMT exception captured by smt_tac (prevents the SMT method from failing with an exception),
boehmes
parents:
33299
diff
changeset
|
254 |
else "SMT: potential counterexample found" |
1312e8337ce5
added a specific SMT exception captured by smt_tac (prevents the SMT method from failing with an exception),
boehmes
parents:
33299
diff
changeset
|
255 |
in |
1312e8337ce5
added a specific SMT exception captured by smt_tac (prevents the SMT method from failing with an exception),
boehmes
parents:
33299
diff
changeset
|
256 |
if null ex then msg ^ "." |
1312e8337ce5
added a specific SMT exception captured by smt_tac (prevents the SMT method from failing with an exception),
boehmes
parents:
33299
diff
changeset
|
257 |
else Pretty.string_of (Pretty.big_list (msg ^ ":") |
1312e8337ce5
added a specific SMT exception captured by smt_tac (prevents the SMT method from failing with an exception),
boehmes
parents:
33299
diff
changeset
|
258 |
(map (Syntax.pretty_term ctxt) ex)) |
1312e8337ce5
added a specific SMT exception captured by smt_tac (prevents the SMT method from failing with an exception),
boehmes
parents:
33299
diff
changeset
|
259 |
end |
1312e8337ce5
added a specific SMT exception captured by smt_tac (prevents the SMT method from failing with an exception),
boehmes
parents:
33299
diff
changeset
|
260 |
|
33472
e88f67d679c4
added documentation for local SMT solver setup and available SMT options,
boehmes
parents:
33418
diff
changeset
|
261 |
fun fail_tac f msg st = (f msg; Tactical.no_tac st) |
33418
1312e8337ce5
added a specific SMT exception captured by smt_tac (prevents the SMT method from failing with an exception),
boehmes
parents:
33299
diff
changeset
|
262 |
|
1312e8337ce5
added a specific SMT exception captured by smt_tac (prevents the SMT method from failing with an exception),
boehmes
parents:
33299
diff
changeset
|
263 |
fun SAFE pass_exns tac ctxt i st = |
1312e8337ce5
added a specific SMT exception captured by smt_tac (prevents the SMT method from failing with an exception),
boehmes
parents:
33299
diff
changeset
|
264 |
if pass_exns then tac ctxt i st |
1312e8337ce5
added a specific SMT exception captured by smt_tac (prevents the SMT method from failing with an exception),
boehmes
parents:
33299
diff
changeset
|
265 |
else (tac ctxt i st |
33472
e88f67d679c4
added documentation for local SMT solver setup and available SMT options,
boehmes
parents:
33418
diff
changeset
|
266 |
handle SMT msg => fail_tac (trace_msg ctxt (prefix "SMT: ")) msg st |
e88f67d679c4
added documentation for local SMT solver setup and available SMT options,
boehmes
parents:
33418
diff
changeset
|
267 |
| SMT_COUNTEREXAMPLE ce => fail_tac tracing (pretty_cex ctxt ce) st) |
33418
1312e8337ce5
added a specific SMT exception captured by smt_tac (prevents the SMT method from failing with an exception),
boehmes
parents:
33299
diff
changeset
|
268 |
|
1312e8337ce5
added a specific SMT exception captured by smt_tac (prevents the SMT method from failing with an exception),
boehmes
parents:
33299
diff
changeset
|
269 |
fun smt_solver rules ctxt = solver_of (Context.Proof ctxt) ctxt rules |
1312e8337ce5
added a specific SMT exception captured by smt_tac (prevents the SMT method from failing with an exception),
boehmes
parents:
33299
diff
changeset
|
270 |
in |
1312e8337ce5
added a specific SMT exception captured by smt_tac (prevents the SMT method from failing with an exception),
boehmes
parents:
33299
diff
changeset
|
271 |
fun smt_tac' pass_exns ctxt rules = |
32618
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
272 |
Tactic.rtac @{thm ccontr} THEN' |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
273 |
SUBPROOF (fn {context, prems, ...} => |
33418
1312e8337ce5
added a specific SMT exception captured by smt_tac (prevents the SMT method from failing with an exception),
boehmes
parents:
33299
diff
changeset
|
274 |
SAFE pass_exns (Tactic.rtac o smt_solver (rules @ prems)) context 1) ctxt |
32618
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
275 |
|
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
276 |
val smt_tac = smt_tac' false |
33418
1312e8337ce5
added a specific SMT exception captured by smt_tac (prevents the SMT method from failing with an exception),
boehmes
parents:
33299
diff
changeset
|
277 |
end |
32618
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
278 |
|
33010 | 279 |
val smt_method = |
33299 | 280 |
Scan.optional Attrib.thms [] >> |
33010 | 281 |
(fn thms => fn ctxt => METHOD (fn facts => |
282 |
HEADGOAL (smt_tac ctxt (thms @ facts)))) |
|
283 |
||
32618
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
284 |
|
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
285 |
(* setup *) |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
286 |
|
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
287 |
val setup = |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
288 |
Attrib.setup (Binding.name "smt_solver") |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
289 |
(Scan.lift (OuterParse.$$$ "=" |-- Args.name) >> |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
290 |
(Thm.declaration_attribute o K o select_solver)) |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
291 |
"SMT solver configuration" #> |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
292 |
setup_timeout #> |
33010 | 293 |
setup_trace #> |
294 |
setup_keep #> |
|
295 |
setup_cert #> |
|
296 |
Method.setup (Binding.name "smt") smt_method |
|
297 |
"Applies an SMT solver to the current goal." |
|
32618
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
298 |
|
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
299 |
fun print_setup gen = |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
300 |
let |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
301 |
val t = string_of_int (Config.get_generic gen timeout) |
32945 | 302 |
val names = sort_strings (all_solver_names_of (Context.theory_of gen)) |
32618
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
303 |
val ns = if null names then [no_solver] else names |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
304 |
val take_info = (fn (_, []) => NONE | info => SOME info) |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
305 |
val infos = |
32627 | 306 |
Context.theory_of gen |
32618
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
307 |
|> Symtab.dest o Solvers.get |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
308 |
|> map_filter (fn (n, (_, info)) => take_info (n, info gen)) |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
309 |
|> sort (prod_ord string_ord (K EQUAL)) |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
310 |
|> map (fn (n, ps) => Pretty.big_list (n ^ ":") ps) |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
311 |
in |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
312 |
Pretty.writeln (Pretty.big_list "SMT setup:" [ |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
313 |
Pretty.str ("Current SMT solver: " ^ solver_name_of gen), |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
314 |
Pretty.str_list "Available SMT solvers: " "" ns, |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
315 |
Pretty.str ("Current timeout: " ^ t ^ " seconds"), |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
316 |
Pretty.big_list "Solver-specific settings:" infos]) |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
317 |
end |
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
318 |
|
33010 | 319 |
val _ = OuterSyntax.improper_command "smt_status" |
320 |
"Show the available SMT solvers and the currently selected solver." |
|
321 |
OuterKeyword.diag |
|
322 |
(Scan.succeed (Toplevel.no_timing o Toplevel.keep (fn state => |
|
323 |
print_setup (Context.Proof (Toplevel.context_of state))))) |
|
324 |
||
32618
42865636d006
added new method "smt": an oracle-based connection to external SMT solvers
boehmes
parents:
diff
changeset
|
325 |
end |