src/HOL/Tools/atp_wrapper.ML
author immler@in.tum.de
Sun, 28 Jun 2009 15:01:28 +0200
changeset 31832 db3f00a39edd
parent 31791 c9a1caf218c8
child 31835 b686d4df54c2
permissions -rw-r--r--
fixed
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
28592
824f8390aaa2 renamed AtpThread to AtpWrapper;
wenzelm
parents:
diff changeset
     1
(*  Title:      HOL/Tools/atp_wrapper.ML
824f8390aaa2 renamed AtpThread to AtpWrapper;
wenzelm
parents:
diff changeset
     2
    Author:     Fabian Immler, TU Muenchen
824f8390aaa2 renamed AtpThread to AtpWrapper;
wenzelm
parents:
diff changeset
     3
824f8390aaa2 renamed AtpThread to AtpWrapper;
wenzelm
parents:
diff changeset
     4
Wrapper functions for external ATPs.
824f8390aaa2 renamed AtpThread to AtpWrapper;
wenzelm
parents:
diff changeset
     5
*)
824f8390aaa2 renamed AtpThread to AtpWrapper;
wenzelm
parents:
diff changeset
     6
824f8390aaa2 renamed AtpThread to AtpWrapper;
wenzelm
parents:
diff changeset
     7
signature ATP_WRAPPER =
824f8390aaa2 renamed AtpThread to AtpWrapper;
wenzelm
parents:
diff changeset
     8
sig
824f8390aaa2 renamed AtpThread to AtpWrapper;
wenzelm
parents:
diff changeset
     9
  val destdir: string ref
824f8390aaa2 renamed AtpThread to AtpWrapper;
wenzelm
parents:
diff changeset
    10
  val problem_name: string ref
28596
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
    11
  val tptp_prover_opts_full: int -> bool -> bool -> Path.T * string -> AtpManager.prover
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
    12
  val tptp_prover_opts: int -> bool -> Path.T * string -> AtpManager.prover
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
    13
  val tptp_prover: Path.T * string -> AtpManager.prover
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
    14
  val full_prover_opts: int -> bool -> Path.T * string -> AtpManager.prover
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
    15
  val full_prover: Path.T * string  -> AtpManager.prover
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
    16
  val vampire_opts: int -> bool -> AtpManager.prover
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
    17
  val vampire: AtpManager.prover
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
    18
  val vampire_opts_full: int -> bool -> AtpManager.prover
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
    19
  val vampire_full: AtpManager.prover
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
    20
  val eprover_opts: int -> bool  -> AtpManager.prover
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
    21
  val eprover: AtpManager.prover
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
    22
  val eprover_opts_full: int -> bool -> AtpManager.prover
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
    23
  val eprover_full: AtpManager.prover
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
    24
  val spass_opts: int -> bool  -> AtpManager.prover
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
    25
  val spass: AtpManager.prover
29590
479a2fce65e6 modified remote script;
immler@in.tum.de
parents: 29587
diff changeset
    26
  val remote_prover_opts: int -> bool -> string -> AtpManager.prover
479a2fce65e6 modified remote script;
immler@in.tum.de
parents: 29587
diff changeset
    27
  val remote_prover: string -> AtpManager.prover
28592
824f8390aaa2 renamed AtpThread to AtpWrapper;
wenzelm
parents:
diff changeset
    28
end;
824f8390aaa2 renamed AtpThread to AtpWrapper;
wenzelm
parents:
diff changeset
    29
824f8390aaa2 renamed AtpThread to AtpWrapper;
wenzelm
parents:
diff changeset
    30
structure AtpWrapper: ATP_WRAPPER =
824f8390aaa2 renamed AtpThread to AtpWrapper;
wenzelm
parents:
diff changeset
    31
struct
28596
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
    32
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
    33
(** generic ATP wrapper **)
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
    34
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
    35
(* global hooks for writing problemfiles *)
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
    36
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
    37
val destdir = ref "";   (*Empty means write files to /tmp*)
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
    38
