equal
deleted
inserted
replaced
9 signature SLEDGEHAMMER_RUN = |
9 signature SLEDGEHAMMER_RUN = |
10 sig |
10 sig |
11 type relevance_override = Sledgehammer_Filter.relevance_override |
11 type relevance_override = Sledgehammer_Filter.relevance_override |
12 type minimize_command = Sledgehammer_ATP_Reconstruct.minimize_command |
12 type minimize_command = Sledgehammer_ATP_Reconstruct.minimize_command |
13 type params = Sledgehammer_Provers.params |
13 type params = Sledgehammer_Provers.params |
14 |
|
15 (* for experimentation purposes -- do not use in production code *) |
|
16 val show_facts_in_proofs : bool Unsynchronized.ref |
|
17 |
14 |
18 val run_sledgehammer : |
15 val run_sledgehammer : |
19 params -> bool -> int -> relevance_override -> (string -> minimize_command) |
16 params -> bool -> int -> relevance_override -> (string -> minimize_command) |
20 -> Proof.state -> bool * Proof.state |
17 -> Proof.state -> bool * Proof.state |
21 end; |
18 end; |
39 " on " ^ (if n = 1 then "goal" else "subgoal " ^ string_of_int i) ^ ":" ^ |
36 " on " ^ (if n = 1 then "goal" else "subgoal " ^ string_of_int i) ^ ":" ^ |
40 (if blocking then |
37 (if blocking then |
41 "" |
38 "" |
42 else |
39 else |
43 "\n" ^ Syntax.string_of_term ctxt (Thm.term_of (Thm.cprem_of goal i))) |
40 "\n" ^ Syntax.string_of_term ctxt (Thm.term_of (Thm.cprem_of goal i))) |
44 |
|
45 val show_facts_in_proofs = Unsynchronized.ref false |
|
46 |
41 |
47 val implicit_minimization_threshold = 50 |
42 val implicit_minimization_threshold = 50 |
48 |
43 |
49 fun run_prover (params as {debug, blocking, max_relevant, timeout, expect, ...}) |
44 fun run_prover (params as {debug, blocking, max_relevant, timeout, expect, ...}) |
50 auto minimize_command only |
45 auto minimize_command only |
77 (map (apsnd single o untranslated_fact) facts)) |
72 (map (apsnd single o untranslated_fact) facts)) |
78 |>> Option.map (map fst) |
73 |>> Option.map (map fst) |
79 else |
74 else |
80 (SOME used_facts, message) |
75 (SOME used_facts, message) |
81 val _ = |
76 val _ = |
82 case (debug orelse !show_facts_in_proofs, used_facts) of |
77 case (debug, used_facts) of |
83 (true, SOME (used_facts as _ :: _)) => |
78 (true, SOME (used_facts as _ :: _)) => |
84 facts ~~ (0 upto length facts - 1) |
79 facts ~~ (0 upto length facts - 1) |
85 |> map (fn (fact, j) => |
80 |> map (fn (fact, j) => |
86 fact |> untranslated_fact |> apsnd (K j)) |
81 fact |> untranslated_fact |> apsnd (K j)) |
87 |> filter_used_facts used_facts |
82 |> filter_used_facts used_facts |