equal
deleted
inserted
replaced
17 val get_timeout: unit -> int |
17 val get_timeout: unit -> int |
18 val set_timeout: int -> unit |
18 val set_timeout: int -> unit |
19 val kill: unit -> unit |
19 val kill: unit -> unit |
20 val info: unit -> unit |
20 val info: unit -> unit |
21 val messages: int option -> unit |
21 val messages: int option -> unit |
22 type prover = int -> int -> Proof.state -> bool * string |
22 type prover = int -> int -> Proof.context * (thm list * thm) -> bool * string |
23 val add_prover: string -> prover -> theory -> theory |
23 val add_prover: string -> prover -> theory -> theory |
24 val print_provers: theory -> unit |
24 val print_provers: theory -> unit |
25 val sledgehammer: string list -> Proof.state -> unit |
25 val sledgehammer: string list -> Proof.state -> unit |
26 end; |
26 end; |
27 |
27 |
269 |
269 |
270 (** The Sledgehammer **) |
270 (** The Sledgehammer **) |
271 |
271 |
272 (* named provers *) |
272 (* named provers *) |
273 |
273 |
274 type prover = int -> int -> Proof.state -> bool * string; |
274 type prover = int -> int -> Proof.context * (thm list * thm) -> bool * string; |
275 |
275 |
276 fun err_dup_prover name = error ("Duplicate prover: " ^ quote name); |
276 fun err_dup_prover name = error ("Duplicate prover: " ^ quote name); |
277 |
277 |
278 structure Provers = TheoryDataFun |
278 structure Provers = TheoryDataFun |
279 ( |
279 ( |
305 "external prover " ^ quote name ^ " for subgoal " ^ string_of_int i ^ ":\n" ^ |
305 "external prover " ^ quote name ^ " for subgoal " ^ string_of_int i ^ ":\n" ^ |
306 Syntax.string_of_term ctxt (Thm.term_of (Thm.cprem_of goal i)) |
306 Syntax.string_of_term ctxt (Thm.term_of (Thm.cprem_of goal i)) |
307 val _ = SimpleThread.fork true (fn () => |
307 val _ = SimpleThread.fork true (fn () => |
308 let |
308 let |
309 val _ = register birthtime deadtime (Thread.self (), desc) |
309 val _ = register birthtime deadtime (Thread.self (), desc) |
310 val result = prover (get_timeout ()) i proof_state |
310 val result = prover (get_timeout ()) i (Proof.get_goal proof_state) |
311 handle ResHolClause.TOO_TRIVIAL |
311 handle ResHolClause.TOO_TRIVIAL |
312 => (true, "Empty clause: Try this command: " ^ Markup.markup Markup.sendback "apply metis") |
312 => (true, "Empty clause: Try this command: " ^ Markup.markup Markup.sendback "apply metis") |
313 | ERROR msg |
313 | ERROR msg |
314 => (false, "Error: " ^ msg) |
314 => (false, "Error: " ^ msg) |
315 val _ = unregister result (Thread.self ()) |
315 val _ = unregister result (Thread.self ()) |
358 Toplevel.keep ((sledgehammer names) o Toplevel.proof_of))); |
358 Toplevel.keep ((sledgehammer names) o Toplevel.proof_of))); |
359 |
359 |
360 end; |
360 end; |
361 |
361 |
362 end; |
362 end; |
|
363 |