(* Title: HOL/TPTP/TPTP_Interpret_Test.thy Author: Nik Sultana, Cambridge University Computer Laboratory Some tests for the TPTP interface. Some of the tests rely on the Isabelle environment variable $TPTP, which should point to the TPTP-vX.Y.Z directory. *)
theory TPTP_Interpret_Test imports TPTP_Test TPTP_Interpret begin
section"Interpreter tests"
text"Interpret a problem."
ML ‹ val (time, ((type_map, const_map, fmlas), thy)) = Timing.timing (TPTP_Interpret.interpret_file false [Path.explode "$TPTP"] (tptp_probs_dir + Path.explode "LCL/LCL825-1.p") [] []) @{theory} ›
text"... and display nicely."
ML ‹ List.app (Pretty.writeln o (Syntax.pretty_term @{context}) o #3) fmlas; ›
subsection"Multiple tests"
ML ‹ (*default timeout is 1 min*) funinterpret timeout file thy =
Timeout.apply (Time.fromSeconds (if timeout = 0 then 60 else timeout))
(TPTP_Interpret.interpret_file
false
[Path.explode "$TPTP"] file
[]
[]) thy
ML ‹ fun interp_gain timeout thy file = let val t1 = (parse_timed file |> fst) val t2 = (interpret_timed timeout file thy |> fst) handle exn => (*FIXME*) if Exn.is_interrupt exn then Exn.reraise exn
else
(warning (" test: file " ^ Path.print file ^ " raised exception: " ^ Runtime.exn_message exn);
Timing.zero)
val to_real = Time.toReal
val diff_elapsed =
#elapsed t2 - #elapsed t1
|> to_real
val elapsed = to_real (#elapsed t2) in
(Path.base file, diff_elapsed,
diff_elapsed / elapsed,
elapsed) end ›
subsection"Test against whole TPTP"
text"Run interpretation over all problems. This works only for logics for which interpretation is defined (in TPTP_Parser/tptp_interpret.ML)."
ML ‹ if test_all @{context} then (report @{context} "Interpreting all problems"; S timed_test (interpretation_test (get_timeout @{context})) @{context} (TPTP_Syntax.get_file_list tptp_probs_dir)) else () ›
end
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.1 Sekunden
(vorverarbeitet am 2026-04-29)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.