val problem_name = ref "prob";
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
    39
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
    40
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
    41
(* basic template *)
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
    42
31409
d8537ba165b5 split preparing clauses and writing problemfile;
immler@in.tum.de
parents: 31368
diff changeset
    43
fun external_prover relevance_filter preparer writer (cmd, args) find_failure produce_answer
31752
19a5f1c8a844 use results of relevance-filter to determine additional clauses;
immler@in.tum.de
parents: 31751
diff changeset
    44
  timeout axiom_clauses filtered_clauses name subgoalno goal =
28596
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
    45
  let
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
    46
    (* path to unique problem file *)
28592
824f8390aaa2 renamed AtpThread to AtpWrapper;
wenzelm
parents:
diff changeset
    47
    val destdir' = ! destdir
824f8390aaa2 renamed AtpThread to AtpWrapper;
wenzelm
parents:
diff changeset
    48
    val problem_name' = ! problem_name
824f8390aaa2 renamed AtpThread to AtpWrapper;
wenzelm
parents:
diff changeset
    49
    fun prob_pathname nr =
28596
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
    50
      let val probfile = Path.basic (problem_name' ^ serial_string () ^ "_" ^ string_of_int nr)
28592
824f8390aaa2 renamed AtpThread to AtpWrapper;
wenzelm
parents:
diff changeset
    51
      in if destdir' = "" then File.tmp_path probfile
824f8390aaa2 renamed AtpThread to AtpWrapper;
wenzelm
parents:
diff changeset
    52
        else if File.exists (Path.explode (destdir'))
824f8390aaa2 renamed AtpThread to AtpWrapper;
wenzelm
parents:
diff changeset
    53
        then Path.append  (Path.explode (destdir')) probfile
824f8390aaa2 renamed AtpThread to AtpWrapper;
wenzelm
parents:
diff changeset
    54
        else error ("No such directory: " ^ destdir')
824f8390aaa2 renamed AtpThread to AtpWrapper;
wenzelm
parents:
diff changeset
    55
      end
28596
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
    56
31750
f28b7365fabf restructured external_prover
immler@in.tum.de
parents: 31411
diff changeset
    57
    (* get clauses and prepare them for writing *)
30537
0dd8dfe424cf use goal instead of Proof State
immler@in.tum.de
parents: 30536
diff changeset
    58
    val (ctxt, (chain_ths, th)) = goal
30536
07b4f050e4df split relevance-filter and writing of problem-files;
immler@in.tum.de
parents: 30535
diff changeset
    59
    val thy = ProofContext.theory_of ctxt
28596
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
    60
    val chain_ths = map (Thm.put_name_hint ResReconstruct.chained_hint) chain_ths
31409
d8537ba165b5 split preparing clauses and writing problemfile;
immler@in.tum.de
parents: 31368
diff changeset
    61
    val goal_cls = #1 (ResAxioms.neg_conjecture_clauses th subgoalno)
d8537ba165b5 split preparing clauses and writing problemfile;
immler@in.tum.de
parents: 31368
diff changeset
    62
      handle THM ("assume: variables", _, _) =>
d8537ba165b5 split preparing clauses and writing problemfile;
immler@in.tum.de
parents: 31368
diff changeset
    63
        error "Sledgehammer: Goal contains type variables (TVars)"
d8537ba165b5 split preparing clauses and writing problemfile;
immler@in.tum.de
parents: 31368
diff changeset
    64
    val _ = app (fn th => Output.debug (fn _ => Display.string_of_thm th)) goal_cls
31752
19a5f1c8a844 use results of relevance-filter to determine additional clauses;
immler@in.tum.de
parents: 31751
diff changeset
    65
    val the_filtered_clauses =
19a5f1c8a844 use results of relevance-filter to determine additional clauses;
immler@in.tum.de
parents: 31751
diff changeset
    66
      case filtered_clauses of
19a5f1c8a844 use results of relevance-filter to determine additional clauses;
immler@in.tum.de
parents: 31751
diff changeset
    67
          NONE => relevance_filter goal goal_cls
19a5f1c8a844 use results of relevance-filter to determine additional clauses;
immler@in.tum.de
parents: 31751
diff changeset
    68
        | SOME fcls => fcls
31409
d8537ba165b5 split preparing clauses and writing problemfile;
immler@in.tum.de
parents: 31368
diff changeset
    69
    val the_axiom_clauses =
d8537ba165b5 split preparing clauses and writing problemfile;
immler@in.tum.de
parents: 31368
diff changeset
    70
      case axiom_clauses of
31752
19a5f1c8a844 use results of relevance-filter to determine additional clauses;
immler@in.tum.de
parents: 31751
diff changeset
    71
          NONE => the_filtered_clauses
31409
d8537ba165b5 split preparing clauses and writing problemfile;
immler@in.tum.de
parents: 31368
diff changeset
    72
        | SOME axcls => axcls
31752
19a5f1c8a844 use results of relevance-filter to determine additional clauses;
immler@in.tum.de
parents: 31751
diff changeset
    73
    val (thm_names, clauses) = preparer goal_cls chain_ths the_axiom_clauses the_filtered_clauses thy
31750
f28b7365fabf restructured external_prover
immler@in.tum.de
parents: 31411
diff changeset
    74
f28b7365fabf restructured external_prover
immler@in.tum.de
parents: 31411
diff changeset
    75
    (* write out problem file and call prover *)
f28b7365fabf restructured external_prover
immler@in.tum.de
parents: 31411
diff changeset
    76
    val probfile = prob_pathname subgoalno
f28b7365fabf restructured external_prover
immler@in.tum.de
parents: 31411
diff changeset
    77
    val fname = File.platform_path probfile
31752
19a5f1c8a844 use results of relevance-filter to determine additional clauses;
immler@in.tum.de
parents: 31751
diff changeset
    78
    val _ = writer fname clauses
28596
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
    79
    val cmdline =
30899
d394a17d4fdb external_prover: "exec" the command line, in order to preserve the exact process context of the "system" invocation (this recovers interruptibility of E-1.0, which assumes to be the process group leader);
wenzelm
parents: 30896
diff changeset
    80
      if File.exists cmd then "exec " ^ File.shell_path cmd ^ " " ^ args
28596
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
    81
      else error ("Bad executable: " ^ Path.implode cmd)
30536
07b4f050e4df split relevance-filter and writing of problem-files;
immler@in.tum.de
parents: 30535
diff changeset
    82
    val (proof, rc) = system_out (cmdline ^ " " ^ fname)
28592
824f8390aaa2 renamed AtpThread to AtpWrapper;
wenzelm
parents:
diff changeset
    83
31751
fda2cf4fef58 export proof when exporting problemfile
immler@in.tum.de
parents: 31750
diff changeset
    84
    (* if problemfile has not been exported, delete problemfile; otherwise export proof, too *)
fda2cf4fef58 export proof when exporting problemfile
immler@in.tum.de
parents: 31750
diff changeset
    85
    val _ =
fda2cf4fef58 export proof when exporting problemfile
immler@in.tum.de
parents: 31750
diff changeset
    86
      if destdir' = "" then OS.FileSys.remove fname
fda2cf4fef58 export proof when exporting problemfile
immler@in.tum.de
parents: 31750
diff changeset
    87
      else
fda2cf4fef58 export proof when exporting problemfile
immler@in.tum.de
parents: 31750
diff changeset
    88
        let val out = TextIO.openOut (fname ^ "_proof")
fda2cf4fef58 export proof when exporting problemfile
immler@in.tum.de
parents: 31750
diff changeset
    89
        val _ = TextIO.output (out, proof)
fda2cf4fef58 export proof when exporting problemfile
immler@in.tum.de
parents: 31750
diff changeset
    90
        in TextIO.closeOut out end
29590
479a2fce65e6 modified remote script;
immler@in.tum.de
parents: 29587
diff changeset
    91
    
479a2fce65e6 modified remote script;
immler@in.tum.de
parents: 29587
diff changeset
    92
    (* check for success and print out some information on failure *)
479a2fce65e6 modified remote script;
immler@in.tum.de
parents: 29587
diff changeset
    93
    val failure = find_failure proof
29597
immler@in.tum.de
parents: 29593
diff changeset
    94
    val success = rc = 0 andalso is_none failure
28596
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
    95
    val message =
30896
ec3f33437fe3 more generic error message, which also covers more fundamental failure;
wenzelm
parents: 30874
diff changeset
    96
      if is_some failure then "External prover failed."
ec3f33437fe3 more generic error message, which also covers more fundamental failure;
wenzelm
parents: 30874
diff changeset
    97
      else if rc <> 0 then "External prover failed: " ^ proof
31037
ac8669134e7a added Philipp Meyer's implementation of AtpMinimal
immler@in.tum.de
parents: 30979
diff changeset
    98
      else "Try this command: " ^ produce_answer name (proof, thm_names, ctxt, th, subgoalno)
31411
1d00ab68bc8d additional debugging
immler@in.tum.de
parents: 31410
diff changeset
    99
    val _ = Output.debug (fn () => "Sledgehammer response (rc = " ^ string_of_int rc ^ "):\n" ^ proof)
31752
19a5f1c8a844 use results of relevance-filter to determine additional clauses;
immler@in.tum.de
parents: 31751
diff changeset
   100
  in (success, message, proof, thm_names, the_filtered_clauses) end;
28596
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
   101
28592
824f8390aaa2 renamed AtpThread to AtpWrapper;
wenzelm
parents:
diff changeset
   102
28596
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
   103
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
   104
(** common provers **)
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
   105
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
   106
(* generic TPTP-based provers *)
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
   107
31752
19a5f1c8a844 use results of relevance-filter to determine additional clauses;
immler@in.tum.de
parents: 31751
diff changeset
   108
fun tptp_prover_opts_full max_new theory_const full command timeout ax_clauses fcls name n goal =
28596
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
   109
  external_prover
31409
d8537ba165b5 split preparing clauses and writing problemfile;
immler@in.tum.de
parents: 31368
diff changeset
   110
  (ResAtp.get_relevant max_new theory_const)
d8537ba165b5 split preparing clauses and writing problemfile;
immler@in.tum.de
parents: 31368
diff changeset
   111
  (ResAtp.prepare_clauses false)
31791
c9a1caf218c8 New ATP option: full types
nipkow
parents: 31752
diff changeset
   112
  (ResHolClause.tptp_write_file (AtpManager.get_full_types()))
31409
d8537ba165b5 split preparing clauses and writing problemfile;
immler@in.tum.de
parents: 31368
diff changeset
   113
  command
d8537ba165b5 split preparing clauses and writing problemfile;
immler@in.tum.de
parents: 31368
diff changeset
   114
  ResReconstruct.find_failure
d8537ba165b5 split preparing clauses and writing problemfile;
immler@in.tum.de
parents: 31368
diff changeset
   115
  (if full then ResReconstruct.structured_proof else ResReconstruct.lemma_list_tstp)
31752
19a5f1c8a844 use results of relevance-filter to determine additional clauses;
immler@in.tum.de
parents: 31751
diff changeset
   116
  timeout ax_clauses fcls name n goal;
28596
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
   117
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
   118
(*arbitrary ATP with TPTP input/output and problemfile as last argument*)
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
   119
fun tptp_prover_opts max_new theory_const =
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
   120
  tptp_prover_opts_full max_new theory_const false;
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
   121
31368
763f4b0fd579 made SML/NJ happy;
wenzelm
parents: 31037
diff changeset
   122
fun tptp_prover x = tptp_prover_opts 60 true x;
28596
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
   123
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
   124
(*for structured proofs: prover must support TSTP*)
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
   125
fun full_prover_opts max_new theory_const =
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
   126
  tptp_prover_opts_full max_new theory_const true;
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
   127
31368
763f4b0fd579 made SML/NJ happy;
wenzelm
parents: 31037
diff changeset
   128
fun full_prover x = full_prover_opts 60 true x;
28596
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
   129
28592
824f8390aaa2 renamed AtpThread to AtpWrapper;
wenzelm
parents:
diff changeset
   130
28596
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
   131
(* Vampire *)
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
   132
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
   133
(*NB: Vampire does not work without explicit timelimit*)
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
   134
29593
7b73bd578db2 pass timeout to prover;
immler@in.tum.de
parents: 29590
diff changeset
   135
fun vampire_opts max_new theory_const timeout = tptp_prover_opts
28596
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
   136
  max_new theory_const
29593
7b73bd578db2 pass timeout to prover;
immler@in.tum.de
parents: 29590
diff changeset
   137
  (Path.explode "$VAMPIRE_HOME/vampire",
7b73bd578db2 pass timeout to prover;
immler@in.tum.de
parents: 29590
diff changeset
   138
               ("--output_syntax tptp --mode casc -t " ^ string_of_int timeout))
7b73bd578db2 pass timeout to prover;
immler@in.tum.de
parents: 29590
diff changeset
   139
  timeout;
28596
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
   140
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
   141
val vampire = vampire_opts 60 false;
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
   142
29593
7b73bd578db2 pass timeout to prover;
immler@in.tum.de
parents: 29590
diff changeset
   143
fun vampire_opts_full max_new theory_const timeout = full_prover_opts
28596
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
   144
  max_new theory_const
29593
7b73bd578db2 pass timeout to prover;
immler@in.tum.de
parents: 29590
diff changeset
   145
  (Path.explode "$VAMPIRE_HOME/vampire",
7b73bd578db2 pass timeout to prover;
immler@in.tum.de
parents: 29590
diff changeset
   146
               ("--output_syntax tptp --mode casc -t " ^ string_of_int timeout))
7b73bd578db2 pass timeout to prover;
immler@in.tum.de
parents: 29590
diff changeset
   147
  timeout;
28596
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
   148
31832
immler@in.tum.de
parents: 31791
diff changeset
   149
val vampire_full = vampire_opts_full 60 false;
28596
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
   150
28592
824f8390aaa2 renamed AtpThread to AtpWrapper;
wenzelm
parents:
diff changeset
   151
28596
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
   152
(* E prover *)
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
   153
30536
07b4f050e4df split relevance-filter and writing of problem-files;
immler@in.tum.de
parents: 30535
diff changeset
   154
fun eprover_opts max_new theory_const timeout = tptp_prover_opts
28596
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
   155
  max_new theory_const
30536
07b4f050e4df split relevance-filter and writing of problem-files;
immler@in.tum.de
parents: 30535
diff changeset
   156
  (Path.explode "$E_HOME/eproof",
07b4f050e4df split relevance-filter and writing of problem-files;
immler@in.tum.de
parents: 30535
diff changeset
   157
    "--tstp-in --tstp-out -l5 -xAutoDev -tAutoDev --silent --cpu-limit=" ^ string_of_int timeout)
07b4f050e4df split relevance-filter and writing of problem-files;
immler@in.tum.de
parents: 30535
diff changeset
   158
  timeout;
28596
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
   159
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
   160
val eprover = eprover_opts 100 false;
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
   161
30536
07b4f050e4df split relevance-filter and writing of problem-files;
immler@in.tum.de
parents: 30535
diff changeset
   162
fun eprover_opts_full max_new theory_const timeout = full_prover_opts
28596
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
   163
  max_new theory_const
30536
07b4f050e4df split relevance-filter and writing of problem-files;
immler@in.tum.de
parents: 30535
diff changeset
   164
  (Path.explode "$E_HOME/eproof",
07b4f050e4df split relevance-filter and writing of problem-files;
immler@in.tum.de
parents: 30535
diff changeset
   165
    "--tstp-in --tstp-out -l5 -xAutoDev -tAutoDev --silent --cpu-limit=" ^ string_of_int timeout)
07b4f050e4df split relevance-filter and writing of problem-files;
immler@in.tum.de
parents: 30535
diff changeset
   166
  timeout;
28596
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
   167
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
   168
val eprover_full = eprover_opts_full 100 false;
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
   169
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
   170
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
   171
(* SPASS *)
28592
824f8390aaa2 renamed AtpThread to AtpWrapper;
wenzelm
parents:
diff changeset
   172
31752
19a5f1c8a844 use results of relevance-filter to determine additional clauses;
immler@in.tum.de
parents: 31751
diff changeset
   173
fun spass_opts max_new theory_const timeout ax_clauses fcls name n goal = external_prover
31409
d8537ba165b5 split preparing clauses and writing problemfile;
immler@in.tum.de
parents: 31368
diff changeset
   174
  (ResAtp.get_relevant max_new theory_const)
d8537ba165b5 split preparing clauses and writing problemfile;
immler@in.tum.de
parents: 31368
diff changeset
   175
  (ResAtp.prepare_clauses true)
31791
c9a1caf218c8 New ATP option: full types
nipkow
parents: 31752
diff changeset
   176
  (ResHolClause.dfg_write_file (AtpManager.get_full_types()))
30536
07b4f050e4df split relevance-filter and writing of problem-files;
immler@in.tum.de
parents: 30535
diff changeset
   177
  (Path.explode "$SPASS_HOME/SPASS",
07b4f050e4df split relevance-filter and writing of problem-files;
immler@in.tum.de
parents: 30535
diff changeset
   178
    "-Auto -SOS=1 -PGiven=0 -PProblem=0 -Splits=0 -FullRed=0 -DocProof -TimeLimit=" ^ string_of_int timeout)
30874
34927a1e0ae8 reverted to explicitly check the presence of a refutation
immler@in.tum.de
parents: 30542
diff changeset
   179
  ResReconstruct.find_failure
30536
07b4f050e4df split relevance-filter and writing of problem-files;
immler@in.tum.de
parents: 30535
diff changeset
   180
  ResReconstruct.lemma_list_dfg
31752
19a5f1c8a844 use results of relevance-filter to determine additional clauses;
immler@in.tum.de
parents: 31751
diff changeset
   181
  timeout ax_clauses fcls name n goal;
28596
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
   182
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
   183
val spass = spass_opts 40 true;
28592
824f8390aaa2 renamed AtpThread to AtpWrapper;
wenzelm
parents:
diff changeset
   184
28596
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
   185
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
   186
(* remote prover invocation via SystemOnTPTP *)
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
   187
29593
7b73bd578db2 pass timeout to prover;
immler@in.tum.de
parents: 29590
diff changeset
   188
fun remote_prover_opts max_new theory_const args timeout =
28596
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
   189
  tptp_prover_opts max_new theory_const
30979
10eb446df3c7 renamed contrib/SystemOnTPTP/remote to lib/script/SystemOnTPTP, thus leaving contrib empty within the official distribution;
wenzelm
parents: 30899
diff changeset
   190
  (Path.explode "$ISABELLE_HOME/lib/scripts/SystemOnTPTP", args ^ " -t " ^ string_of_int timeout)
29593
7b73bd578db2 pass timeout to prover;
immler@in.tum.de
parents: 29590
diff changeset
   191
  timeout;
28596
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
   192
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
   193
val remote_prover = remote_prover_opts 60 false;
28592
824f8390aaa2 renamed AtpThread to AtpWrapper;
wenzelm
parents:
diff changeset
   194
824f8390aaa2 renamed AtpThread to AtpWrapper;
wenzelm
parents:
diff changeset
   195
end;
30536
07b4f050e4df split relevance-filter and writing of problem-files;
immler@in.tum.de
parents: 30535
diff changeset
   196
07b4f050e4df split relevance-filter and writing of problem-files;
immler@in.tum.de
parents: 30535
diff changeset
   197