src/HOL/Tools/ATP/atp_systems.ML
changeset 44431 b342cd125533
parent 44429 dda3e38cc351
child 44437 cfb2077cb2db
equal deleted inserted replaced
44430:3e4889375781 44431:b342cd125533
    21      known_failures : (failure * string) list,
    21      known_failures : (failure * string) list,
    22      conj_sym_kind : formula_kind,
    22      conj_sym_kind : formula_kind,
    23      prem_kind : formula_kind,
    23      prem_kind : formula_kind,
    24      formats : format list,
    24      formats : format list,
    25      best_slices :
    25      best_slices :
    26        Proof.context -> (real * (bool * (int * string list * string))) list}
    26        Proof.context -> (real * (bool * (int * string * string))) list}
    27 
    27 
    28   val e_smartN : string
    28   val e_smartN : string
    29   val e_autoN : string
    29   val e_autoN : string
    30   val e_fun_weightN : string
    30   val e_fun_weightN : string
    31   val e_sym_offset_weightN : string
    31   val e_sym_offset_weightN : string
    50   val z3_atpN : string
    50   val z3_atpN : string
    51   val remote_prefix : string
    51   val remote_prefix : string
    52   val remote_atp :
    52   val remote_atp :
    53     string -> string -> string list -> (string * string) list
    53     string -> string -> string list -> (string * string) list
    54     -> (failure * string) list -> formula_kind -> formula_kind -> format list
    54     -> (failure * string) list -> formula_kind -> formula_kind -> format list
    55     -> (Proof.context -> int * string list) -> string * atp_config
    55     -> (Proof.context -> int * string) -> string * atp_config
    56   val add_atp : string * atp_config -> theory -> theory
    56   val add_atp : string * atp_config -> theory -> theory
    57   val get_atp : theory -> string -> atp_config
    57   val get_atp : theory -> string -> atp_config
    58   val supported_atps : theory -> string list
    58   val supported_atps : theory -> string list
    59   val is_atp_installed : theory -> string -> bool
    59   val is_atp_installed : theory -> string -> bool
    60   val refresh_systems_on_tptp : unit -> unit
    60   val refresh_systems_on_tptp : unit -> unit
    79    known_failures : (failure * string) list,
    79    known_failures : (failure * string) list,
    80    conj_sym_kind : formula_kind,
    80    conj_sym_kind : formula_kind,
    81    prem_kind : formula_kind,
    81    prem_kind : formula_kind,
    82    formats : format list,
    82    formats : format list,
    83    best_slices :
    83    best_slices :
    84      Proof.context -> (real * (bool * (int * string list * string))) list}
    84      Proof.context -> (real * (bool * (int * string * string))) list}
    85 
    85 
    86 (* "best_slices" must be found empirically, taking a wholistic approach since
    86 (* "best_slices" must be found empirically, taking a wholistic approach since
    87    the ATPs are run in parallel. The "real" components give the faction of the
    87    the ATPs are run in parallel. The "real" components give the faction of the
    88    time available given to the slice; these should add up to 1.0. The "bool"
    88    time available given to the slice and should add up to 1.0. The "bool"
    89    component indicates whether the slice's strategy is complete; the "int", the
    89    component indicates whether the slice's strategy is complete; the "int", the
    90    preferred number of facts to pass; the "string list", the preferred type
    90    preferred number of facts to pass; the first "string", the preferred type
    91    systems, which should be of the form [sound] or [unsound, sound], where
    91    system; the second "string", extra information to the prover (e.g., SOS or no
    92    "sound" is a sound type system and "unsound" is an unsound one.
    92    SOS).
    93 
    93 
    94    The last slice should be the most "normal" one, because it will get all the
    94    The last slice should be the most "normal" one, because it will get all the
    95    time available if the other slices fail early and also because it is used for
    95    time available if the other slices fail early and also because it is used if
    96    remote provers and if slicing is disabled. *)
    96    slicing is disabled (e.g., by the minimizer). *)
    97 
    97 
    98 val known_perl_failures =
    98 val known_perl_failures =
    99   [(CantConnect, "HTTP error"),
    99   [(CantConnect, "HTTP error"),
   100    (NoPerl, "env: perl"),
   100    (NoPerl, "env: perl"),
   101    (NoLibwwwPerl, "Can't locate HTTP")]
   101    (NoLibwwwPerl, "Can't locate HTTP")]
   215    formats = [FOF],
   215    formats = [FOF],
   216    best_slices = fn ctxt =>
   216    best_slices = fn ctxt =>
   217      let val method = effective_e_weight_method ctxt in
   217      let val method = effective_e_weight_method ctxt in
   218        (* FUDGE *)
   218        (* FUDGE *)
   219        if method = e_smartN then
   219        if method = e_smartN then
   220          [(0.333, (true, (500, ["mangled_tags?"], e_fun_weightN))),
   220          [(0.333, (true, (500, "mangled_tags?", e_fun_weightN))),
   221           (0.334, (true, (50, ["mangled_preds?"], e_fun_weightN))),
   221           (0.334, (true, (50, "mangled_preds?", e_fun_weightN))),
   222           (0.333, (true, (1000, ["mangled_tags?"], e_sym_offset_weightN)))]
   222           (0.333, (true, (1000, "mangled_tags?", e_sym_offset_weightN)))]
   223        else
   223        else
   224          [(1.0, (true, (500, ["mangled_tags?"], method)))]
   224          [(1.0, (true, (500, "mangled_tags?", method)))]
   225      end}
   225      end}
   226 
   226 
   227 val e = (eN, e_config)
   227 val e = (eN, e_config)
   228 
   228 
   229 
   229 
   235 (* The "-VarWeight=3" option helps the higher-order problems, probably by
   235 (* The "-VarWeight=3" option helps the higher-order problems, probably by
   236    counteracting the presence of "hAPP". *)
   236    counteracting the presence of "hAPP". *)
   237 val spass_config : atp_config =
   237 val spass_config : atp_config =
   238   {exec = ("ISABELLE_ATP", "scripts/spass"),
   238   {exec = ("ISABELLE_ATP", "scripts/spass"),
   239    required_execs = [("SPASS_HOME", "SPASS"), ("SPASS_HOME", "tptp2dfg")],
   239    required_execs = [("SPASS_HOME", "SPASS"), ("SPASS_HOME", "tptp2dfg")],
   240    arguments = fn ctxt => fn _ => fn sos => fn timeout => fn _ =>
   240    arguments = fn _ => fn _ => fn sos => fn timeout => fn _ =>
   241      ("-Auto -PGiven=0 -PProblem=0 -Splits=0 -FullRed=0 -DocProof \
   241      ("-Auto -PGiven=0 -PProblem=0 -Splits=0 -FullRed=0 -DocProof \
   242       \-VarWeight=3 -TimeLimit=" ^ string_of_int (to_secs timeout))
   242       \-VarWeight=3 -TimeLimit=" ^ string_of_int (to_secs timeout))
   243      |> sos = sosN ? prefix "-SOS=1 ",
   243      |> sos = sosN ? prefix "-SOS=1 ",
   244    proof_delims = [("Here is a proof", "Formulae used in the proof")],
   244    proof_delims = [("Here is a proof", "Formulae used in the proof")],
   245    known_failures =
   245    known_failures =
   254    conj_sym_kind = Hypothesis,
   254    conj_sym_kind = Hypothesis,
   255    prem_kind = Conjecture,
   255    prem_kind = Conjecture,
   256    formats = [FOF],
   256    formats = [FOF],
   257    best_slices = fn ctxt =>
   257    best_slices = fn ctxt =>
   258      (* FUDGE *)
   258      (* FUDGE *)
   259      [(0.333, (false, (150, ["mangled_tags"], sosN))),
   259      [(0.333, (false, (150, "mangled_tags", sosN))),
   260       (0.333, (false, (300, ["poly_tags?"], sosN))),
   260       (0.333, (false, (300, "poly_tags?", sosN))),
   261       (0.334, (true, (50, ["mangled_tags?"], no_sosN)))]
   261       (0.334, (true, (50, "mangled_tags?", no_sosN)))]
   262      |> (if Config.get ctxt spass_force_sos then hd #> apfst (K 1.0) #> single
   262      |> (if Config.get ctxt spass_force_sos then hd #> apfst (K 1.0) #> single
   263          else I)}
   263          else I)}
   264 
   264 
   265 val spass = (spassN, spass_config)
   265 val spass = (spassN, spass_config)
   266 
   266 
   271   Attrib.setup_config_bool @{binding atp_vampire_force_sos} (K false)
   271   Attrib.setup_config_bool @{binding atp_vampire_force_sos} (K false)
   272 
   272 
   273 val vampire_config : atp_config =
   273 val vampire_config : atp_config =
   274   {exec = ("VAMPIRE_HOME", "vampire"),
   274   {exec = ("VAMPIRE_HOME", "vampire"),
   275    required_execs = [],
   275    required_execs = [],
   276    arguments = fn ctxt => fn _ => fn sos => fn timeout => fn _ =>
   276    arguments = fn _ => fn _ => fn sos => fn timeout => fn _ =>
   277      "--proof tptp --mode casc -t " ^ string_of_int (to_secs timeout) ^
   277      "--proof tptp --mode casc -t " ^ string_of_int (to_secs timeout) ^
   278      " --thanks \"Andrei and Krystof\" --input_file"
   278      " --thanks \"Andrei and Krystof\" --input_file"
   279      |> sos = sosN ? prefix "--sos on ",
   279      |> sos = sosN ? prefix "--sos on ",
   280    proof_delims =
   280    proof_delims =
   281      [("=========== Refutation ==========",
   281      [("=========== Refutation ==========",
   295    conj_sym_kind = Conjecture,
   295    conj_sym_kind = Conjecture,
   296    prem_kind = Conjecture,
   296    prem_kind = Conjecture,
   297    formats = [FOF],
   297    formats = [FOF],
   298    best_slices = fn ctxt =>
   298    best_slices = fn ctxt =>
   299      (* FUDGE *)
   299      (* FUDGE *)
   300      [(0.333, (false, (150, ["poly_preds"], sosN))),
   300      [(0.333, (false, (150, "poly_preds", sosN))),
   301       (0.334, (true, (50, ["mangled_preds?"], no_sosN))),
   301       (0.334, (true, (50, "mangled_preds?", no_sosN))),
   302       (0.333, (false, (500, ["mangled_tags?"], sosN)))]
   302       (0.333, (false, (500, "mangled_tags?", sosN)))]
   303      |> (if Config.get ctxt vampire_force_sos then hd #> apfst (K 1.0) #> single
   303      |> (if Config.get ctxt vampire_force_sos then hd #> apfst (K 1.0) #> single
   304          else I)}
   304          else I)}
   305 
   305 
   306 val vampire = (vampireN, vampire_config)
   306 val vampire = (vampireN, vampire_config)
   307 
   307 
   323    conj_sym_kind = Hypothesis,
   323    conj_sym_kind = Hypothesis,
   324    prem_kind = Hypothesis,
   324    prem_kind = Hypothesis,
   325    formats = [FOF],
   325    formats = [FOF],
   326    best_slices =
   326    best_slices =
   327      (* FUDGE (FIXME) *)
   327      (* FUDGE (FIXME) *)
   328      K [(1.0, (false, (250, [], "")))]}
   328      K [(1.0, (false, (250, "mangled_preds?", "")))]}
   329 
   329 
   330 val z3_atp = (z3_atpN, z3_atp_config)
   330 val z3_atp = (z3_atpN, z3_atp_config)
   331 
   331 
   332 
   332 
   333 (* Remote ATP invocation via SystemOnTPTP *)
   333 (* Remote ATP invocation via SystemOnTPTP *)
   383       (Inappropriate, "says Inappropriate")],
   383       (Inappropriate, "says Inappropriate")],
   384    conj_sym_kind = conj_sym_kind,
   384    conj_sym_kind = conj_sym_kind,
   385    prem_kind = prem_kind,
   385    prem_kind = prem_kind,
   386    formats = formats,
   386    formats = formats,
   387    best_slices = fn ctxt =>
   387    best_slices = fn ctxt =>
   388      let val (max_relevant, type_syss) = best_slice ctxt in
   388      let val (max_relevant, type_sys) = best_slice ctxt in
   389        [(1.0, (false, (max_relevant, type_syss, "")))]
   389        [(1.0, (false, (max_relevant, type_sys, "")))]
   390      end}
   390      end}
   391 
   391 
   392 fun remotify_config system_name system_versions best_slice
   392 fun remotify_config system_name system_versions best_slice
   393         ({proof_delims, known_failures, conj_sym_kind, prem_kind, formats, ...}
   393         ({proof_delims, known_failures, conj_sym_kind, prem_kind, formats, ...}
   394          : atp_config) : atp_config =
   394          : atp_config) : atp_config =
   404   (remote_prefix ^ name,
   404   (remote_prefix ^ name,
   405    remotify_config system_name system_versions best_slice config)
   405    remotify_config system_name system_versions best_slice config)
   406 
   406 
   407 val remote_e =
   407 val remote_e =
   408   remotify_atp e "EP" ["1.0", "1.1", "1.2"]
   408   remotify_atp e "EP" ["1.0", "1.1", "1.2"]
   409                (K (750, ["mangled_tags?"]) (* FUDGE *))
   409                (K (750, "mangled_tags?") (* FUDGE *))
   410 val remote_vampire =
   410 val remote_vampire =
   411   remotify_atp vampire "Vampire" ["0.6", "9.0", "1.0"]
   411   remotify_atp vampire "Vampire" ["0.6", "9.0", "1.0"]
   412                (K (200, ["mangled_preds?"]) (* FUDGE *))
   412                (K (200, "mangled_preds?") (* FUDGE *))
   413 val remote_z3_atp =
   413 val remote_z3_atp =
   414   remotify_atp z3_atp "Z3" ["2.18"] (K (250, ["mangled_preds?"]) (* FUDGE *))
   414   remotify_atp z3_atp "Z3" ["2.18"] (K (250, "mangled_preds?") (* FUDGE *))
   415 val remote_leo2 =
   415 val remote_leo2 =
   416   remote_atp leo2N "LEO-II" ["1.2.6"] [] [] Axiom Hypothesis [THF]
   416   remote_atp leo2N "LEO-II" ["1.2.6"] [] [] Axiom Hypothesis [THF]
   417              (K (100, ["simple"]) (* FUDGE *))
   417              (K (100, "simple") (* FUDGE *))
   418 val remote_satallax =
   418 val remote_satallax =
   419   remote_atp satallaxN "Satallax" ["2.0"] [] [] Axiom Hypothesis [THF]
   419   remote_atp satallaxN "Satallax" ["2.0"] [] [] Axiom Hypothesis [THF]
   420              (K (64, ["simple"]) (* FUDGE *))
   420              (K (64, "simple") (* FUDGE *))
   421 val remote_sine_e =
   421 val remote_sine_e =
   422   remote_atp sine_eN "SInE" ["0.4"] [] (#known_failures e_config)
   422   remote_atp sine_eN "SInE" ["0.4"] [] (#known_failures e_config) Axiom
   423              Axiom Conjecture [FOF]
   423              Conjecture [FOF] (K (500, "mangled_preds?") (* FUDGE *))
   424              (K (500, ["mangled_preds?"]) (* FUDGE *))
       
   425 val remote_snark =
   424 val remote_snark =
   426   remote_atp snarkN "SNARK" ["20080805r029", "20080805r024"]
   425   remote_atp snarkN "SNARK" ["20080805r029", "20080805r024"]
   427              [("refutation.", "end_refutation.")] [] Hypothesis Hypothesis
   426              [("refutation.", "end_refutation.")] [] Hypothesis Hypothesis
   428              [TFF, FOF] (K (100, ["simple"]) (* FUDGE *))
   427              [TFF, FOF] (K (100, "simple") (* FUDGE *))
   429 val remote_tofof_e =
   428 val remote_tofof_e =
   430   remote_atp tofof_eN "ToFoF" ["0.1"] [] (#known_failures e_config)
   429   remote_atp tofof_eN "ToFoF" ["0.1"] [] (#known_failures e_config)
   431              Axiom Hypothesis [TFF] (K (150, ["simple"]) (* FUDGE *))
   430              Axiom Hypothesis [TFF] (K (150, "simple") (* FUDGE *))
   432 val remote_waldmeister =
   431 val remote_waldmeister =
   433   remote_atp waldmeisterN "Waldmeister" ["710"]
   432   remote_atp waldmeisterN "Waldmeister" ["710"]
   434              [("#START OF PROOF", "Proved Goals:")]
   433              [("#START OF PROOF", "Proved Goals:")]
   435              [(OutOfResources, "Too many function symbols"),
   434              [(OutOfResources, "Too many function symbols"),
   436               (Crashed, "Unrecoverable Segmentation Fault")]
   435               (Crashed, "Unrecoverable Segmentation Fault")]
   437              Hypothesis Hypothesis [CNF_UEQ]
   436              Hypothesis Hypothesis [CNF_UEQ]
   438              (K (50, ["mangled_tags?"]) (* FUDGE *))
   437              (K (50, "mangled_tags?") (* FUDGE *))
   439 
   438 
   440 (* Setup *)
   439 (* Setup *)
   441 
   440 
   442 fun add_atp (name, config) thy =
   441 fun add_atp (name, config) thy =
   443   Data.map (Symtab.update_new (name, (config, stamp ()))) thy
   442   Data.map (Symtab.update_new (name, (config, stamp ()))) thy