src/HOL/Tools/ATP/atp_systems.ML
changeset 48716 1d2a12bb0640
parent 48715 62928b793d8a
child 48720 95669b431edd
equal deleted inserted replaced
48715:62928b793d8a 48716:1d2a12bb0640
    20        -> term_order * (unit -> (string * int) list)
    20        -> term_order * (unit -> (string * int) list)
    21           * (unit -> (string * real) list) -> string,
    21           * (unit -> (string * real) list) -> string,
    22      proof_delims : (string * string) list,
    22      proof_delims : (string * string) list,
    23      known_failures : (failure * string) list,
    23      known_failures : (failure * string) list,
    24      prem_role : formula_role,
    24      prem_role : formula_role,
    25      best_slices :
    25      best_slices : Proof.context -> (real * (slice_spec * string)) list,
    26        Proof.context -> (real * (bool * (slice_spec * string))) list,
       
    27      best_max_mono_iters : int,
    26      best_max_mono_iters : int,
    28      best_max_new_mono_instances : int}
    27      best_max_new_mono_instances : int}
    29 
    28 
    30   val default_max_mono_iters : int
    29   val default_max_mono_iters : int
    31   val default_max_new_mono_instances : int
    30   val default_max_new_mono_instances : int
    93      -> term_order * (unit -> (string * int) list)
    92      -> term_order * (unit -> (string * int) list)
    94         * (unit -> (string * real) list) -> string,
    93         * (unit -> (string * real) list) -> string,
    95    proof_delims : (string * string) list,
    94    proof_delims : (string * string) list,
    96    known_failures : (failure * string) list,
    95    known_failures : (failure * string) list,
    97    prem_role : formula_role,
    96    prem_role : formula_role,
    98    best_slices : Proof.context -> (real * (bool * (slice_spec * string))) list,
    97    best_slices : Proof.context -> (real * (slice_spec * string)) list,
    99    best_max_mono_iters : int,
    98    best_max_mono_iters : int,
   100    best_max_new_mono_instances : int}
    99    best_max_new_mono_instances : int}
   101 
   100 
   102 (* "best_slices" must be found empirically, taking a wholistic approach since
   101 (* "best_slices" must be found empirically, taking a wholistic approach since
   103    the ATPs are run in parallel. The "real" component gives the faction of the
   102    the ATPs are run in parallel. The "real" component gives the faction of the
   104    time available given to the slice and should add up to 1.0. The first "bool"
   103    time available given to the slice and should add up to 1.0. The "int"
   105    component indicates whether the slice's strategy is complete; the "int", the
   104    component indicates the preferred number of facts to pass; the first
   106    preferred number of facts to pass; the first "string", the preferred type
   105    "string", the preferred type system (which should be sound or quasi-sound);
   107    system (which should be sound or quasi-sound); the second "string", the
   106    the second "string", the preferred lambda translation scheme; the "bool",
   108    preferred lambda translation scheme; the second "bool", whether uncurried
   107    whether uncurried aliased should be generated; the third "string", extra
   109    aliased should be generated; the third "string", extra information to
   108    information to the prover (e.g., SOS or no SOS).
   110    the prover (e.g., SOS or no SOS).
       
   111 
   109 
   112    The last slice should be the most "normal" one, because it will get all the
   110    The last slice should be the most "normal" one, because it will get all the
   113    time available if the other slices fail early and also because it is used if
   111    time available if the other slices fail early and also because it is used if
   114    slicing is disabled (e.g., by the minimizer). *)
   112    slicing is disabled (e.g., by the minimizer). *)
   115 
   113 
   200       (TimedOut, ": Timeout"),
   198       (TimedOut, ": Timeout"),
   201       (GaveUp, ": Unknown")],
   199       (GaveUp, ": Unknown")],
   202    prem_role = Hypothesis,
   200    prem_role = Hypothesis,
   203    best_slices = fn _ =>
   201    best_slices = fn _ =>
   204      (* FUDGE *)
   202      (* FUDGE *)
   205      [(1.0, (false, ((100, alt_ergo_tff1, "poly_native", liftingN, false), "")))],
   203      [(1.0, ((100, alt_ergo_tff1, "poly_native", liftingN, false), ""))],
   206    best_max_mono_iters = default_max_mono_iters,
   204    best_max_mono_iters = default_max_mono_iters,
   207    best_max_new_mono_instances = default_max_new_mono_instances}
   205    best_max_new_mono_instances = default_max_new_mono_instances}
   208 
   206 
   209 val alt_ergo = (alt_ergoN, fn () => alt_ergo_config)
   207 val alt_ergo = (alt_ergoN, fn () => alt_ergo_config)
   210 
   208 
   318    prem_role = Conjecture,
   316    prem_role = Conjecture,
   319    best_slices = fn ctxt =>
   317    best_slices = fn ctxt =>
   320      let val heuristic = effective_e_selection_heuristic ctxt in
   318      let val heuristic = effective_e_selection_heuristic ctxt in
   321        (* FUDGE *)
   319        (* FUDGE *)
   322        if heuristic = e_smartN then
   320        if heuristic = e_smartN then
   323          [(0.333, (true, ((500, FOF, "mono_tags??", combsN, false), e_fun_weightN))),
   321          [(0.333, ((500, FOF, "mono_tags??", combsN, false), e_fun_weightN)),
   324           (0.334, (true, ((50, FOF, "mono_guards??", combsN, false), e_fun_weightN))),
   322           (0.334, ((50, FOF, "mono_guards??", combsN, false), e_fun_weightN)),
   325           (0.333, (true, ((1000, FOF, "mono_tags??", combsN, false), e_sym_offset_weightN)))]
   323           (0.333, ((1000, FOF, "mono_tags??", combsN, false), e_sym_offset_weightN))]
   326        else
   324        else
   327          [(1.0, (true, ((500, FOF, "mono_tags??", combsN, false), heuristic)))]
   325          [(1.0, ((500, FOF, "mono_tags??", combsN, false), heuristic))]
   328      end,
   326      end,
   329    best_max_mono_iters = default_max_mono_iters,
   327    best_max_mono_iters = default_max_mono_iters,
   330    best_max_new_mono_instances = default_max_new_mono_instances}
   328    best_max_new_mono_instances = default_max_new_mono_instances}
   331 
   329 
   332 val e = (eN, fn () => e_config)
   330 val e = (eN, fn () => e_config)
   341    proof_delims = tstp_proof_delims,
   339    proof_delims = tstp_proof_delims,
   342    known_failures = #known_failures e_config,
   340    known_failures = #known_failures e_config,
   343    prem_role = Conjecture,
   341    prem_role = Conjecture,
   344    best_slices =
   342    best_slices =
   345      (* FUDGE *)
   343      (* FUDGE *)
   346      K [(1.0, (true, ((1000, FOF, "mono_tags??", combsN, false), "")))],
   344      K [(1.0, ((1000, FOF, "mono_tags??", combsN, false), ""))],
   347    best_max_mono_iters = default_max_mono_iters,
   345    best_max_mono_iters = default_max_mono_iters,
   348    best_max_new_mono_instances = default_max_new_mono_instances}
   346    best_max_new_mono_instances = default_max_new_mono_instances}
   349 
   347 
   350 val e_males = (e_malesN, fn () => e_males_config)
   348 val e_males = (e_malesN, fn () => e_males_config)
   351 
   349 
   362      [(ProofIncomplete, "% SZS output start CNFRefutation")] @
   360      [(ProofIncomplete, "% SZS output start CNFRefutation")] @
   363      known_szs_status_failures,
   361      known_szs_status_failures,
   364    prem_role = Hypothesis,
   362    prem_role = Hypothesis,
   365    best_slices =
   363    best_slices =
   366      (* FUDGE *)
   364      (* FUDGE *)
   367      K [(1.0, (true, ((150, FOF, "mono_guards??", liftingN, false), "")))],
   365      K [(1.0, ((150, FOF, "mono_guards??", liftingN, false), ""))],
   368    best_max_mono_iters = default_max_mono_iters,
   366    best_max_mono_iters = default_max_mono_iters,
   369    best_max_new_mono_instances = default_max_new_mono_instances}
   367    best_max_new_mono_instances = default_max_new_mono_instances}
   370 
   368 
   371 val iprover = (iproverN, fn () => iprover_config)
   369 val iprover = (iproverN, fn () => iprover_config)
   372 
   370 
   405       (GaveUp, "No.of.Axioms")] @
   403       (GaveUp, "No.of.Axioms")] @
   406      known_szs_status_failures,
   404      known_szs_status_failures,
   407    prem_role = Hypothesis,
   405    prem_role = Hypothesis,
   408    best_slices =
   406    best_slices =
   409      (* FUDGE *)
   407      (* FUDGE *)
   410      K [(1.0, (true, ((40, leo2_thf0, "mono_native_higher", keep_lamsN, false), "")))],
   408      K [(1.0, ((40, leo2_thf0, "mono_native_higher", keep_lamsN, false), ""))],
   411    best_max_mono_iters = default_max_mono_iters - 1 (* FUDGE *),
   409    best_max_mono_iters = default_max_mono_iters - 1 (* FUDGE *),
   412    best_max_new_mono_instances = default_max_new_mono_instances div 2 (* FUDGE *)}
   410    best_max_new_mono_instances = default_max_new_mono_instances div 2 (* FUDGE *)}
   413 
   411 
   414 val leo2 = (leo2N, fn () => leo2_config)
   412 val leo2 = (leo2N, fn () => leo2_config)
   415 
   413 
   427      [("% Higher-Order Unsat Core BEGIN", "% Higher-Order Unsat Core END")],
   425      [("% Higher-Order Unsat Core BEGIN", "% Higher-Order Unsat Core END")],
   428    known_failures = known_szs_status_failures,
   426    known_failures = known_szs_status_failures,
   429    prem_role = Hypothesis,
   427    prem_role = Hypothesis,
   430    best_slices =
   428    best_slices =
   431      (* FUDGE *)
   429      (* FUDGE *)
   432      K [(1.0, (true, ((60, satallax_thf0, "mono_native_higher", keep_lamsN, false), "")))],
   430      K [(1.0, ((60, satallax_thf0, "mono_native_higher", keep_lamsN, false), ""))],
   433    best_max_mono_iters = default_max_mono_iters - 1 (* FUDGE *),
   431    best_max_mono_iters = default_max_mono_iters - 1 (* FUDGE *),
   434    best_max_new_mono_instances = default_max_new_mono_instances div 2 (* FUDGE *)}
   432    best_max_new_mono_instances = default_max_new_mono_instances div 2 (* FUDGE *)}
   435 
   433 
   436 val satallax = (satallaxN, fn () => satallax_config)
   434 val satallax = (satallaxN, fn () => satallax_config)
   437 
   435 
   462       (InternalError, "Please report this error")] @
   460       (InternalError, "Please report this error")] @
   463       known_perl_failures,
   461       known_perl_failures,
   464    prem_role = Conjecture,
   462    prem_role = Conjecture,
   465    best_slices = fn _ =>
   463    best_slices = fn _ =>
   466      (* FUDGE *)
   464      (* FUDGE *)
   467      [(0.1667, (false, ((150, DFG Monomorphic, "mono_native", combsN, true), ""))),
   465      [(0.1667, ((150, DFG Monomorphic, "mono_native", combsN, true), "")),
   468       (0.1667, (false, ((500, DFG Monomorphic, "mono_native", liftingN, true), spass_H2SOS))),
   466       (0.1667, ((500, DFG Monomorphic, "mono_native", liftingN, true), spass_H2SOS)),
   469       (0.1666, (false, ((50, DFG Monomorphic,  "mono_native", liftingN, true), spass_H2LR0LT0))),
   467       (0.1666, ((50, DFG Monomorphic,  "mono_native", liftingN, true), spass_H2LR0LT0)),
   470       (0.1000, (false, ((250, DFG Monomorphic, "mono_native", combsN, true), spass_H2NuVS0))),
   468       (0.1000, ((250, DFG Monomorphic, "mono_native", combsN, true), spass_H2NuVS0)),
   471       (0.1000, (false, ((1000, DFG Monomorphic, "mono_native", liftingN, true), spass_H1SOS))),
   469       (0.1000, ((1000, DFG Monomorphic, "mono_native", liftingN, true), spass_H1SOS)),
   472       (0.1000, (false, ((150, DFG Monomorphic, "poly_guards??", liftingN, false), spass_H2NuVS0Red2))),
   470       (0.1000, ((150, DFG Monomorphic, "poly_guards??", liftingN, false), spass_H2NuVS0Red2)),
   473       (0.1000, (false, ((300, DFG Monomorphic, "mono_native", combsN, true), spass_H2SOS))),
   471       (0.1000, ((300, DFG Monomorphic, "mono_native", combsN, true), spass_H2SOS)),
   474       (0.1000, (false, ((100, DFG Monomorphic, "mono_native", combs_and_liftingN, true), "")))],
   472       (0.1000, ((100, DFG Monomorphic, "mono_native", combs_and_liftingN, true), ""))],
   475    best_max_mono_iters = default_max_mono_iters,
   473    best_max_mono_iters = default_max_mono_iters,
   476    best_max_new_mono_instances = default_max_new_mono_instances}
   474    best_max_new_mono_instances = default_max_new_mono_instances}
   477 
   475 
   478 val spass = (spassN, fn () => spass_config)
   476 val spass = (spassN, fn () => spass_config)
   479 
   477 
   513      known_szs_status_failures,
   511      known_szs_status_failures,
   514    prem_role = Conjecture,
   512    prem_role = Conjecture,
   515    best_slices = fn ctxt =>
   513    best_slices = fn ctxt =>
   516      (* FUDGE *)
   514      (* FUDGE *)
   517      (if is_vampire_beyond_1_8 () then
   515      (if is_vampire_beyond_1_8 () then
   518         [(0.333, (false, ((500, vampire_tff0, "mono_native", combs_or_liftingN, false), sosN))),
   516         [(0.333, ((500, vampire_tff0, "mono_native", combs_or_liftingN, false), sosN)),
   519          (0.333, (false, ((150, vampire_tff0, "poly_guards??", combs_or_liftingN, false), sosN))),
   517          (0.333, ((150, vampire_tff0, "poly_guards??", combs_or_liftingN, false), sosN)),
   520          (0.334, (true, ((50, vampire_tff0, "mono_native", combs_or_liftingN, false), no_sosN)))]
   518          (0.334, ((50, vampire_tff0, "mono_native", combs_or_liftingN, false), no_sosN))]
   521       else
   519       else
   522         [(0.333, (false, ((150, FOF, "poly_guards??", combs_or_liftingN, false), sosN))),
   520         [(0.333, ((150, FOF, "poly_guards??", combs_or_liftingN, false), sosN)),
   523          (0.333, (false, ((500, FOF, "mono_tags??", combs_or_liftingN, false), sosN))),
   521          (0.333, ((500, FOF, "mono_tags??", combs_or_liftingN, false), sosN)),
   524          (0.334, (true, ((50, FOF, "mono_guards??", combs_or_liftingN, false), no_sosN)))])
   522          (0.334, ((50, FOF, "mono_guards??", combs_or_liftingN, false), no_sosN))])
   525      |> (if Config.get ctxt force_sos then hd #> apfst (K 1.0) #> single
   523      |> (if Config.get ctxt force_sos then hd #> apfst (K 1.0) #> single
   526          else I),
   524          else I),
   527    best_max_mono_iters = default_max_mono_iters,
   525    best_max_mono_iters = default_max_mono_iters,
   528    best_max_new_mono_instances = default_max_new_mono_instances}
   526    best_max_new_mono_instances = default_max_new_mono_instances}
   529 
   527 
   542    proof_delims = [("\ncore(", ").")],
   540    proof_delims = [("\ncore(", ").")],
   543    known_failures = known_szs_status_failures,
   541    known_failures = known_szs_status_failures,
   544    prem_role = Hypothesis,
   542    prem_role = Hypothesis,
   545    best_slices =
   543    best_slices =
   546      (* FUDGE *)
   544      (* FUDGE *)
   547      K [(0.5, (false, ((250, z3_tff0, "mono_native", combsN, false), ""))),
   545      K [(0.5, ((250, z3_tff0, "mono_native", combsN, false), "")),
   548         (0.25, (false, ((125, z3_tff0, "mono_native", combsN, false), ""))),
   546         (0.25, ((125, z3_tff0, "mono_native", combsN, false), "")),
   549         (0.125, (false, ((62, z3_tff0, "mono_native", combsN, false), ""))),
   547         (0.125, ((62, z3_tff0, "mono_native", combsN, false), "")),
   550         (0.125, (false, ((31, z3_tff0, "mono_native", combsN, false), "")))],
   548         (0.125, ((31, z3_tff0, "mono_native", combsN, false), ""))],
   551    best_max_mono_iters = default_max_mono_iters,
   549    best_max_mono_iters = default_max_mono_iters,
   552    best_max_new_mono_instances = default_max_new_mono_instances}
   550    best_max_new_mono_instances = default_max_new_mono_instances}
   553 
   551 
   554 val z3_tptp = (z3_tptpN, fn () => z3_tptp_config)
   552 val z3_tptp = (z3_tptpN, fn () => z3_tptp_config)
   555 
   553 
   561    arguments = K (K (K (K (K "")))),
   559    arguments = K (K (K (K (K "")))),
   562    proof_delims = [],
   560    proof_delims = [],
   563    known_failures = known_szs_status_failures,
   561    known_failures = known_szs_status_failures,
   564    prem_role = Hypothesis,
   562    prem_role = Hypothesis,
   565    best_slices =
   563    best_slices =
   566      K [(1.0, (false, ((200, format, type_enc,
   564      K [(1.0, ((200, format, type_enc,
   567                         if is_format_higher_order format then keep_lamsN
   565                 if is_format_higher_order format then keep_lamsN
   568                         else combsN, false), "")))],
   566                 else combsN, false), ""))],
   569    best_max_mono_iters = default_max_mono_iters,
   567    best_max_mono_iters = default_max_mono_iters,
   570    best_max_new_mono_instances = default_max_new_mono_instances}
   568    best_max_new_mono_instances = default_max_new_mono_instances}
   571 
   569 
   572 val dummy_thf_format =
   570 val dummy_thf_format =
   573   THF (Polymorphic, TPTP_Explicit, THF_With_Choice, THF_With_Defs)
   571   THF (Polymorphic, TPTP_Explicit, THF_With_Choice, THF_With_Defs)
   626        "-s " ^ the_system system_name system_versions ^ " " ^
   624        "-s " ^ the_system system_name system_versions ^ " " ^
   627        "-t " ^ string_of_int (Int.min (max_remote_secs, to_secs 1 timeout)),
   625        "-t " ^ string_of_int (Int.min (max_remote_secs, to_secs 1 timeout)),
   628    proof_delims = union (op =) tstp_proof_delims proof_delims,
   626    proof_delims = union (op =) tstp_proof_delims proof_delims,
   629    known_failures = known_failures @ known_perl_failures @ known_says_failures,
   627    known_failures = known_failures @ known_perl_failures @ known_says_failures,
   630    prem_role = prem_role,
   628    prem_role = prem_role,
   631    best_slices = fn ctxt => [(1.0, (false, best_slice ctxt))],
   629    best_slices = fn ctxt => [(1.0, best_slice ctxt)],
   632    best_max_mono_iters = default_max_mono_iters,
   630    best_max_mono_iters = default_max_mono_iters,
   633    best_max_new_mono_instances = default_max_new_mono_instances}
   631    best_max_new_mono_instances = default_max_new_mono_instances}
   634 
   632 
   635 fun remotify_config system_name system_versions best_slice
   633 fun remotify_config system_name system_versions best_slice
   636         ({proof_delims, known_failures, prem_role, ...} : atp_config)
   634         ({proof_delims, known_failures, prem_role, ...} : atp_config)