32 (failure * string) list -> string -> failure option |
32 (failure * string) list -> string -> failure option |
33 val extract_tstplike_proof_and_outcome : |
33 val extract_tstplike_proof_and_outcome : |
34 bool -> int -> (string * string) list -> (failure * string) list -> string |
34 bool -> int -> (string * string) list -> (failure * string) list -> string |
35 -> string * failure option |
35 -> string * failure option |
36 val is_same_step : step_name * step_name -> bool |
36 val is_same_step : step_name * step_name -> bool |
37 val atp_proof_from_tstplike_string : string -> string proof |
37 val atp_proof_from_tstplike_string : bool -> string -> string proof |
38 val map_term_names_in_atp_proof : |
38 val map_term_names_in_atp_proof : |
39 (string -> string) -> string proof -> string proof |
39 (string -> string) -> string proof -> string proof |
40 val nasty_atp_proof : string Symtab.table -> string proof -> string proof |
40 val nasty_atp_proof : string Symtab.table -> string proof -> string proof |
41 end; |
41 end; |
42 |
42 |
278 | _ => Inference (name, phi, map (rpair NONE) deps) |
278 | _ => Inference (name, phi, map (rpair NONE) deps) |
279 end) |
279 end) |
280 |
280 |
281 (**** PARSING OF VAMPIRE OUTPUT ****) |
281 (**** PARSING OF VAMPIRE OUTPUT ****) |
282 |
282 |
|
283 val parse_vampire_braced_stuff = |
|
284 $$ "{" -- scan_general_id -- $$ "}" |
|
285 -- Scan.option ($$ "(" |-- parse_vampire_detritus --| $$ ")") |
|
286 |
283 (* Syntax: <num>. <formula> <annotation> *) |
287 (* Syntax: <num>. <formula> <annotation> *) |
284 val parse_vampire_line = |
288 val parse_vampire_line = |
285 scan_general_id --| $$ "." -- parse_formula -- parse_annotation true |
289 scan_general_id --| $$ "." -- parse_formula |
|
290 --| Scan.option parse_vampire_braced_stuff -- parse_annotation true |
286 >> (fn ((num, phi), deps) => |
291 >> (fn ((num, phi), deps) => |
287 Inference ((num, NONE), phi, map (rpair NONE) deps)) |
292 Inference ((num, NONE), phi, map (rpair NONE) deps)) |
288 |
293 |
289 (**** PARSING OF SPASS OUTPUT ****) |
294 (**** PARSING OF SPASS OUTPUT ****) |
290 |
295 |
335 step :: clean_up_dependencies (name :: seen) steps |
340 step :: clean_up_dependencies (name :: seen) steps |
336 | clean_up_dependencies seen (Inference (name, u, deps) :: steps) = |
341 | clean_up_dependencies seen (Inference (name, u, deps) :: steps) = |
337 Inference (name, u, map_filter (clean_up_dependency seen) deps) :: |
342 Inference (name, u, map_filter (clean_up_dependency seen) deps) :: |
338 clean_up_dependencies (name :: seen) steps |
343 clean_up_dependencies (name :: seen) steps |
339 |
344 |
340 val atp_proof_from_tstplike_string = |
345 fun atp_proof_from_tstplike_string clean = |
341 suffix "$" (* the $ sign acts as a sentinel (FIXME: needed?) *) |
346 suffix "$" (* the $ sign acts as a sentinel (FIXME: needed?) *) |
342 #> parse_proof |
347 #> parse_proof |
343 #> sort (step_name_ord o pairself step_name) |
348 #> clean ? (sort (step_name_ord o pairself step_name) |
344 #> clean_up_dependencies [] |
349 #> clean_up_dependencies []) |
345 |
350 |
346 fun map_term_names_in_term f (ATerm (s, ts)) = |
351 fun map_term_names_in_term f (ATerm (s, ts)) = |
347 ATerm (f s, map (map_term_names_in_term f) ts) |
352 ATerm (f s, map (map_term_names_in_term f) ts) |
348 fun map_term_names_in_formula f (AQuant (q, xs, phi)) = |
353 fun map_term_names_in_formula f (AQuant (q, xs, phi)) = |
349 AQuant (q, xs, map_term_names_in_formula f phi) |
354 AQuant (q, xs, map_term_names_in_formula f phi) |