(* 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 \<open>
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} \<close>
text"... and display nicely."
ML \<open>
List.app (Pretty.writeln o (Syntax.pretty_term @{context}) o #3) fmlas; \<close>
subsection "Multiple tests"
ML \<open> (*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 \<open> 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 \<close>
subsection "Test against whole TPTP"
text"Run interpretation over all problems. This works only for logics for which interpretationis defined (in TPTP_Parser/tptp_interpret.ML)."
ML \<open> 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 () \<close>
end
¤ Dauer der Verarbeitung: 0.0 Sekunden
(vorverarbeitet)
¤
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 ist noch experimentell.