src/HOL/Tools/ATP/system_on_tptp.ML
changeset 73431 f27d7b12e8a4
parent 73430 c7f14309e291
child 73434 00b77365552e
equal deleted inserted replaced
73430:c7f14309e291 73431:f27d7b12e8a4
     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} ->
       
    12     {output: string, timing: Time.time}
    11 end
    13 end
    12 
    14 
    13 structure SystemOnTPTP: SYSTEM_ON_TPTP =
    15 structure SystemOnTPTP: SYSTEM_ON_TPTP =
    14 struct
    16 struct
    15 
    17 
    19   let
    21   let
    20     val url = get_url ()
    22     val url = get_url ()
    21     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)
    22   in {url = url, systems = systems} end
    24   in {url = url, systems = systems} end
    23 
    25 
       
    26 fun run_system {system, problem, extra, timeout} =
       
    27   cat_strings0 [get_url (), system, problem, extra, string_of_int (Time.toMilliseconds timeout)]
       
    28   |> \<^scala>\<open>SystemOnTPTP.run_system\<close>
       
    29   |> split_strings0 |> (fn [output, timing] =>
       
    30     {output = output, timing = Time.fromMilliseconds (Value.parse_int timing)})
       
    31 
    24 end
    32 end