src/HOL/Tools/ATP_Manager/atp_wrapper.ML
changeset 36287 96f45c5ffb36
parent 36286 fa6d03d42aab
child 36289 f75b6a3e1450
equal deleted inserted replaced
36286:fa6d03d42aab 36287:96f45c5ffb36
    70     [] => if is_proof_well_formed proof then ""
    70     [] => if is_proof_well_formed proof then ""
    71           else "Error: The ATP output is ill-formed."
    71           else "Error: The ATP output is ill-formed."
    72   | (message :: _) => message
    72   | (message :: _) => message
    73 
    73 
    74 fun generic_prover overlord get_facts prepare write_file cmd args known_failures
    74 fun generic_prover overlord get_facts prepare write_file cmd args known_failures
    75         proof_text name ({debug, full_types, explicit_apply, ...} : params)
    75         supports_isar_proofs name
    76         minimize_command
    76         ({debug, full_types, explicit_apply, isar_proof, modulus, sorts, ...}
       
    77          : params) minimize_command
    77         ({subgoal, goal, relevance_override, axiom_clauses, filtered_clauses}
    78         ({subgoal, goal, relevance_override, axiom_clauses, filtered_clauses}
    78          : problem) =
    79          : problem) =
    79   let
    80   let
    80     (* get clauses and prepare them for writing *)
    81     (* get clauses and prepare them for writing *)
    81     val (ctxt, (chain_ths, th)) = goal;
    82     val (ctxt, (chain_ths, th)) = goal;
   165     (* Check for success and print out some information on failure. *)
   166     (* Check for success and print out some information on failure. *)
   166     val failure = find_known_failure known_failures proof;
   167     val failure = find_known_failure known_failures proof;
   167     val success = rc = 0 andalso failure = "";
   168     val success = rc = 0 andalso failure = "";
   168     val (message, relevant_thm_names) =
   169     val (message, relevant_thm_names) =
   169       if success then
   170       if success then
   170         proof_text ctxt minimize_command proof internal_thm_names th subgoal
   171         proof_text supports_isar_proofs isar_proof debug modulus sorts ctxt
       
   172                    (minimize_command, proof, internal_thm_names, th, subgoal)
   171       else if failure <> "" then
   173       else if failure <> "" then
   172         (failure ^ "\n", [])
   174         (failure ^ "\n", [])
   173       else
   175       else
   174         ("Unknown ATP error: " ^ proof ^ ".\n", [])
   176         ("Unknown ATP error: " ^ proof ^ ".\n", [])
   175   in
   177   in
   186 fun generic_tptp_prover
   188 fun generic_tptp_prover
   187         (name, {command, arguments, known_failures, max_new_clauses,
   189         (name, {command, arguments, known_failures, max_new_clauses,
   188                 prefers_theory_relevant, supports_isar_proofs})
   190                 prefers_theory_relevant, supports_isar_proofs})
   189         (params as {debug, overlord, respect_no_atp, relevance_threshold,
   191         (params as {debug, overlord, respect_no_atp, relevance_threshold,
   190                     convergence, theory_relevant, higher_order, follow_defs,
   192                     convergence, theory_relevant, higher_order, follow_defs,
   191                     isar_proof, modulus, sorts, ...})
   193                     isar_proof, ...})
   192         minimize_command timeout =
   194         minimize_command timeout =
   193   generic_prover overlord
   195   generic_prover overlord
   194       (get_relevant_facts respect_no_atp relevance_threshold convergence
   196       (get_relevant_facts respect_no_atp relevance_threshold convergence
   195                           higher_order follow_defs max_new_clauses
   197                           higher_order follow_defs max_new_clauses
   196                           (the_default prefers_theory_relevant theory_relevant))
   198                           (the_default prefers_theory_relevant theory_relevant))
   197       (prepare_clauses higher_order false)
   199       (prepare_clauses higher_order false)
   198       (write_tptp_file (debug andalso overlord andalso not isar_proof)) command
   200       (write_tptp_file (debug andalso overlord andalso not isar_proof)) command
   199       (arguments timeout) known_failures
   201       (arguments timeout) known_failures supports_isar_proofs
   200       (proof_text (supports_isar_proofs andalso isar_proof) debug modulus sorts)
       
   201       name params minimize_command
   202       name params minimize_command
   202 
   203 
   203 fun tptp_prover name p = (name, generic_tptp_prover (name, p));
   204 fun tptp_prover name p = (name, generic_tptp_prover (name, p));
   204 
   205 
   205 
   206 
   247 
   248 
   248 
   249 
   249 (* SPASS *)
   250 (* SPASS *)
   250 
   251 
   251 fun generic_dfg_prover
   252 fun generic_dfg_prover
   252         (name, ({command, arguments, known_failures, max_new_clauses,
   253         (name, {command, arguments, known_failures, max_new_clauses,
   253                  prefers_theory_relevant, ...} : prover_config))
   254                 prefers_theory_relevant, supports_isar_proofs})
   254         (params as {overlord, respect_no_atp, relevance_threshold, convergence,
   255         (params as {overlord, respect_no_atp, relevance_threshold, convergence,
   255                     theory_relevant, higher_order, follow_defs, ...})
   256                     theory_relevant, higher_order, follow_defs, ...})
   256         minimize_command timeout =
   257         minimize_command timeout =
   257   generic_prover overlord
   258   generic_prover overlord
   258       (get_relevant_facts respect_no_atp relevance_threshold convergence
   259       (get_relevant_facts respect_no_atp relevance_threshold convergence
   259                           higher_order follow_defs max_new_clauses
   260                           higher_order follow_defs max_new_clauses
   260                           (the_default prefers_theory_relevant theory_relevant))
   261                           (the_default prefers_theory_relevant theory_relevant))
   261       (prepare_clauses higher_order true) write_dfg_file command
   262       (prepare_clauses higher_order true) write_dfg_file command
   262       (arguments timeout) known_failures (K metis_proof_text)
   263       (arguments timeout) known_failures supports_isar_proofs name params
   263       name params minimize_command
   264       minimize_command
   264 
   265 
   265 fun dfg_prover name p = (name, generic_dfg_prover (name, p))
   266 fun dfg_prover name p = (name, generic_dfg_prover (name, p))
   266 
   267 
   267 (* The "-VarWeight=3" option helps the higher-order problems, probably by
   268 (* The "-VarWeight=3" option helps the higher-order problems, probably by
   268    counteracting the presence of "hAPP". *)
   269    counteracting the presence of "hAPP". *)