author | immler@in.tum.de |
Tue, 31 Mar 2009 22:23:40 +0200 | |
changeset 30830 | 263064c4d0c3 |
parent 30800 | 95cbadcd47fc |
child 30982 | 7882a1268a48 |
permissions | -rw-r--r-- |
28477
9339d4dcec8b
version of sledgehammer using threads instead of processes, misc cleanup;
wenzelm
parents:
diff
changeset
|
1 |
(* Title: HOL/Tools/atp_manager.ML |
9339d4dcec8b
version of sledgehammer using threads instead of processes, misc cleanup;
wenzelm
parents:
diff
changeset
|
2 |
Author: Fabian Immler, TU Muenchen |
9339d4dcec8b
version of sledgehammer using threads instead of processes, misc cleanup;
wenzelm
parents:
diff
changeset
|
3 |
|
28571 | 4 |
ATP threads are registered here. |
5 |
Threads with the same birth-time are seen as one group. |
|
6 |
All threads of a group are killed when one thread of it has been successful, |
|
7 |
or after a certain time, |
|
8 |
or when the maximum number of threads exceeds; then the oldest thread is killed. |
|
28477
9339d4dcec8b
version of sledgehammer using threads instead of processes, misc cleanup;
wenzelm
parents:
diff
changeset
|
9 |
*) |
9339d4dcec8b
version of sledgehammer using threads instead of processes, misc cleanup;
wenzelm
parents:
diff
changeset
|
10 |
|
9339d4dcec8b
version of sledgehammer using threads instead of processes, misc cleanup;
wenzelm
parents:
diff
changeset
|
11 |
signature ATP_MANAGER = |
9339d4dcec8b
version of sledgehammer using threads instead of processes, misc cleanup;
wenzelm
parents:
diff
changeset
|
12 |
sig |
28586
d238b83ba3fc
renamed kill_all to kill, in conformance with atp_kill command;
wenzelm
parents:
28582
diff
changeset
|
13 |
val get_atps: unit -> string |
28477
9339d4dcec8b
version of sledgehammer using threads instead of processes, misc cleanup;
wenzelm
parents:
diff
changeset
|
14 |
val set_atps: string -> unit |
28586
d238b83ba3fc
renamed kill_all to kill, in conformance with atp_kill command;
wenzelm
parents:
28582
diff
changeset
|
15 |
val get_max_atps: unit -> int |
d238b83ba3fc
renamed kill_all to kill, in conformance with atp_kill command;
wenzelm
parents:
28582
diff
changeset
|
16 |
val set_max_atps: int -> unit |
d238b83ba3fc
renamed kill_all to kill, in conformance with atp_kill command;
wenzelm
parents:
28582
diff
changeset
|
17 |
val get_timeout: unit -> int |
28477
9339d4dcec8b
version of sledgehammer using threads instead of processes, misc cleanup;
wenzelm
parents:
diff
changeset
|
18 |
val set_timeout: int -> unit |
28586
d238b83ba3fc
renamed kill_all to kill, in conformance with atp_kill command;
wenzelm
parents:
28582
diff
changeset
|
19 |
val kill: unit -> unit |
d238b83ba3fc
renamed kill_all to kill, in conformance with atp_kill command;
wenzelm
parents:
28582
diff
changeset
|
20 |
val info: unit -> unit |
29112
f2b45eea6dac
added 'atp_messages' command, which displays recent messages synchronously;
wenzelm
parents:
28835
diff
changeset
|
21 |
val messages: int option -> unit |
30800 | 22 |
type prover = int -> int -> Proof.context * (thm list * thm) -> bool * string |
28595
67e3945b53f1
add_prover: plain prover function, without thread;
wenzelm
parents:
28589
diff
changeset
|
23 |
val add_prover: string -> prover -> theory -> theory |
28484 | 24 |
val print_provers: theory -> unit |
28571 | 25 |
val sledgehammer: string list -> Proof.state -> unit |
28477
9339d4dcec8b
version of sledgehammer using threads instead of processes, misc cleanup;
wenzelm
parents:
diff
changeset
|
26 |
end; |
9339d4dcec8b
version of sledgehammer using threads instead of processes, misc cleanup;
wenzelm
parents:
diff
changeset
|
27 |
|
28586
d238b83ba3fc
renamed kill_all to kill, in conformance with atp_kill command;
wenzelm
parents:
28582
diff
changeset
|
28 |
structure AtpManager: ATP_MANAGER = |
28477
9339d4dcec8b
version of sledgehammer using threads instead of processes, misc cleanup;
wenzelm
parents:
diff
changeset
|
29 |
struct |
9339d4dcec8b
version of sledgehammer using threads instead of processes, misc cleanup;
wenzelm
parents:
diff
changeset
|
30 |
|
28586
d238b83ba3fc
renamed kill_all to kill, in conformance with atp_kill command;
wenzelm
parents:
28582
diff
changeset
|
31 |
(** preferences **) |
d238b83ba3fc
renamed kill_all to kill, in conformance with atp_kill command;
wenzelm
parents:
28582
diff
changeset
|
32 |
|
29112
f2b45eea6dac
added 'atp_messages' command, which displays recent messages synchronously;
wenzelm
parents:
28835
diff
changeset
|
33 |
val message_store_limit = 20; |
f2b45eea6dac
added 'atp_messages' command, which displays recent messages synchronously;
wenzelm
parents:
28835
diff
changeset
|
34 |
val message_display_limit = 5; |
f2b45eea6dac
added 'atp_messages' command, which displays recent messages synchronously;
wenzelm
parents:
28835
diff
changeset
|
35 |
|
28586
d238b83ba3fc
renamed kill_all to kill, in conformance with atp_kill command;
wenzelm
parents:
28582
diff
changeset
|
36 |
local |
d238b83ba3fc
renamed kill_all to kill, in conformance with atp_kill command;
wenzelm
parents:
28582
diff
changeset
|
37 |
|
29598 | 38 |
val atps = ref "e remote_vampire"; |
28586
d238b83ba3fc
renamed kill_all to kill, in conformance with atp_kill command;
wenzelm
parents:
28582
diff
changeset
|
39 |
val max_atps = ref 5; (* ~1 means infinite number of atps *) |
29784 | 40 |
val timeout = ref 60; |
28586
d238b83ba3fc
renamed kill_all to kill, in conformance with atp_kill command;
wenzelm
parents:
28582
diff
changeset
|
41 |
|
d238b83ba3fc
renamed kill_all to kill, in conformance with atp_kill command;
wenzelm
parents:
28582
diff
changeset
|
42 |
in |
d238b83ba3fc
renamed kill_all to kill, in conformance with atp_kill command;
wenzelm
parents:
28582
diff
changeset
|
43 |
|
d238b83ba3fc
renamed kill_all to kill, in conformance with atp_kill command;
wenzelm
parents:
28582
diff
changeset
|
44 |
fun get_atps () = CRITICAL (fn () => ! atps); |
d238b83ba3fc
renamed kill_all to kill, in conformance with atp_kill command;
wenzelm
parents:
28582
diff
changeset
|
45 |
fun set_atps str = CRITICAL (fn () => atps := str); |
d238b83ba3fc
renamed kill_all to kill, in conformance with atp_kill command;
wenzelm
parents:
28582
diff
changeset
|
46 |
|
d238b83ba3fc
renamed kill_all to kill, in conformance with atp_kill command;
wenzelm
parents:
28582
diff
changeset
|
47 |
fun get_max_atps () = CRITICAL (fn () => ! max_atps); |
d238b83ba3fc
renamed kill_all to kill, in conformance with atp_kill command;
wenzelm
parents:
28582
diff
changeset
|
48 |
fun set_max_atps number = CRITICAL (fn () => max_atps := number); |
d238b83ba3fc
renamed kill_all to kill, in conformance with atp_kill command;
wenzelm
parents:
28582
diff
changeset
|
49 |
|
d238b83ba3fc
renamed kill_all to kill, in conformance with atp_kill command;
wenzelm
parents:
28582
diff
changeset
|
50 |
fun get_timeout () = CRITICAL (fn () => ! timeout); |
d238b83ba3fc
renamed kill_all to kill, in conformance with atp_kill command;
wenzelm
parents:
28582
diff
changeset
|
51 |
fun set_timeout time = CRITICAL (fn () => timeout := time); |
d238b83ba3fc
renamed kill_all to kill, in conformance with atp_kill command;
wenzelm
parents:
28582
diff
changeset
|
52 |
|
d238b83ba3fc
renamed kill_all to kill, in conformance with atp_kill command;
wenzelm
parents:
28582
diff
changeset
|
53 |
val _ = |
d238b83ba3fc
renamed kill_all to kill, in conformance with atp_kill command;
wenzelm
parents:
28582
diff
changeset
|
54 |
ProofGeneralPgip.add_preference "Proof" |
d238b83ba3fc
renamed kill_all to kill, in conformance with atp_kill command;
wenzelm
parents:
28582
diff
changeset
|
55 |
(Preferences.string_pref atps |
28589
581b2ab9827a
adding preferences is now permissive, no error handling here;
wenzelm
parents:
28586
diff
changeset
|
56 |
"ATP: provers" "Default automatic provers (separated by whitespace)"); |
28586
d238b83ba3fc
renamed kill_all to kill, in conformance with atp_kill command;
wenzelm
parents:
28582
diff
changeset
|
57 |
|
d238b83ba3fc
renamed kill_all to kill, in conformance with atp_kill command;
wenzelm
parents:
28582
diff
changeset
|
58 |
val _ = ProofGeneralPgip.add_preference "Proof" |
d238b83ba3fc
renamed kill_all to kill, in conformance with atp_kill command;
wenzelm
parents:
28582
diff
changeset
|
59 |
(Preferences.int_pref max_atps |
28589
581b2ab9827a
adding preferences is now permissive, no error handling here;
wenzelm
parents:
28586
diff
changeset
|
60 |
"ATP: maximum number" "How many provers may run in parallel"); |
28586
d238b83ba3fc
renamed kill_all to kill, in conformance with atp_kill command;
wenzelm
parents:
28582
diff
changeset
|
61 |
|
d238b83ba3fc
renamed kill_all to kill, in conformance with atp_kill command;
wenzelm
parents:
28582
diff
changeset
|
62 |
val _ = ProofGeneralPgip.add_preference "Proof" |
d238b83ba3fc
renamed kill_all to kill, in conformance with atp_kill command;
wenzelm
parents:
28582
diff
changeset
|
63 |
(Preferences.int_pref timeout |
28589
581b2ab9827a
adding preferences is now permissive, no error handling here;
wenzelm
parents:
28586
diff
changeset
|
64 |
"ATP: timeout" "ATPs will be interrupted after this time (in seconds)"); |
28586
d238b83ba3fc
renamed kill_all to kill, in conformance with atp_kill command;
wenzelm
parents:
28582
diff
changeset
|
65 |
|
d238b83ba3fc
renamed kill_all to kill, in conformance with atp_kill command;
wenzelm
parents:
28582
diff
changeset
|
66 |
end; |
d238b83ba3fc
renamed kill_all to kill, in conformance with atp_kill command;
wenzelm
parents:
28582
diff
changeset
|
67 |
|
d238b83ba3fc
renamed kill_all to kill, in conformance with atp_kill command;
wenzelm
parents:
28582
diff
changeset
|
68 |
|
d238b83ba3fc
renamed kill_all to kill, in conformance with atp_kill command;
wenzelm
parents:
28582
diff
changeset
|
69 |
|
d238b83ba3fc
renamed kill_all to kill, in conformance with atp_kill command;
wenzelm
parents:
28582
diff
changeset
|
70 |
(** thread management **) |
d238b83ba3fc
renamed kill_all to kill, in conformance with atp_kill command;
wenzelm
parents:
28582
diff
changeset
|
71 |
|
28582 | 72 |
(* data structures over threads *) |
73 |
||
74 |
structure ThreadHeap = HeapFun |
|
75 |
( |
|
76 |
type elem = Time.time * Thread.thread; |
|
77 |
fun ord ((a, _), (b, _)) = Time.compare (a, b); |
|
28595
67e3945b53f1
add_prover: plain prover function, without thread;
wenzelm
parents:
28589
diff
changeset
|
78 |
); |
28582 | 79 |
|
80 |
val lookup_thread = AList.lookup Thread.equal; |
|
81 |
val delete_thread = AList.delete Thread.equal; |
|
82 |
val update_thread = AList.update Thread.equal; |
|
83 |
||
84 |
||
85 |
(* state of thread manager *) |
|
28477
9339d4dcec8b
version of sledgehammer using threads instead of processes, misc cleanup;
wenzelm
parents:
diff
changeset
|
86 |
|
28582 | 87 |
datatype T = State of |
30830
263064c4d0c3
included managing_thread in state of AtpManager:
immler@in.tum.de
parents:
30800
diff
changeset
|
88 |
{managing_thread: Thread.thread option, |
263064c4d0c3
included managing_thread in state of AtpManager:
immler@in.tum.de
parents:
30800
diff
changeset
|
89 |
timeout_heap: ThreadHeap.T, |
28582 | 90 |
oldest_heap: ThreadHeap.T, |
91 |
active: (Thread.thread * (Time.time * Time.time * string)) list, |
|
29112
f2b45eea6dac
added 'atp_messages' command, which displays recent messages synchronously;
wenzelm
parents:
28835
diff
changeset
|
92 |
cancelling: (Thread.thread * (Time.time * Time.time * string)) list, |
29620 | 93 |
messages: string list, |
94 |
store: string list}; |
|
28582 | 95 |
|
30830
263064c4d0c3
included managing_thread in state of AtpManager:
immler@in.tum.de
parents:
30800
diff
changeset
|
96 |
fun make_state managing_thread timeout_heap oldest_heap active cancelling messages store = |
263064c4d0c3
included managing_thread in state of AtpManager:
immler@in.tum.de
parents:
30800
diff
changeset
|
97 |
State {managing_thread = managing_thread, timeout_heap = timeout_heap, oldest_heap = oldest_heap, |
29620 | 98 |
active = active, cancelling = cancelling, messages = messages, store = store}; |
28582 | 99 |
|
30830
263064c4d0c3
included managing_thread in state of AtpManager:
immler@in.tum.de
parents:
30800
diff
changeset
|
100 |
val state = Synchronized.var "atp_manager" |
263064c4d0c3
included managing_thread in state of AtpManager:
immler@in.tum.de
parents:
30800
diff
changeset
|
101 |
(make_state NONE ThreadHeap.empty ThreadHeap.empty [] [] [] []); |
28582 | 102 |
|
29150
8af5ee47f30c
unregister: refrain from cancelling self, which sometimes caused sledghammer to fail just before printing the result;
wenzelm
parents:
29116
diff
changeset
|
103 |
(* unregister thread *) |
28582 | 104 |
|
29620 | 105 |
fun unregister (success, message) thread = Synchronized.change state |
30830
263064c4d0c3
included managing_thread in state of AtpManager:
immler@in.tum.de
parents:
30800
diff
changeset
|
106 |
(fn state as State {managing_thread, timeout_heap, oldest_heap, active, cancelling, messages, store} => |
29150
8af5ee47f30c
unregister: refrain from cancelling self, which sometimes caused sledghammer to fail just before printing the result;
wenzelm
parents:
29116
diff
changeset
|
107 |
(case lookup_thread active thread of |
8af5ee47f30c
unregister: refrain from cancelling self, which sometimes caused sledghammer to fail just before printing the result;
wenzelm
parents:
29116
diff
changeset
|
108 |
SOME (birthtime, _, description) => |
8af5ee47f30c
unregister: refrain from cancelling self, which sometimes caused sledghammer to fail just before printing the result;
wenzelm
parents:
29116
diff
changeset
|
109 |
let |
8af5ee47f30c
unregister: refrain from cancelling self, which sometimes caused sledghammer to fail just before printing the result;
wenzelm
parents:
29116
diff
changeset
|
110 |
val (group, active') = |
8af5ee47f30c
unregister: refrain from cancelling self, which sometimes caused sledghammer to fail just before printing the result;
wenzelm
parents:
29116
diff
changeset
|
111 |
if success then List.partition (fn (_, (tb, _, _)) => tb = birthtime) active |
8af5ee47f30c
unregister: refrain from cancelling self, which sometimes caused sledghammer to fail just before printing the result;
wenzelm
parents:
29116
diff
changeset
|
112 |
else List.partition (fn (th, _) => Thread.equal (th, thread)) active |
28582 | 113 |
|
29150
8af5ee47f30c
unregister: refrain from cancelling self, which sometimes caused sledghammer to fail just before printing the result;
wenzelm
parents:
29116
diff
changeset
|
114 |
val now = Time.now () |
8af5ee47f30c
unregister: refrain from cancelling self, which sometimes caused sledghammer to fail just before printing the result;
wenzelm
parents:
29116
diff
changeset
|
115 |
val cancelling' = |
29620 | 116 |
fold (fn (th, (tb, _, desc)) => update_thread (th, (tb, now, desc))) group cancelling |
28582 | 117 |
|
29620 | 118 |
val message' = description ^ "\n" ^ message ^ |
29596 | 119 |
(if length group <= 1 then "" |
120 |
else "\nInterrupted " ^ string_of_int (length group - 1) ^ " other group members") |
|
29620 | 121 |
val store' = message' :: |
122 |
(if length store <= message_store_limit then store |
|
123 |
else #1 (chop message_store_limit store)) |
|
30830
263064c4d0c3
included managing_thread in state of AtpManager:
immler@in.tum.de
parents:
30800
diff
changeset
|
124 |
in make_state |
263064c4d0c3
included managing_thread in state of AtpManager:
immler@in.tum.de
parents:
30800
diff
changeset
|
125 |
managing_thread timeout_heap oldest_heap active' cancelling' (message' :: messages) store' |
263064c4d0c3
included managing_thread in state of AtpManager:
immler@in.tum.de
parents:
30800
diff
changeset
|
126 |
end |
30800 | 127 |
| NONE => state)); |
28582 | 128 |
|
129 |
||
28595
67e3945b53f1
add_prover: plain prover function, without thread;
wenzelm
parents:
28589
diff
changeset
|
130 |
(* kill excessive atp threads *) |
67e3945b53f1
add_prover: plain prover function, without thread;
wenzelm
parents:
28589
diff
changeset
|
131 |
|
67e3945b53f1
add_prover: plain prover function, without thread;
wenzelm
parents:
28589
diff
changeset
|
132 |
fun excessive_atps active = |
67e3945b53f1
add_prover: plain prover function, without thread;
wenzelm
parents:
28589
diff
changeset
|
133 |
let val max = get_max_atps () |
67e3945b53f1
add_prover: plain prover function, without thread;
wenzelm
parents:
28589
diff
changeset
|
134 |
in length active > max andalso max > ~1 end; |
67e3945b53f1
add_prover: plain prover function, without thread;
wenzelm
parents:
28589
diff
changeset
|
135 |
|
67e3945b53f1
add_prover: plain prover function, without thread;
wenzelm
parents:
28589
diff
changeset
|
136 |
local |
67e3945b53f1
add_prover: plain prover function, without thread;
wenzelm
parents:
28589
diff
changeset
|
137 |
|
67e3945b53f1
add_prover: plain prover function, without thread;
wenzelm
parents:
28589
diff
changeset
|
138 |
fun kill_oldest () = |
67e3945b53f1
add_prover: plain prover function, without thread;
wenzelm
parents:
28589
diff
changeset
|
139 |
let exception Unchanged in |
29112
f2b45eea6dac
added 'atp_messages' command, which displays recent messages synchronously;
wenzelm
parents:
28835
diff
changeset
|
140 |
Synchronized.change_result state |
30830
263064c4d0c3
included managing_thread in state of AtpManager:
immler@in.tum.de
parents:
30800
diff
changeset
|
141 |
(fn State {managing_thread, timeout_heap, oldest_heap, active, cancelling, messages, store} => |
28595
67e3945b53f1
add_prover: plain prover function, without thread;
wenzelm
parents:
28589
diff
changeset
|
142 |
if ThreadHeap.is_empty oldest_heap orelse not (excessive_atps active) |
67e3945b53f1
add_prover: plain prover function, without thread;
wenzelm
parents:
28589
diff
changeset
|
143 |
then raise Unchanged |
67e3945b53f1
add_prover: plain prover function, without thread;
wenzelm
parents:
28589
diff
changeset
|
144 |
else |
67e3945b53f1
add_prover: plain prover function, without thread;
wenzelm
parents:
28589
diff
changeset
|
145 |
let val ((_, oldest_thread), oldest_heap') = ThreadHeap.min_elem oldest_heap |
30830
263064c4d0c3
included managing_thread in state of AtpManager:
immler@in.tum.de
parents:
30800
diff
changeset
|
146 |
in (oldest_thread, |
263064c4d0c3
included managing_thread in state of AtpManager:
immler@in.tum.de
parents:
30800
diff
changeset
|
147 |
make_state managing_thread timeout_heap oldest_heap' active cancelling messages store) end) |
29620 | 148 |
|> unregister (false, "Interrupted (maximum number of ATPs exceeded)") |
28595
67e3945b53f1
add_prover: plain prover function, without thread;
wenzelm
parents:
28589
diff
changeset
|
149 |
handle Unchanged => () |
67e3945b53f1
add_prover: plain prover function, without thread;
wenzelm
parents:
28589
diff
changeset
|
150 |
end; |
67e3945b53f1
add_prover: plain prover function, without thread;
wenzelm
parents:
28589
diff
changeset
|
151 |
|
67e3945b53f1
add_prover: plain prover function, without thread;
wenzelm
parents:
28589
diff
changeset
|
152 |
in |
67e3945b53f1
add_prover: plain prover function, without thread;
wenzelm
parents:
28589
diff
changeset
|
153 |
|
67e3945b53f1
add_prover: plain prover function, without thread;
wenzelm
parents:
28589
diff
changeset
|
154 |
fun kill_excessive () = |
67e3945b53f1
add_prover: plain prover function, without thread;
wenzelm
parents:
28589
diff
changeset
|
155 |
let val State {active, ...} = Synchronized.value state |
67e3945b53f1
add_prover: plain prover function, without thread;
wenzelm
parents:
28589
diff
changeset
|
156 |
in if excessive_atps active then (kill_oldest (); kill_excessive ()) else () end; |
67e3945b53f1
add_prover: plain prover function, without thread;
wenzelm
parents:
28589
diff
changeset
|
157 |
|
67e3945b53f1
add_prover: plain prover function, without thread;
wenzelm
parents:
28589
diff
changeset
|
158 |
end; |
67e3945b53f1
add_prover: plain prover function, without thread;
wenzelm
parents:
28589
diff
changeset
|
159 |
|
29620 | 160 |
fun print_new_messages () = |
161 |
let val to_print = Synchronized.change_result state |
|
30830
263064c4d0c3
included managing_thread in state of AtpManager:
immler@in.tum.de
parents:
30800
diff
changeset
|
162 |
(fn State {managing_thread, timeout_heap, oldest_heap, active, cancelling, messages, store} => |
263064c4d0c3
included managing_thread in state of AtpManager:
immler@in.tum.de
parents:
30800
diff
changeset
|
163 |
(messages, make_state managing_thread timeout_heap oldest_heap active cancelling [] store)) |
30800 | 164 |
in |
165 |
if null to_print then () |
|
166 |
else priority ("Sledgehammer: " ^ space_implode "\n\n" to_print) |
|
167 |
end; |
|
29620 | 168 |
|
28595
67e3945b53f1
add_prover: plain prover function, without thread;
wenzelm
parents:
28589
diff
changeset
|
169 |
|
30800 | 170 |
(* start a watching thread -- only one may exist *) |
28582 | 171 |
|
30830
263064c4d0c3
included managing_thread in state of AtpManager:
immler@in.tum.de
parents:
30800
diff
changeset
|
172 |
fun check_thread_manager () = Synchronized.change state |
263064c4d0c3
included managing_thread in state of AtpManager:
immler@in.tum.de
parents:
30800
diff
changeset
|
173 |
(fn State {managing_thread, timeout_heap, oldest_heap, active, cancelling, messages, store} => |
263064c4d0c3
included managing_thread in state of AtpManager:
immler@in.tum.de
parents:
30800
diff
changeset
|
174 |
if (case managing_thread of SOME thread => Thread.isActive thread | NONE => false) |
263064c4d0c3
included managing_thread in state of AtpManager:
immler@in.tum.de
parents:
30800
diff
changeset
|
175 |
then make_state managing_thread timeout_heap oldest_heap active cancelling messages store |
263064c4d0c3
included managing_thread in state of AtpManager:
immler@in.tum.de
parents:
30800
diff
changeset
|
176 |
else let val managing_thread = SOME (SimpleThread.fork false (fn () => |
263064c4d0c3
included managing_thread in state of AtpManager:
immler@in.tum.de
parents:
30800
diff
changeset
|
177 |
let |
263064c4d0c3
included managing_thread in state of AtpManager:
immler@in.tum.de
parents:
30800
diff
changeset
|
178 |
val min_wait_time = Time.fromMilliseconds 300 |
263064c4d0c3
included managing_thread in state of AtpManager:
immler@in.tum.de
parents:
30800
diff
changeset
|
179 |
val max_wait_time = Time.fromSeconds 10 |
28582 | 180 |
|
30830
263064c4d0c3
included managing_thread in state of AtpManager:
immler@in.tum.de
parents:
30800
diff
changeset
|
181 |
(* wait for next thread to cancel, or maximum*) |
263064c4d0c3
included managing_thread in state of AtpManager:
immler@in.tum.de
parents:
30800
diff
changeset
|
182 |
fun time_limit (State {timeout_heap, ...}) = |
263064c4d0c3
included managing_thread in state of AtpManager:
immler@in.tum.de
parents:
30800
diff
changeset
|
183 |
(case try ThreadHeap.min timeout_heap of |
263064c4d0c3
included managing_thread in state of AtpManager:
immler@in.tum.de
parents:
30800
diff
changeset
|
184 |
NONE => SOME (Time.+ (Time.now (), max_wait_time)) |
263064c4d0c3
included managing_thread in state of AtpManager:
immler@in.tum.de
parents:
30800
diff
changeset
|
185 |
| SOME (time, _) => SOME time) |
28582 | 186 |
|
30830
263064c4d0c3
included managing_thread in state of AtpManager:
immler@in.tum.de
parents:
30800
diff
changeset
|
187 |
(* action: find threads whose timeout is reached, and interrupt cancelling threads *) |
263064c4d0c3
included managing_thread in state of AtpManager:
immler@in.tum.de
parents:
30800
diff
changeset
|
188 |
fun action (State {managing_thread, timeout_heap, oldest_heap, active, cancelling, |
263064c4d0c3
included managing_thread in state of AtpManager:
immler@in.tum.de
parents:
30800
diff
changeset
|
189 |
messages, store}) = |
263064c4d0c3
included managing_thread in state of AtpManager:
immler@in.tum.de
parents:
30800
diff
changeset
|
190 |
let val (timeout_threads, timeout_heap') = |
263064c4d0c3
included managing_thread in state of AtpManager:
immler@in.tum.de
parents:
30800
diff
changeset
|
191 |
ThreadHeap.upto (Time.now (), Thread.self ()) timeout_heap |
263064c4d0c3
included managing_thread in state of AtpManager:
immler@in.tum.de
parents:
30800
diff
changeset
|
192 |
in |
263064c4d0c3
included managing_thread in state of AtpManager:
immler@in.tum.de
parents:
30800
diff
changeset
|
193 |
if null timeout_threads andalso null cancelling andalso not (excessive_atps active) |
263064c4d0c3
included managing_thread in state of AtpManager:
immler@in.tum.de
parents:
30800
diff
changeset
|
194 |
then NONE |
263064c4d0c3
included managing_thread in state of AtpManager:
immler@in.tum.de
parents:
30800
diff
changeset
|
195 |
else |
263064c4d0c3
included managing_thread in state of AtpManager:
immler@in.tum.de
parents:
30800
diff
changeset
|
196 |
let |
263064c4d0c3
included managing_thread in state of AtpManager:
immler@in.tum.de
parents:
30800
diff
changeset
|
197 |
val _ = List.app (SimpleThread.interrupt o #1) cancelling |
263064c4d0c3
included managing_thread in state of AtpManager:
immler@in.tum.de
parents:
30800
diff
changeset
|
198 |
val cancelling' = filter (Thread.isActive o #1) cancelling |
263064c4d0c3
included managing_thread in state of AtpManager:
immler@in.tum.de
parents:
30800
diff
changeset
|
199 |
val state' = make_state |
263064c4d0c3
included managing_thread in state of AtpManager:
immler@in.tum.de
parents:
30800
diff
changeset
|
200 |
managing_thread timeout_heap' oldest_heap active cancelling' messages store |
263064c4d0c3
included managing_thread in state of AtpManager:
immler@in.tum.de
parents:
30800
diff
changeset
|
201 |
in SOME (map #2 timeout_threads, state') end |
263064c4d0c3
included managing_thread in state of AtpManager:
immler@in.tum.de
parents:
30800
diff
changeset
|
202 |
end |
263064c4d0c3
included managing_thread in state of AtpManager:
immler@in.tum.de
parents:
30800
diff
changeset
|
203 |
in |
263064c4d0c3
included managing_thread in state of AtpManager:
immler@in.tum.de
parents:
30800
diff
changeset
|
204 |
while Synchronized.change_result state |
263064c4d0c3
included managing_thread in state of AtpManager:
immler@in.tum.de
parents:
30800
diff
changeset
|
205 |
(fn st as |
263064c4d0c3
included managing_thread in state of AtpManager:
immler@in.tum.de
parents:
30800
diff
changeset
|
206 |
State {managing_thread, timeout_heap, oldest_heap, active, cancelling, messages, store} => |
263064c4d0c3
included managing_thread in state of AtpManager:
immler@in.tum.de
parents:
30800
diff
changeset
|
207 |
if (null active) andalso (null cancelling) andalso (null messages) |
263064c4d0c3
included managing_thread in state of AtpManager:
immler@in.tum.de
parents:
30800
diff
changeset
|
208 |
then (false, make_state NONE timeout_heap oldest_heap active cancelling messages store) |
263064c4d0c3
included managing_thread in state of AtpManager:
immler@in.tum.de
parents:
30800
diff
changeset
|
209 |
else (true, st)) |
263064c4d0c3
included managing_thread in state of AtpManager:
immler@in.tum.de
parents:
30800
diff
changeset
|
210 |
do |
263064c4d0c3
included managing_thread in state of AtpManager:
immler@in.tum.de
parents:
30800
diff
changeset
|
211 |
(Synchronized.timed_access state time_limit action |
263064c4d0c3
included managing_thread in state of AtpManager:
immler@in.tum.de
parents:
30800
diff
changeset
|
212 |
|> these |
263064c4d0c3
included managing_thread in state of AtpManager:
immler@in.tum.de
parents:
30800
diff
changeset
|
213 |
|> List.app (unregister (false, "Interrupted (reached timeout)")); |
263064c4d0c3
included managing_thread in state of AtpManager:
immler@in.tum.de
parents:
30800
diff
changeset
|
214 |
kill_excessive (); |
263064c4d0c3
included managing_thread in state of AtpManager:
immler@in.tum.de
parents:
30800
diff
changeset
|
215 |
print_new_messages (); |
263064c4d0c3
included managing_thread in state of AtpManager:
immler@in.tum.de
parents:
30800
diff
changeset
|
216 |
(*give threads time to respond to interrupt*) |
263064c4d0c3
included managing_thread in state of AtpManager:
immler@in.tum.de
parents:
30800
diff
changeset
|
217 |
OS.Process.sleep min_wait_time) |
263064c4d0c3
included managing_thread in state of AtpManager:
immler@in.tum.de
parents:
30800
diff
changeset
|
218 |
end)) |
263064c4d0c3
included managing_thread in state of AtpManager:
immler@in.tum.de
parents:
30800
diff
changeset
|
219 |
in make_state managing_thread timeout_heap oldest_heap active cancelling messages store end); |
28582 | 220 |
|
221 |
||
222 |
(* thread is registered here by sledgehammer *) |
|
28477
9339d4dcec8b
version of sledgehammer using threads instead of processes, misc cleanup;
wenzelm
parents:
diff
changeset
|
223 |
|
28582 | 224 |
fun register birthtime deadtime (thread, desc) = |
30798 | 225 |
(Synchronized.change state |
30830
263064c4d0c3
included managing_thread in state of AtpManager:
immler@in.tum.de
parents:
30800
diff
changeset
|
226 |
(fn State {managing_thread, timeout_heap, oldest_heap, active, cancelling, messages, store} => |
29112
f2b45eea6dac
added 'atp_messages' command, which displays recent messages synchronously;
wenzelm
parents:
28835
diff
changeset
|
227 |
let |
f2b45eea6dac
added 'atp_messages' command, which displays recent messages synchronously;
wenzelm
parents:
28835
diff
changeset
|
228 |
val timeout_heap' = ThreadHeap.insert (deadtime, thread) timeout_heap |
f2b45eea6dac
added 'atp_messages' command, which displays recent messages synchronously;
wenzelm
parents:
28835
diff
changeset
|
229 |
val oldest_heap' = ThreadHeap.insert (birthtime, thread) oldest_heap |
f2b45eea6dac
added 'atp_messages' command, which displays recent messages synchronously;
wenzelm
parents:
28835
diff
changeset
|
230 |
val active' = update_thread (thread, (birthtime, deadtime, desc)) active |
30830
263064c4d0c3
included managing_thread in state of AtpManager:
immler@in.tum.de
parents:
30800
diff
changeset
|
231 |
in make_state managing_thread timeout_heap' oldest_heap' active' cancelling messages store end); |
30798 | 232 |
check_thread_manager ()); |
28477
9339d4dcec8b
version of sledgehammer using threads instead of processes, misc cleanup;
wenzelm
parents:
diff
changeset
|
233 |
|
9339d4dcec8b
version of sledgehammer using threads instead of processes, misc cleanup;
wenzelm
parents:
diff
changeset
|
234 |
|
28586
d238b83ba3fc
renamed kill_all to kill, in conformance with atp_kill command;
wenzelm
parents:
28582
diff
changeset
|
235 |
|
d238b83ba3fc
renamed kill_all to kill, in conformance with atp_kill command;
wenzelm
parents:
28582
diff
changeset
|
236 |
(** user commands **) |
28582 | 237 |
|
28586
d238b83ba3fc
renamed kill_all to kill, in conformance with atp_kill command;
wenzelm
parents:
28582
diff
changeset
|
238 |
(* kill: move all threads to cancelling *) |
d238b83ba3fc
renamed kill_all to kill, in conformance with atp_kill command;
wenzelm
parents:
28582
diff
changeset
|
239 |
|
d238b83ba3fc
renamed kill_all to kill, in conformance with atp_kill command;
wenzelm
parents:
28582
diff
changeset
|
240 |
fun kill () = Synchronized.change state |
30830
263064c4d0c3
included managing_thread in state of AtpManager:
immler@in.tum.de
parents:
30800
diff
changeset
|
241 |
(fn State {managing_thread, timeout_heap, oldest_heap, active, cancelling, messages, store} => |
28582 | 242 |
let val formerly_active = map (fn (th, (tb, _, desc)) => (th, (tb, Time.now (), desc))) active |
30830
263064c4d0c3
included managing_thread in state of AtpManager:
immler@in.tum.de
parents:
30800
diff
changeset
|
243 |
in make_state |
263064c4d0c3
included managing_thread in state of AtpManager:
immler@in.tum.de
parents:
30800
diff
changeset
|
244 |
managing_thread timeout_heap oldest_heap [] (formerly_active @ cancelling) messages store |
263064c4d0c3
included managing_thread in state of AtpManager:
immler@in.tum.de
parents:
30800
diff
changeset
|
245 |
end); |
28582 | 246 |
|
247 |
||
29112
f2b45eea6dac
added 'atp_messages' command, which displays recent messages synchronously;
wenzelm
parents:
28835
diff
changeset
|
248 |
(* ATP info *) |
28582 | 249 |
|
250 |
fun info () = |
|
251 |
let |
|
29112
f2b45eea6dac
added 'atp_messages' command, which displays recent messages synchronously;
wenzelm
parents:
28835
diff
changeset
|
252 |
val State {active, cancelling, ...} = Synchronized.value state |
f2b45eea6dac
added 'atp_messages' command, which displays recent messages synchronously;
wenzelm
parents:
28835
diff
changeset
|
253 |
|
28571 | 254 |
fun running_info (_, (birth_time, dead_time, desc)) = "Running: " |
28589
581b2ab9827a
adding preferences is now permissive, no error handling here;
wenzelm
parents:
28586
diff
changeset
|
255 |
^ (string_of_int o Time.toSeconds) (Time.- (Time.now (), birth_time)) |
28477
9339d4dcec8b
version of sledgehammer using threads instead of processes, misc cleanup;
wenzelm
parents:
diff
changeset
|
256 |
^ " s -- " |
28589
581b2ab9827a
adding preferences is now permissive, no error handling here;
wenzelm
parents:
28586
diff
changeset
|
257 |
^ (string_of_int o Time.toSeconds) (Time.- (dead_time, Time.now ())) |
28571 | 258 |
^ " s to live:\n" ^ desc |
259 |
fun cancelling_info (_, (_, dead_time, desc)) = "Trying to interrupt thread since " |
|
28586
d238b83ba3fc
renamed kill_all to kill, in conformance with atp_kill command;
wenzelm
parents:
28582
diff
changeset
|
260 |
^ (string_of_int o Time.toSeconds) (Time.- (Time.now (), dead_time)) |
28571 | 261 |
^ " s:\n" ^ desc |
29112
f2b45eea6dac
added 'atp_messages' command, which displays recent messages synchronously;
wenzelm
parents:
28835
diff
changeset
|
262 |
|
28589
581b2ab9827a
adding preferences is now permissive, no error handling here;
wenzelm
parents:
28586
diff
changeset
|
263 |
val running = |
581b2ab9827a
adding preferences is now permissive, no error handling here;
wenzelm
parents:
28586
diff
changeset
|
264 |
if null active then "No ATPs running." |
581b2ab9827a
adding preferences is now permissive, no error handling here;
wenzelm
parents:
28586
diff
changeset
|
265 |
else space_implode "\n\n" ("Running ATPs:" :: map running_info active) |
581b2ab9827a
adding preferences is now permissive, no error handling here;
wenzelm
parents:
28586
diff
changeset
|
266 |
val interrupting = |
581b2ab9827a
adding preferences is now permissive, no error handling here;
wenzelm
parents:
28586
diff
changeset
|
267 |
if null cancelling then "" |
581b2ab9827a
adding preferences is now permissive, no error handling here;
wenzelm
parents:
28586
diff
changeset
|
268 |
else space_implode "\n\n" |
581b2ab9827a
adding preferences is now permissive, no error handling here;
wenzelm
parents:
28586
diff
changeset
|
269 |
("Trying to interrupt the following ATPs:" :: map cancelling_info cancelling) |
29112
f2b45eea6dac
added 'atp_messages' command, which displays recent messages synchronously;
wenzelm
parents:
28835
diff
changeset
|
270 |
|
28582 | 271 |
in writeln (running ^ "\n" ^ interrupting) end; |
272 |
||
29112
f2b45eea6dac
added 'atp_messages' command, which displays recent messages synchronously;
wenzelm
parents:
28835
diff
changeset
|
273 |
fun messages opt_limit = |
f2b45eea6dac
added 'atp_messages' command, which displays recent messages synchronously;
wenzelm
parents:
28835
diff
changeset
|
274 |
let |
f2b45eea6dac
added 'atp_messages' command, which displays recent messages synchronously;
wenzelm
parents:
28835
diff
changeset
|
275 |
val limit = the_default message_display_limit opt_limit; |
29620 | 276 |
val State {store = msgs, ...} = Synchronized.value state |
29112
f2b45eea6dac
added 'atp_messages' command, which displays recent messages synchronously;
wenzelm
parents:
28835
diff
changeset
|
277 |
val header = "Recent ATP messages" ^ |
f2b45eea6dac
added 'atp_messages' command, which displays recent messages synchronously;
wenzelm
parents:
28835
diff
changeset
|
278 |
(if length msgs <= limit then ":" else " (" ^ string_of_int limit ^ " displayed):"); |
29116 | 279 |
in writeln (space_implode "\n\n" (header :: #1 (chop limit msgs))) end; |
29112
f2b45eea6dac
added 'atp_messages' command, which displays recent messages synchronously;
wenzelm
parents:
28835
diff
changeset
|
280 |
|
28582 | 281 |
|
28477
9339d4dcec8b
version of sledgehammer using threads instead of processes, misc cleanup;
wenzelm
parents:
diff
changeset
|
282 |
|
28586
d238b83ba3fc
renamed kill_all to kill, in conformance with atp_kill command;
wenzelm
parents:
28582
diff
changeset
|
283 |
(** The Sledgehammer **) |
28477
9339d4dcec8b
version of sledgehammer using threads instead of processes, misc cleanup;
wenzelm
parents:
diff
changeset
|
284 |
|
28582 | 285 |
(* named provers *) |
28484 | 286 |
|
30537 | 287 |
type prover = int -> int -> Proof.context * (thm list * thm) -> bool * string; |
28595
67e3945b53f1
add_prover: plain prover function, without thread;
wenzelm
parents:
28589
diff
changeset
|
288 |
|
28582 | 289 |
fun err_dup_prover name = error ("Duplicate prover: " ^ quote name); |
28477
9339d4dcec8b
version of sledgehammer using threads instead of processes, misc cleanup;
wenzelm
parents:
diff
changeset
|
290 |
|
28582 | 291 |
structure Provers = TheoryDataFun |
292 |
( |
|
28595
67e3945b53f1
add_prover: plain prover function, without thread;
wenzelm
parents:
28589
diff
changeset
|
293 |
type T = (prover * stamp) Symtab.table |
28582 | 294 |
val empty = Symtab.empty |
295 |
val copy = I |
|
296 |
val extend = I |
|
297 |
fun merge _ tabs : T = Symtab.merge (eq_snd op =) tabs |
|
28589
581b2ab9827a
adding preferences is now permissive, no error handling here;
wenzelm
parents:
28586
diff
changeset
|
298 |
handle Symtab.DUP dup => err_dup_prover dup |
28582 | 299 |
); |
28484 | 300 |
|
28595
67e3945b53f1
add_prover: plain prover function, without thread;
wenzelm
parents:
28589
diff
changeset
|
301 |
fun add_prover name prover thy = |
67e3945b53f1
add_prover: plain prover function, without thread;
wenzelm
parents:
28589
diff
changeset
|
302 |
Provers.map (Symtab.update_new (name, (prover, stamp ()))) thy |
28582 | 303 |
handle Symtab.DUP dup => err_dup_prover dup; |
304 |
||
305 |
fun print_provers thy = Pretty.writeln |
|
306 |
(Pretty.strs ("external provers:" :: sort_strings (Symtab.keys (Provers.get thy)))); |
|
28571 | 307 |
|
28586
d238b83ba3fc
renamed kill_all to kill, in conformance with atp_kill command;
wenzelm
parents:
28582
diff
changeset
|
308 |
|
28595
67e3945b53f1
add_prover: plain prover function, without thread;
wenzelm
parents:
28589
diff
changeset
|
309 |
(* start prover thread *) |
28484 | 310 |
|
28595
67e3945b53f1
add_prover: plain prover function, without thread;
wenzelm
parents:
28589
diff
changeset
|
311 |
fun start_prover name birthtime deadtime i proof_state = |
67e3945b53f1
add_prover: plain prover function, without thread;
wenzelm
parents:
28589
diff
changeset
|
312 |
(case Symtab.lookup (Provers.get (Proof.theory_of proof_state)) name of |
67e3945b53f1
add_prover: plain prover function, without thread;
wenzelm
parents:
28589
diff
changeset
|
313 |
NONE => warning ("Unknown external prover: " ^ quote name) |
67e3945b53f1
add_prover: plain prover function, without thread;
wenzelm
parents:
28589
diff
changeset
|
314 |
| SOME (prover, _) => |
67e3945b53f1
add_prover: plain prover function, without thread;
wenzelm
parents:
28589
diff
changeset
|
315 |
let |
67e3945b53f1
add_prover: plain prover function, without thread;
wenzelm
parents:
28589
diff
changeset
|
316 |
val (ctxt, (_, goal)) = Proof.get_goal proof_state |
67e3945b53f1
add_prover: plain prover function, without thread;
wenzelm
parents:
28589
diff
changeset
|
317 |
val desc = |
67e3945b53f1
add_prover: plain prover function, without thread;
wenzelm
parents:
28589
diff
changeset
|
318 |
"external prover " ^ quote name ^ " for subgoal " ^ string_of_int i ^ ":\n" ^ |
67e3945b53f1
add_prover: plain prover function, without thread;
wenzelm
parents:
28589
diff
changeset
|
319 |
Syntax.string_of_term ctxt (Thm.term_of (Thm.cprem_of goal i)) |
67e3945b53f1
add_prover: plain prover function, without thread;
wenzelm
parents:
28589
diff
changeset
|
320 |
val _ = SimpleThread.fork true (fn () => |
67e3945b53f1
add_prover: plain prover function, without thread;
wenzelm
parents:
28589
diff
changeset
|
321 |
let |
67e3945b53f1
add_prover: plain prover function, without thread;
wenzelm
parents:
28589
diff
changeset
|
322 |
val _ = register birthtime deadtime (Thread.self (), desc) |
30800 | 323 |
val result = prover (get_timeout ()) i (Proof.get_goal proof_state) |
28835 | 324 |
handle ResHolClause.TOO_TRIVIAL |
325 |
=> (true, "Empty clause: Try this command: " ^ Markup.markup Markup.sendback "apply metis") |
|
326 |
| ERROR msg |
|
327 |
=> (false, "Error: " ^ msg) |
|
29620 | 328 |
val _ = unregister result (Thread.self ()) |
28595
67e3945b53f1
add_prover: plain prover function, without thread;
wenzelm
parents:
28589
diff
changeset
|
329 |
in () end handle Interrupt => ()) |
67e3945b53f1
add_prover: plain prover function, without thread;
wenzelm
parents:
28589
diff
changeset
|
330 |
in () end); |
28582 | 331 |
|
332 |
||
333 |
(* sledghammer for first subgoal *) |
|
334 |
||
335 |
fun sledgehammer names proof_state = |
|
336 |
let |
|
28595
67e3945b53f1
add_prover: plain prover function, without thread;
wenzelm
parents:
28589
diff
changeset
|
337 |
val provers = |
28586
d238b83ba3fc
renamed kill_all to kill, in conformance with atp_kill command;
wenzelm
parents:
28582
diff
changeset
|
338 |
if null names then String.tokens (Symbol.is_ascii_blank o String.str) (get_atps ()) |
28582 | 339 |
else names |
340 |
val birthtime = Time.now () |
|
28595
67e3945b53f1
add_prover: plain prover function, without thread;
wenzelm
parents:
28589
diff
changeset
|
341 |
val deadtime = Time.+ (birthtime, Time.fromSeconds (get_timeout ())) |
67e3945b53f1
add_prover: plain prover function, without thread;
wenzelm
parents:
28589
diff
changeset
|
342 |
in List.app (fn name => start_prover name birthtime deadtime 1 proof_state) provers end; |
28582 | 343 |
|
344 |
||
28586
d238b83ba3fc
renamed kill_all to kill, in conformance with atp_kill command;
wenzelm
parents:
28582
diff
changeset
|
345 |
|
d238b83ba3fc
renamed kill_all to kill, in conformance with atp_kill command;
wenzelm
parents:
28582
diff
changeset
|
346 |
(** Isar command syntax **) |
28582 | 347 |
|
348 |
local structure K = OuterKeyword and P = OuterParse in |
|
349 |
||
350 |
val _ = |
|
351 |
OuterSyntax.improper_command "atp_kill" "kill all managed provers" K.diag |
|
28586
d238b83ba3fc
renamed kill_all to kill, in conformance with atp_kill command;
wenzelm
parents:
28582
diff
changeset
|
352 |
(Scan.succeed (Toplevel.no_timing o Toplevel.imperative kill)); |
28582 | 353 |
|
354 |
val _ = |
|
355 |
OuterSyntax.improper_command "atp_info" "print information about managed provers" K.diag |
|
356 |
(Scan.succeed (Toplevel.no_timing o Toplevel.imperative info)); |
|
357 |
||
358 |
val _ = |
|
29112
f2b45eea6dac
added 'atp_messages' command, which displays recent messages synchronously;
wenzelm
parents:
28835
diff
changeset
|
359 |
OuterSyntax.improper_command "atp_messages" "print recent messages issued by managed provers" K.diag |
f2b45eea6dac
added 'atp_messages' command, which displays recent messages synchronously;
wenzelm
parents:
28835
diff
changeset
|
360 |
(Scan.option (P.$$$ "(" |-- P.nat --| P.$$$ ")") >> |
f2b45eea6dac
added 'atp_messages' command, which displays recent messages synchronously;
wenzelm
parents:
28835
diff
changeset
|
361 |
(fn limit => Toplevel.no_timing o Toplevel.imperative (fn () => messages limit))); |
f2b45eea6dac
added 'atp_messages' command, which displays recent messages synchronously;
wenzelm
parents:
28835
diff
changeset
|
362 |
|
f2b45eea6dac
added 'atp_messages' command, which displays recent messages synchronously;
wenzelm
parents:
28835
diff
changeset
|
363 |
val _ = |
28582 | 364 |
OuterSyntax.improper_command "print_atps" "print external provers" K.diag |
365 |
(Scan.succeed (Toplevel.no_timing o Toplevel.unknown_theory o |
|
366 |
Toplevel.keep (print_provers o Toplevel.theory_of))); |
|
367 |
||
368 |
val _ = |
|
369 |
OuterSyntax.command "sledgehammer" "call all automatic theorem provers" K.diag |
|
370 |
(Scan.repeat P.xname >> (fn names => Toplevel.no_timing o Toplevel.unknown_proof o |
|
30800 | 371 |
Toplevel.keep (sledgehammer names o Toplevel.proof_of))); |
28582 | 372 |
|
373 |
end; |
|
374 |
||
375 |
end; |
|
30537 | 376 |