171 if output = "" then "No details available" else elide_string 1000 output |
171 if output = "" then "No details available" else elide_string 1000 output |
172 else |
172 else |
173 "" |
173 "" |
174 |
174 |
175 val missing_message_tail = |
175 val missing_message_tail = |
176 " appears to be missing. You will need to install it if you want to invoke \ |
176 " appears to be missing; you will need to install it if you want to invoke \ |
177 \remote provers." |
177 \remote provers" |
178 |
178 |
179 fun from_lemmas [] = "" |
179 fun from_lemmas [] = "" |
180 | from_lemmas ss = " from " ^ space_implode " " (Try.serial_commas "and" (map quote ss)) |
180 | from_lemmas ss = " from " ^ space_implode " " (Try.serial_commas "and" (map quote ss)) |
181 |
181 |
182 fun string_of_atp_failure MaybeUnprovable = "The generated problem is maybe unprovable." |
182 fun string_of_atp_failure MaybeUnprovable = "The generated problem is maybe unprovable" |
183 | string_of_atp_failure Unprovable = "The generated problem is unprovable." |
183 | string_of_atp_failure Unprovable = "The generated problem is unprovable" |
184 | string_of_atp_failure GaveUp = "The prover gave up." |
184 | string_of_atp_failure GaveUp = "The prover gave up" |
185 | string_of_atp_failure ProofMissing = |
185 | string_of_atp_failure ProofMissing = |
186 "The prover claims the conjecture is a theorem but did not provide a proof." |
186 "The prover claims the conjecture is a theorem but did not provide a proof" |
187 | string_of_atp_failure ProofIncomplete = |
187 | string_of_atp_failure ProofIncomplete = |
188 "The prover claims the conjecture is a theorem but provided an incomplete proof." |
188 "The prover claims the conjecture is a theorem but provided an incomplete proof" |
189 | string_of_atp_failure ProofUnparsable = |
189 | string_of_atp_failure ProofUnparsable = |
190 "The prover claims the conjecture is a theorem but provided an unparsable proof." |
190 "The prover claims the conjecture is a theorem but provided an unparsable proof" |
191 | string_of_atp_failure (UnsoundProof (false, ss)) = |
191 | string_of_atp_failure (UnsoundProof (false, ss)) = |
192 "The prover derived \"False\"" ^ from_lemmas ss ^ |
192 "The prover derived \"False\"" ^ from_lemmas ss ^ |
193 ". Specify a sound type encoding or omit the \"type_enc\" option." |
193 "; specify a sound type encoding or omit the \"type_enc\" option" |
194 | string_of_atp_failure (UnsoundProof (true, ss)) = |
194 | string_of_atp_failure (UnsoundProof (true, ss)) = |
195 "The prover derived \"False\"" ^ from_lemmas ss ^ |
195 "The prover derived \"False\"" ^ from_lemmas ss ^ |
196 ", which could be due to inconsistent axioms (including \"sorry\"s) or to \ |
196 ", which could be due to a bug in Sledgehammer or to inconsistent axioms (including \"sorry\"s)" |
197 \a bug in Sledgehammer." |
197 | string_of_atp_failure CantConnect = "Cannot connect to server" |
198 | string_of_atp_failure CantConnect = "Cannot connect to server." |
198 | string_of_atp_failure TimedOut = "Timed out" |
199 | string_of_atp_failure TimedOut = "Timed out." |
|
200 | string_of_atp_failure Inappropriate = |
199 | string_of_atp_failure Inappropriate = |
201 "The generated problem lies outside the prover's scope." |
200 "The generated problem lies outside the prover's scope" |
202 | string_of_atp_failure OutOfResources = "The prover ran out of resources." |
201 | string_of_atp_failure OutOfResources = "The prover ran out of resources" |
203 | string_of_atp_failure NoPerl = "Perl" ^ missing_message_tail |
202 | string_of_atp_failure NoPerl = "Perl" ^ missing_message_tail |
204 | string_of_atp_failure NoLibwwwPerl = |
203 | string_of_atp_failure NoLibwwwPerl = |
205 "The Perl module \"libwww-perl\"" ^ missing_message_tail |
204 "The Perl module \"libwww-perl\"" ^ missing_message_tail |
206 | string_of_atp_failure MalformedInput = "The generated problem is malformed." |
205 | string_of_atp_failure MalformedInput = "The generated problem is malformed" |
207 | string_of_atp_failure MalformedOutput = "The prover output is malformed." |
206 | string_of_atp_failure MalformedOutput = "The prover output is malformed" |
208 | string_of_atp_failure Interrupted = "The prover was interrupted." |
207 | string_of_atp_failure Interrupted = "The prover was interrupted" |
209 | string_of_atp_failure Crashed = "The prover crashed." |
208 | string_of_atp_failure Crashed = "The prover crashed" |
210 | string_of_atp_failure InternalError = "An internal prover error occurred." |
209 | string_of_atp_failure InternalError = "An internal prover error occurred" |
211 | string_of_atp_failure (UnknownError s) = |
210 | string_of_atp_failure (UnknownError s) = |
212 "A prover error occurred" ^ |
211 "A prover error occurred" ^ |
213 (if s = "" then ". (Pass the \"verbose\" option for details.)" |
212 (if s = "" then " (pass the \"verbose\" option for details)" else ":\n" ^ s) |
214 else ":\n" ^ s) |
|
215 |
213 |
216 fun extract_delimited (begin_delim, end_delim) output = |
214 fun extract_delimited (begin_delim, end_delim) output = |
217 (case first_field begin_delim output of |
215 (case first_field begin_delim output of |
218 SOME (_, tail) => |
216 SOME (_, tail) => |
219 (case first_field "\n" tail of |
217 (case first_field "\n" tail of |