src/HOL/Tools/ATP_Manager/atp_systems.ML
changeset 38009 34e1ac9cb71d
parent 38005 b6555e9c5de4
child 38015 b30c3c2e1030
equal deleted inserted replaced
38008:7ff321103cd8 38009:34e1ac9cb71d
    49   {home_var: string,
    49   {home_var: string,
    50    executable: string,
    50    executable: string,
    51    arguments: bool -> Time.time -> string,
    51    arguments: bool -> Time.time -> string,
    52    proof_delims: (string * string) list,
    52    proof_delims: (string * string) list,
    53    known_failures: (failure * string) list,
    53    known_failures: (failure * string) list,
    54    max_axiom_clauses: int,
    54    max_new_relevant_facts_per_iter: int,
    55    prefers_theory_relevant: bool,
    55    prefers_theory_relevant: bool,
    56    explicit_forall: bool}
    56    explicit_forall: bool}
    57 
    57 
    58 
    58 
    59 (* basic template *)
    59 (* basic template *)
   343   #> parse_clause_formula_relation #> fst
   343   #> parse_clause_formula_relation #> fst
   344 
   344 
   345 fun repair_conjecture_shape_and_theorem_names output conjecture_shape
   345 fun repair_conjecture_shape_and_theorem_names output conjecture_shape
   346                                               thm_names =
   346                                               thm_names =
   347   if String.isSubstring set_ClauseFormulaRelationN output then
   347   if String.isSubstring set_ClauseFormulaRelationN output then
       
   348     (* This is a hack required for keeping track of axioms after they have been
       
   349        clausified by SPASS's Flotter tool. The "SPASS_TPTP" script is also part
       
   350        of this hack. *)
   348     let
   351     let
   349       val j0 = hd conjecture_shape
   352       val j0 = hd conjecture_shape
   350       val seq = extract_clause_sequence output
   353       val seq = extract_clause_sequence output
   351       val name_map = extract_clause_formula_relation output
   354       val name_map = extract_clause_formula_relation output
   352       fun renumber_conjecture j =
   355       fun renumber_conjecture j =
   367 
   370 
   368 (* generic TPTP-based provers *)
   371 (* generic TPTP-based provers *)
   369 
   372 
   370 fun generic_tptp_prover
   373 fun generic_tptp_prover
   371         (name, {home_var, executable, arguments, proof_delims, known_failures,
   374         (name, {home_var, executable, arguments, proof_delims, known_failures,
   372                 max_axiom_clauses, prefers_theory_relevant, explicit_forall})
   375                 max_new_relevant_facts_per_iter, prefers_theory_relevant,
       
   376                 explicit_forall})
   373         ({debug, overlord, full_types, explicit_apply, relevance_threshold,
   377         ({debug, overlord, full_types, explicit_apply, relevance_threshold,
   374           relevance_convergence, theory_relevant, defs_relevant, isar_proof,
   378           relevance_convergence, theory_relevant, defs_relevant, isar_proof,
   375           isar_shrink_factor, ...} : params)
   379           isar_shrink_factor, ...} : params)
   376         minimize_command timeout
   380         minimize_command timeout
   377         ({subgoal, goal, relevance_override, axiom_clauses, filtered_clauses}
   381         ({subgoal, goal, relevance_override, axiom_clauses, filtered_clauses}
   384     val (params, hyp_ts, concl_t) = strip_subgoal th subgoal
   388     val (params, hyp_ts, concl_t) = strip_subgoal th subgoal
   385     val the_filtered_clauses =
   389     val the_filtered_clauses =
   386       case filtered_clauses of
   390       case filtered_clauses of
   387         SOME fcls => fcls
   391         SOME fcls => fcls
   388       | NONE => relevant_facts full_types relevance_threshold
   392       | NONE => relevant_facts full_types relevance_threshold
   389                     relevance_convergence defs_relevant max_axiom_clauses
   393                     relevance_convergence defs_relevant
       
   394                     max_new_relevant_facts_per_iter
   390                     (the_default prefers_theory_relevant theory_relevant)
   395                     (the_default prefers_theory_relevant theory_relevant)
   391                     relevance_override goal hyp_ts concl_t
   396                     relevance_override goal hyp_ts concl_t
   392     val the_axiom_clauses = axiom_clauses |> the_default the_filtered_clauses
   397     val the_axiom_clauses = axiom_clauses |> the_default the_filtered_clauses
   393     val (internal_thm_names, clauses) =
   398     val (internal_thm_names, clauses) =
   394       prepare_clauses ctxt full_types hyp_ts concl_t the_axiom_clauses
   399       prepare_clauses ctxt full_types hyp_ts concl_t the_axiom_clauses
   527       (TimedOut, "time limit exceeded"),
   532       (TimedOut, "time limit exceeded"),
   528       (OutOfResources,
   533       (OutOfResources,
   529        "# Cannot determine problem status within resource limit"),
   534        "# Cannot determine problem status within resource limit"),
   530       (OutOfResources, "SZS status: ResourceOut"),
   535       (OutOfResources, "SZS status: ResourceOut"),
   531       (OutOfResources, "SZS status ResourceOut")],
   536       (OutOfResources, "SZS status ResourceOut")],
   532    max_axiom_clauses = 100,
   537    max_new_relevant_facts_per_iter = 80 (* FIXME *),
   533    prefers_theory_relevant = false,
   538    prefers_theory_relevant = false,
   534    explicit_forall = false}
   539    explicit_forall = false}
   535 val e = tptp_prover "e" e_config
   540 val e = tptp_prover "e" e_config
   536 
   541 
   537 
   542 
   552       (TimedOut, "SPASS beiseite: Ran out of time"),
   557       (TimedOut, "SPASS beiseite: Ran out of time"),
   553       (OutOfResources, "SPASS beiseite: Maximal number of loops exceeded"),
   558       (OutOfResources, "SPASS beiseite: Maximal number of loops exceeded"),
   554       (MalformedInput, "Undefined symbol"),
   559       (MalformedInput, "Undefined symbol"),
   555       (MalformedInput, "Free Variable"),
   560       (MalformedInput, "Free Variable"),
   556       (OldSpass, "tptp2dfg")],
   561       (OldSpass, "tptp2dfg")],
   557    max_axiom_clauses = 40,
   562    max_new_relevant_facts_per_iter = 26 (* FIXME *),
   558    prefers_theory_relevant = true,
   563    prefers_theory_relevant = true,
   559    explicit_forall = true}
   564    explicit_forall = true}
   560 val spass = tptp_prover "spass" spass_config
   565 val spass = tptp_prover "spass" spass_config
   561 
   566 
   562 (* Vampire *)
   567 (* Vampire *)
   574    known_failures =
   579    known_failures =
   575      [(Unprovable, "UNPROVABLE"),
   580      [(Unprovable, "UNPROVABLE"),
   576       (IncompleteUnprovable, "CANNOT PROVE"),
   581       (IncompleteUnprovable, "CANNOT PROVE"),
   577       (Unprovable, "Satisfiability detected"),
   582       (Unprovable, "Satisfiability detected"),
   578       (OutOfResources, "Refutation not found")],
   583       (OutOfResources, "Refutation not found")],
   579    max_axiom_clauses = 60,
   584    max_new_relevant_facts_per_iter = 40 (* FIXME *),
   580    prefers_theory_relevant = false,
   585    prefers_theory_relevant = false,
   581    explicit_forall = false}
   586    explicit_forall = false}
   582 val vampire = tptp_prover "vampire" vampire_config
   587 val vampire = tptp_prover "vampire" vampire_config
   583 
   588 
   584 (* Remote prover invocation via SystemOnTPTP *)
   589 (* Remote prover invocation via SystemOnTPTP *)
   608   [(CantConnect, "HTTP-Error"),
   613   [(CantConnect, "HTTP-Error"),
   609    (TimedOut, "says Timeout"),
   614    (TimedOut, "says Timeout"),
   610    (MalformedOutput, "Remote script could not extract proof")]
   615    (MalformedOutput, "Remote script could not extract proof")]
   611 
   616 
   612 fun remote_config atp_prefix args
   617 fun remote_config atp_prefix args
   613         ({proof_delims, known_failures, max_axiom_clauses,
   618         ({proof_delims, known_failures, max_new_relevant_facts_per_iter,
   614           prefers_theory_relevant, explicit_forall, ...} : prover_config)
   619           prefers_theory_relevant, explicit_forall, ...} : prover_config)
   615         : prover_config =
   620         : prover_config =
   616   {home_var = "ISABELLE_ATP_MANAGER",
   621   {home_var = "ISABELLE_ATP_MANAGER",
   617    executable = "SystemOnTPTP",
   622    executable = "SystemOnTPTP",
   618    arguments = fn _ => fn timeout =>
   623    arguments = fn _ => fn timeout =>
   619      args ^ " -t " ^ string_of_int (to_generous_secs timeout) ^ " -s " ^
   624      args ^ " -t " ^ string_of_int (to_generous_secs timeout) ^ " -s " ^
   620      the_system atp_prefix,
   625      the_system atp_prefix,
   621    proof_delims = insert (op =) tstp_proof_delims proof_delims,
   626    proof_delims = insert (op =) tstp_proof_delims proof_delims,
   622    known_failures = remote_known_failures @ known_failures,
   627    known_failures = remote_known_failures @ known_failures,
   623    max_axiom_clauses = max_axiom_clauses,
   628    max_new_relevant_facts_per_iter = max_new_relevant_facts_per_iter,
   624    prefers_theory_relevant = prefers_theory_relevant,
   629    prefers_theory_relevant = prefers_theory_relevant,
   625    explicit_forall = explicit_forall}
   630    explicit_forall = explicit_forall}
   626 
   631 
   627 fun remote_tptp_prover prover atp_prefix args config =
   632 fun remote_tptp_prover prover atp_prefix args config =
   628   tptp_prover (remotify (fst prover)) (remote_config atp_prefix args config)
   633   tptp_prover (remotify (fst prover)) (remote_config atp_prefix args config)