src/HOL/Tools/ATP/system_on_tptp.ML
changeset 73434 00b77365552e
parent 73431 f27d7b12e8a4
child 73435 1cc848548f21
equal deleted inserted replaced
73433:dbc32e3c47e3 73434:00b77365552e
     6 
     6 
     7 signature SYSTEM_ON_TPTP =
     7 signature SYSTEM_ON_TPTP =
     8 sig
     8 sig
     9   val get_url: unit -> string
     9   val get_url: unit -> string
    10   val list_systems: unit -> {url: string, systems: string list}
    10   val list_systems: unit -> {url: string, systems: string list}
    11   val run_system: {system: string, problem: string, extra: string, timeout: Time.time} ->
    11   val run_system: {system: string, problem: Path.T, extra: string, timeout: Time.time} ->
    12     {output: string, timing: Time.time}
    12     {output: string, timing: Time.time}
    13 end
    13 end
    14 
    14 
    15 structure SystemOnTPTP: SYSTEM_ON_TPTP =
    15 structure SystemOnTPTP: SYSTEM_ON_TPTP =
    16 struct
    16 struct
    22     val url = get_url ()
    22     val url = get_url ()
    23     val systems = trim_split_lines (\<^scala>\<open>SystemOnTPTP.list_systems\<close> url)
    23     val systems = trim_split_lines (\<^scala>\<open>SystemOnTPTP.list_systems\<close> url)
    24   in {url = url, systems = systems} end
    24   in {url = url, systems = systems} end
    25 
    25 
    26 fun run_system {system, problem, extra, timeout} =
    26 fun run_system {system, problem, extra, timeout} =
    27   cat_strings0 [get_url (), system, problem, extra, string_of_int (Time.toMilliseconds timeout)]
    27   cat_strings0
       
    28     [get_url (), system, Isabelle_System.absolute_path problem,
       
    29       extra, string_of_int (Time.toMilliseconds timeout)]
    28   |> \<^scala>\<open>SystemOnTPTP.run_system\<close>
    30   |> \<^scala>\<open>SystemOnTPTP.run_system\<close>
    29   |> split_strings0 |> (fn [output, timing] =>
    31   |> split_strings0 |> (fn [output, timing] =>
    30     {output = output, timing = Time.fromMilliseconds (Value.parse_int timing)})
    32     {output = output, timing = Time.fromMilliseconds (Value.parse_int timing)})
    31 
    33 
    32 end
    34 end