src/HOL/Tools/ATP/atp_systems.ML
changeset 38589 b03f8fe043ec
parent 38588 6a5b104f92cb
child 38596 f881b865dcf4
equal deleted inserted replaced
38588:6a5b104f92cb 38589:b03f8fe043ec
    16     {exec: string * string,
    16     {exec: string * string,
    17      required_execs: (string * string) list,
    17      required_execs: (string * string) list,
    18      arguments: bool -> Time.time -> string,
    18      arguments: bool -> Time.time -> string,
    19      proof_delims: (string * string) list,
    19      proof_delims: (string * string) list,
    20      known_failures: (failure * string) list,
    20      known_failures: (failure * string) list,
    21      max_new_relevant_facts_per_iter: int,
    21      default_max_relevant_per_iter: int,
    22      prefers_theory_relevant: bool,
    22      default_theory_relevant: bool,
    23      explicit_forall: bool}
    23      explicit_forall: bool}
    24 
    24 
    25   val string_for_failure : failure -> string
    25   val string_for_failure : failure -> string
    26   val known_failure_in_output :
    26   val known_failure_in_output :
    27     string -> (failure * string) list -> failure option
    27     string -> (failure * string) list -> failure option
    47   {exec: string * string,
    47   {exec: string * string,
    48    required_execs: (string * string) list,
    48    required_execs: (string * string) list,
    49    arguments: bool -> Time.time -> string,
    49    arguments: bool -> Time.time -> string,
    50    proof_delims: (string * string) list,
    50    proof_delims: (string * string) list,
    51    known_failures: (failure * string) list,
    51    known_failures: (failure * string) list,
    52    max_new_relevant_facts_per_iter: int,
    52    default_max_relevant_per_iter: int,
    53    prefers_theory_relevant: bool,
    53    default_theory_relevant: bool,
    54    explicit_forall: bool}
    54    explicit_forall: bool}
    55 
    55 
    56 val missing_message_tail =
    56 val missing_message_tail =
    57   " appears to be missing. You will need to install it if you want to run \
    57   " appears to be missing. You will need to install it if you want to run \
    58   \ATPs remotely."
    58   \ATPs remotely."
   142       (TimedOut, "time limit exceeded"),
   142       (TimedOut, "time limit exceeded"),
   143       (OutOfResources,
   143       (OutOfResources,
   144        "# Cannot determine problem status within resource limit"),
   144        "# Cannot determine problem status within resource limit"),
   145       (OutOfResources, "SZS status: ResourceOut"),
   145       (OutOfResources, "SZS status: ResourceOut"),
   146       (OutOfResources, "SZS status ResourceOut")],
   146       (OutOfResources, "SZS status ResourceOut")],
   147    max_new_relevant_facts_per_iter = 50 (* FIXME *),
   147    default_max_relevant_per_iter = 50 (* FIXME *),
   148    prefers_theory_relevant = false,
   148    default_theory_relevant = false,
   149    explicit_forall = false}
   149    explicit_forall = false}
   150 
   150 
   151 val e = ("e", e_config)
   151 val e = ("e", e_config)
   152 
   152 
   153 
   153 
   169       (TimedOut, "SPASS beiseite: Ran out of time"),
   169       (TimedOut, "SPASS beiseite: Ran out of time"),
   170       (OutOfResources, "SPASS beiseite: Maximal number of loops exceeded"),
   170       (OutOfResources, "SPASS beiseite: Maximal number of loops exceeded"),
   171       (MalformedInput, "Undefined symbol"),
   171       (MalformedInput, "Undefined symbol"),
   172       (MalformedInput, "Free Variable"),
   172       (MalformedInput, "Free Variable"),
   173       (SpassTooOld, "tptp2dfg")],
   173       (SpassTooOld, "tptp2dfg")],
   174    max_new_relevant_facts_per_iter = 35 (* FIXME *),
   174    default_max_relevant_per_iter = 35 (* FIXME *),
   175    prefers_theory_relevant = true,
   175    default_theory_relevant = true,
   176    explicit_forall = true}
   176    explicit_forall = true}
   177 
   177 
   178 val spass = ("spass", spass_config)
   178 val spass = ("spass", spass_config)
   179 
   179 
   180 
   180 
   196       (IncompleteUnprovable, "CANNOT PROVE"),
   196       (IncompleteUnprovable, "CANNOT PROVE"),
   197       (TimedOut, "SZS status Timeout"),
   197       (TimedOut, "SZS status Timeout"),
   198       (Unprovable, "Satisfiability detected"),
   198       (Unprovable, "Satisfiability detected"),
   199       (OutOfResources, "Refutation not found"),
   199       (OutOfResources, "Refutation not found"),
   200       (VampireTooOld, "not a valid option")],
   200       (VampireTooOld, "not a valid option")],
   201    max_new_relevant_facts_per_iter = 45 (* FIXME *),
   201    default_max_relevant_per_iter = 45 (* FIXME *),
   202    prefers_theory_relevant = false,
   202    default_theory_relevant = false,
   203    explicit_forall = false}
   203    explicit_forall = false}
   204 
   204 
   205 val vampire = ("vampire", vampire_config)
   205 val vampire = ("vampire", vampire_config)
   206 
   206 
   207 
   207 
   218            | NONE => perhaps (try (unsuffix "\n")) answer ^ ".")
   218            | NONE => perhaps (try (unsuffix "\n")) answer ^ ".")
   219 
   219 
   220 fun refresh_systems_on_tptp () =
   220 fun refresh_systems_on_tptp () =
   221   Synchronized.change systems (fn _ => get_systems ())
   221   Synchronized.change systems (fn _ => get_systems ())
   222 
   222 
   223 fun get_system prefix = Synchronized.change_result systems (fn systems =>
   223 fun get_system prefix =
   224   (if null systems then get_systems () else systems)
   224   Synchronized.change_result systems
   225   |> `(find_first (String.isPrefix prefix)));
   225       (fn systems => (if null systems then get_systems () else systems)
       
   226                      |> `(find_first (String.isPrefix prefix)))
   226 
   227 
   227 fun the_system prefix =
   228 fun the_system prefix =
   228   (case get_system prefix of
   229   (case get_system prefix of
   229     NONE => error ("System " ^ quote prefix ^ " not available at SystemOnTPTP.")
   230     NONE => error ("System " ^ quote prefix ^ " not available at SystemOnTPTP.")
   230   | SOME sys => sys);
   231   | SOME sys => sys);
   231 
   232 
   232 fun remote_config atp_prefix
   233 fun remote_config atp_prefix
   233         ({proof_delims, known_failures, max_new_relevant_facts_per_iter,
   234         ({proof_delims, known_failures, default_max_relevant_per_iter,
   234           prefers_theory_relevant, ...} : prover_config) : prover_config =
   235           default_theory_relevant, ...} : prover_config) : prover_config =
   235   {exec = ("ISABELLE_ATP", "scripts/remote_atp"),
   236   {exec = ("ISABELLE_ATP", "scripts/remote_atp"),
   236    required_execs = [],
   237    required_execs = [],
   237    arguments = fn _ => fn timeout =>
   238    arguments = fn _ => fn timeout =>
   238      " -t " ^ string_of_int (to_generous_secs timeout) ^ " -s " ^
   239      " -t " ^ string_of_int (to_generous_secs timeout) ^ " -s " ^
   239      the_system atp_prefix,
   240      the_system atp_prefix,
   240    proof_delims = insert (op =) tstp_proof_delims proof_delims,
   241    proof_delims = insert (op =) tstp_proof_delims proof_delims,
   241    known_failures =
   242    known_failures =
   242      known_failures @ known_perl_failures @
   243      known_failures @ known_perl_failures @
   243      [(TimedOut, "says Timeout")],
   244      [(TimedOut, "says Timeout")],
   244    max_new_relevant_facts_per_iter = max_new_relevant_facts_per_iter,
   245    default_max_relevant_per_iter = default_max_relevant_per_iter,
   245    prefers_theory_relevant = prefers_theory_relevant,
   246    default_theory_relevant = default_theory_relevant,
   246    explicit_forall = true}
   247    explicit_forall = true}
   247 
   248 
   248 val remote_name = prefix "remote_"
   249 val remote_name = prefix "remote_"
   249 fun remote_prover (name, config) atp_prefix =
   250 fun remote_prover (name, config) atp_prefix =
   250   (remote_name name, remote_config atp_prefix config)
   251   (remote_name name, remote_config atp_prefix config)