src/HOL/Tools/ATP_Manager/atp_systems.ML
author blanchet
Mon, 14 Jun 2010 17:12:41 +0200
changeset 37415 521bc1d10445
parent 37414 d0cea0796295
child 37480 d5a85d35ef62
permissions -rw-r--r--
better error reporting for Vampire
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
36376
e83d52a52449 renamed module "ATP_Wrapper" to "ATP_Systems"
blanchet
parents: 36371
diff changeset
     1
(*  Title:      HOL/Tools/ATP_Manager/atp_systems.ML
28592
824f8390aaa2 renamed AtpThread to AtpWrapper;
wenzelm
parents:
diff changeset
     2
    Author:     Fabian Immler, TU Muenchen
36371
8c83ea1a7740 move the Sledgehammer menu options to "sledgehammer_isar.ML"
blanchet
parents: 36370
diff changeset
     3
    Author:     Jasmin Blanchette, TU Muenchen
28592
824f8390aaa2 renamed AtpThread to AtpWrapper;
wenzelm
parents:
diff changeset
     4
36376
e83d52a52449 renamed module "ATP_Wrapper" to "ATP_Systems"
blanchet
parents: 36371
diff changeset
     5
Setup for supported ATPs.
28592
824f8390aaa2 renamed AtpThread to AtpWrapper;
wenzelm
parents:
diff changeset
     6
*)
824f8390aaa2 renamed AtpThread to AtpWrapper;
wenzelm
parents:
diff changeset
     7
36376
e83d52a52449 renamed module "ATP_Wrapper" to "ATP_Systems"
blanchet
parents: 36371
diff changeset
     8
signature ATP_SYSTEMS =
28592
824f8390aaa2 renamed AtpThread to AtpWrapper;
wenzelm
parents:
diff changeset
     9
sig
35867
16279c4c7a33 move all ATP setup code into ATP_Wrapper
blanchet
parents: 35865
diff changeset
    10
  type prover = ATP_Manager.prover
32864
a226f29d4bdc re-organized signature of AtpWrapper structure: records instead of unnamed parameters and return values,
boehmes
parents: 32740
diff changeset
    11
35867
16279c4c7a33 move all ATP setup code into ATP_Wrapper
blanchet
parents: 35865
diff changeset
    12
  (* hooks for problem files *)
36376
e83d52a52449 renamed module "ATP_Wrapper" to "ATP_Systems"
blanchet
parents: 36371
diff changeset
    13
  val dest_dir : string Config.T
35867
16279c4c7a33 move all ATP setup code into ATP_Wrapper
blanchet
parents: 35865
diff changeset
    14
  val problem_prefix : string Config.T
16279c4c7a33 move all ATP setup code into ATP_Wrapper
blanchet
parents: 35865
diff changeset
    15
  val measure_runtime : bool Config.T
32864
a226f29d4bdc re-organized signature of AtpWrapper structure: records instead of unnamed parameters and return values,
boehmes
parents: 32740
diff changeset
    16
35867
16279c4c7a33 move all ATP setup code into ATP_Wrapper
blanchet
parents: 35865
diff changeset
    17
  val refresh_systems_on_tptp : unit -> unit
36371
8c83ea1a7740 move the Sledgehammer menu options to "sledgehammer_isar.ML"
blanchet
parents: 36370
diff changeset
    18
  val default_atps_param_value : unit -> string
35867
16279c4c7a33 move all ATP setup code into ATP_Wrapper
blanchet
parents: 35865
diff changeset
    19
  val setup : theory -> theory
28592
824f8390aaa2 renamed AtpThread to AtpWrapper;
wenzelm
parents:
diff changeset
    20
end;
824f8390aaa2 renamed AtpThread to AtpWrapper;
wenzelm
parents:
diff changeset
    21
36376
e83d52a52449 renamed module "ATP_Wrapper" to "ATP_Systems"
blanchet
parents: 36371
diff changeset
    22
structure ATP_Systems : ATP_SYSTEMS =
28592
824f8390aaa2 renamed AtpThread to AtpWrapper;
wenzelm
parents:
diff changeset
    23
struct
28596
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
    24
36187
4deef08608ee added timestamp to proof
blanchet
parents: 36169
diff changeset
    25
open Sledgehammer_Util
35969
c9565298df9e added support for Sledgehammer parameters;
blanchet
parents: 35869
diff changeset
    26
open Sledgehammer_Fact_Preprocessor
35865
2f8fb5242799 more Sledgehammer refactoring
blanchet
parents: 35826
diff changeset
    27
open Sledgehammer_HOL_Clause
2f8fb5242799 more Sledgehammer refactoring
blanchet
parents: 35826
diff changeset
    28
open Sledgehammer_Fact_Filter
2f8fb5242799 more Sledgehammer refactoring
blanchet
parents: 35826
diff changeset
    29
open Sledgehammer_Proof_Reconstruct
35867
16279c4c7a33 move all ATP setup code into ATP_Wrapper
blanchet
parents: 35865
diff changeset
    30
open ATP_Manager
35826
1590abc3d42a renamed Sledgehammer structures
blanchet
parents: 35570
diff changeset
    31
36376
e83d52a52449 renamed module "ATP_Wrapper" to "ATP_Systems"
blanchet
parents: 36371
diff changeset
    32
(** generic ATP **)
28596
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
    33
32944
ecc0705174c2 clarified File.platform_path vs. File.shell_path;
wenzelm
parents: 32942
diff changeset
    34
(* external problem files *)
32864
a226f29d4bdc re-organized signature of AtpWrapper structure: records instead of unnamed parameters and return values,
boehmes
parents: 32740
diff changeset
    35
36376
e83d52a52449 renamed module "ATP_Wrapper" to "ATP_Systems"
blanchet
parents: 36371
diff changeset
    36
val (dest_dir, dest_dir_setup) = Attrib.config_string "atp_dest_dir" (K "");
32864
a226f29d4bdc re-organized signature of AtpWrapper structure: records instead of unnamed parameters and return values,
boehmes
parents: 32740
diff changeset
    37
  (*Empty string means create files in Isabelle's temporary files directory.*)
a226f29d4bdc re-organized signature of AtpWrapper structure: records instead of unnamed parameters and return values,
boehmes
parents: 32740
diff changeset
    38
a226f29d4bdc re-organized signature of AtpWrapper structure: records instead of unnamed parameters and return values,
boehmes
parents: 32740
diff changeset
    39
val (problem_prefix, problem_prefix_setup) =
36001
992839c4be90 static defaults for configuration options;
wenzelm
parents: 35969
diff changeset
    40
  Attrib.config_string "atp_problem_prefix" (K "prob");
32864
a226f29d4bdc re-organized signature of AtpWrapper structure: records instead of unnamed parameters and return values,
boehmes
parents: 32740
diff changeset
    41
33247
ed1681284f62 measure runtime of ATPs only if requested
boehmes
parents: 33082
diff changeset
    42
val (measure_runtime, measure_runtime_setup) =
36001
992839c4be90 static defaults for configuration options;
wenzelm
parents: 35969
diff changeset
    43
  Attrib.config_bool "atp_measure_runtime" (K false);
33247
ed1681284f62 measure runtime of ATPs only if requested
boehmes
parents: 33082
diff changeset
    44
32864
a226f29d4bdc re-organized signature of AtpWrapper structure: records instead of unnamed parameters and return values,
boehmes
parents: 32740
diff changeset
    45
35867
16279c4c7a33 move all ATP setup code into ATP_Wrapper
blanchet
parents: 35865
diff changeset
    46
(* prover configuration *)
32864
a226f29d4bdc re-organized signature of AtpWrapper structure: records instead of unnamed parameters and return values,
boehmes
parents: 32740
diff changeset
    47
32941
72d48e333b77 eliminated extraneous wrapping of public records;
wenzelm
parents: 32936
diff changeset
    48
type prover_config =
36917
8674cdb0b8cc query _HOME environment variables at run-time, not at build-time
blanchet
parents: 36910
diff changeset
    49
  {home_var: string,
36370
a4f601daa175 centralized ATP-specific error handling in "atp_wrapper.ML"
blanchet
parents: 36369
diff changeset
    50
   executable: string,
a4f601daa175 centralized ATP-specific error handling in "atp_wrapper.ML"
blanchet
parents: 36369
diff changeset
    51
   arguments: Time.time -> string,
a4f601daa175 centralized ATP-specific error handling in "atp_wrapper.ML"
blanchet
parents: 36369
diff changeset
    52
   proof_delims: (string * string) list,
a4f601daa175 centralized ATP-specific error handling in "atp_wrapper.ML"
blanchet
parents: 36369
diff changeset
    53
   known_failures: (failure * string) list,
36382
b90fc0d75bca cosmetics
blanchet
parents: 36377
diff changeset
    54
   max_axiom_clauses: int,
36370
a4f601daa175 centralized ATP-specific error handling in "atp_wrapper.ML"
blanchet
parents: 36369
diff changeset
    55
   prefers_theory_relevant: bool};
28596
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
    56
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
    57
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
    58
(* basic template *)
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
    59
36370
a4f601daa175 centralized ATP-specific error handling in "atp_wrapper.ML"
blanchet
parents: 36369
diff changeset
    60
val remotify = prefix "remote_"
a4f601daa175 centralized ATP-specific error handling in "atp_wrapper.ML"
blanchet
parents: 36369
diff changeset
    61
32458
de6834b20e9e sledgehammer's temporary files are removed properly (even in case of an exception occurs)
boehmes
parents: 32451
diff changeset
    62
fun with_path cleanup after f path =
de6834b20e9e sledgehammer's temporary files are removed properly (even in case of an exception occurs)
boehmes
parents: 32451
diff changeset
    63
  Exn.capture f path
de6834b20e9e sledgehammer's temporary files are removed properly (even in case of an exception occurs)
boehmes
parents: 32451
diff changeset
    64
  |> tap (fn _ => cleanup path)
de6834b20e9e sledgehammer's temporary files are removed properly (even in case of an exception occurs)
boehmes
parents: 32451
diff changeset
    65
  |> Exn.release
36369
d2cd0d04b8e6 handle ATP proof delimiters in a cleaner, more extensible fashion
blanchet
parents: 36289
diff changeset
    66
  |> tap (after path)
d2cd0d04b8e6 handle ATP proof delimiters in a cleaner, more extensible fashion
blanchet
parents: 36289
diff changeset
    67
d2cd0d04b8e6 handle ATP proof delimiters in a cleaner, more extensible fashion
blanchet
parents: 36289
diff changeset
    68
(* Splits by the first possible of a list of delimiters. *)
d2cd0d04b8e6 handle ATP proof delimiters in a cleaner, more extensible fashion
blanchet
parents: 36289
diff changeset
    69
fun extract_proof delims output =
d2cd0d04b8e6 handle ATP proof delimiters in a cleaner, more extensible fashion
blanchet
parents: 36289
diff changeset
    70
  case pairself (find_first (fn s => String.isSubstring s output))
d2cd0d04b8e6 handle ATP proof delimiters in a cleaner, more extensible fashion
blanchet
parents: 36289
diff changeset
    71
                (ListPair.unzip delims) of
d2cd0d04b8e6 handle ATP proof delimiters in a cleaner, more extensible fashion
blanchet
parents: 36289
diff changeset
    72
    (SOME begin_delim, SOME end_delim) =>
36549
d29617bcc1fb properly extract SPASS proof
blanchet
parents: 36548
diff changeset
    73
    (output |> first_field begin_delim |> the |> snd
d29617bcc1fb properly extract SPASS proof
blanchet
parents: 36548
diff changeset
    74
            |> first_field end_delim |> the |> fst
d29617bcc1fb properly extract SPASS proof
blanchet
parents: 36548
diff changeset
    75
            |> first_field "\n" |> the |> snd
d29617bcc1fb properly extract SPASS proof
blanchet
parents: 36548
diff changeset
    76
     handle Option.Option => "")
36369
d2cd0d04b8e6 handle ATP proof delimiters in a cleaner, more extensible fashion
blanchet
parents: 36289
diff changeset
    77
  | _ => ""
32458
de6834b20e9e sledgehammer's temporary files are removed properly (even in case of an exception occurs)
boehmes
parents: 32451
diff changeset
    78
36370
a4f601daa175 centralized ATP-specific error handling in "atp_wrapper.ML"
blanchet
parents: 36369
diff changeset
    79
fun extract_proof_and_outcome res_code proof_delims known_failures output =
a4f601daa175 centralized ATP-specific error handling in "atp_wrapper.ML"
blanchet
parents: 36369
diff changeset
    80
  case map_filter (fn (failure, pattern) =>
a4f601daa175 centralized ATP-specific error handling in "atp_wrapper.ML"
blanchet
parents: 36369
diff changeset
    81
                      if String.isSubstring pattern output then SOME failure
a4f601daa175 centralized ATP-specific error handling in "atp_wrapper.ML"
blanchet
parents: 36369
diff changeset
    82
                      else NONE) known_failures of
36369
d2cd0d04b8e6 handle ATP proof delimiters in a cleaner, more extensible fashion
blanchet
parents: 36289
diff changeset
    83
    [] => (case extract_proof proof_delims output of
36370
a4f601daa175 centralized ATP-specific error handling in "atp_wrapper.ML"
blanchet
parents: 36369
diff changeset
    84
             "" => ("", SOME UnknownError)
a4f601daa175 centralized ATP-specific error handling in "atp_wrapper.ML"
blanchet
parents: 36369
diff changeset
    85
           | proof => if res_code = 0 then (proof, NONE)
a4f601daa175 centralized ATP-specific error handling in "atp_wrapper.ML"
blanchet
parents: 36369
diff changeset
    86
                      else ("", SOME UnknownError))
a4f601daa175 centralized ATP-specific error handling in "atp_wrapper.ML"
blanchet
parents: 36369
diff changeset
    87
  | (failure :: _) => ("", SOME failure)
a4f601daa175 centralized ATP-specific error handling in "atp_wrapper.ML"
blanchet
parents: 36369
diff changeset
    88
a4f601daa175 centralized ATP-specific error handling in "atp_wrapper.ML"
blanchet
parents: 36369
diff changeset
    89
fun string_for_failure Unprovable = "The ATP problem is unprovable."
37413
e856582fe9c4 improve ATP-specific error messages
blanchet
parents: 37347
diff changeset
    90
  | string_for_failure IncompleteUnprovable =
e856582fe9c4 improve ATP-specific error messages
blanchet
parents: 37347
diff changeset
    91
    "The ATP cannot prove the problem."
36370
a4f601daa175 centralized ATP-specific error handling in "atp_wrapper.ML"
blanchet
parents: 36369
diff changeset
    92
  | string_for_failure TimedOut = "Timed out."
a4f601daa175 centralized ATP-specific error handling in "atp_wrapper.ML"
blanchet
parents: 36369
diff changeset
    93
  | string_for_failure OutOfResources = "The ATP ran out of resources."
a4f601daa175 centralized ATP-specific error handling in "atp_wrapper.ML"
blanchet
parents: 36369
diff changeset
    94
  | string_for_failure OldSpass =
36393
be73a2b2443b support readable names even when Isar proof reconstruction is enabled -- useful for debugging
blanchet
parents: 36382
diff changeset
    95
    (* FIXME: Change the error message below to point to the Isabelle download
be73a2b2443b support readable names even when Isar proof reconstruction is enabled -- useful for debugging
blanchet
parents: 36382
diff changeset
    96
       page once the package is there (around the Isabelle2010 release). *)
36370
a4f601daa175 centralized ATP-specific error handling in "atp_wrapper.ML"
blanchet
parents: 36369
diff changeset
    97
    "Warning: Sledgehammer requires a more recent version of SPASS with \
a4f601daa175 centralized ATP-specific error handling in "atp_wrapper.ML"
blanchet
parents: 36369
diff changeset
    98
    \support for the TPTP syntax. To install it, download and untar the \
a4f601daa175 centralized ATP-specific error handling in "atp_wrapper.ML"
blanchet
parents: 36369
diff changeset
    99
    \package \"http://isabelle.in.tum.de/~blanchet/spass-3.7.tgz\" and add the \
a4f601daa175 centralized ATP-specific error handling in "atp_wrapper.ML"
blanchet
parents: 36369
diff changeset
   100
    \\"spass-3.7\" directory's full path to \"" ^
a4f601daa175 centralized ATP-specific error handling in "atp_wrapper.ML"
blanchet
parents: 36369
diff changeset
   101
    Path.implode (Path.expand (Path.appends
a4f601daa175 centralized ATP-specific error handling in "atp_wrapper.ML"
blanchet
parents: 36369
diff changeset
   102
        (Path.variable "ISABELLE_HOME_USER" ::
a4f601daa175 centralized ATP-specific error handling in "atp_wrapper.ML"
blanchet
parents: 36369
diff changeset
   103
         map Path.basic ["etc", "components"]))) ^
a4f601daa175 centralized ATP-specific error handling in "atp_wrapper.ML"
blanchet
parents: 36369
diff changeset
   104
    "\" on a line of its own."
36965
67ae217c6b5c identify common SPASS error more clearly
blanchet
parents: 36924
diff changeset
   105
  | string_for_failure MalformedInput =
67ae217c6b5c identify common SPASS error more clearly
blanchet
parents: 36924
diff changeset
   106
    "Internal Sledgehammer error: The ATP problem is malformed. Please report \
67ae217c6b5c identify common SPASS error more clearly
blanchet
parents: 36924
diff changeset
   107
    \this to the Isabelle developers."
36370
a4f601daa175 centralized ATP-specific error handling in "atp_wrapper.ML"
blanchet
parents: 36369
diff changeset
   108
  | string_for_failure MalformedOutput = "Error: The ATP output is malformed."
a4f601daa175 centralized ATP-specific error handling in "atp_wrapper.ML"
blanchet
parents: 36369
diff changeset
   109
  | string_for_failure UnknownError = "Error: An unknown ATP error occurred."
35865
2f8fb5242799 more Sledgehammer refactoring
blanchet
parents: 35826
diff changeset
   110
36400
c5bae529f967 rename options and keep track of conjecture shape (to facilitate proof reconstruction)
blanchet
parents: 36393
diff changeset
   111
fun shape_of_clauses _ [] = []
c5bae529f967 rename options and keep track of conjecture shape (to facilitate proof reconstruction)
blanchet
parents: 36393
diff changeset
   112
  | shape_of_clauses j ([] :: clauses) = [] :: shape_of_clauses j clauses
c5bae529f967 rename options and keep track of conjecture shape (to facilitate proof reconstruction)
blanchet
parents: 36393
diff changeset
   113
  | shape_of_clauses j ((lit :: lits) :: clauses) =
c5bae529f967 rename options and keep track of conjecture shape (to facilitate proof reconstruction)
blanchet
parents: 36393
diff changeset
   114
    let val shape = shape_of_clauses (j + 1) (lits :: clauses) in
c5bae529f967 rename options and keep track of conjecture shape (to facilitate proof reconstruction)
blanchet
parents: 36393
diff changeset
   115
      (j :: hd shape) :: tl shape
c5bae529f967 rename options and keep track of conjecture shape (to facilitate proof reconstruction)
blanchet
parents: 36393
diff changeset
   116
    end
c5bae529f967 rename options and keep track of conjecture shape (to facilitate proof reconstruction)
blanchet
parents: 36393
diff changeset
   117
36917
8674cdb0b8cc query _HOME environment variables at run-time, not at build-time
blanchet
parents: 36910
diff changeset
   118
fun generic_prover overlord get_facts prepare write_file home_var executable
8674cdb0b8cc query _HOME environment variables at run-time, not at build-time
blanchet
parents: 36910
diff changeset
   119
        args proof_delims known_failures name
36924
ff01d3ae9ad4 renamed options
blanchet
parents: 36922
diff changeset
   120
        ({debug, full_types, explicit_apply, isar_proof, isar_shrink_factor,
ff01d3ae9ad4 renamed options
blanchet
parents: 36922
diff changeset
   121
         ...} : params) minimize_command
35969
c9565298df9e added support for Sledgehammer parameters;
blanchet
parents: 35869
diff changeset
   122
        ({subgoal, goal, relevance_override, axiom_clauses, filtered_clauses}
c9565298df9e added support for Sledgehammer parameters;
blanchet
parents: 35869
diff changeset
   123
         : problem) =
28596
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
   124
  let
31750
f28b7365fabf restructured external_prover
immler@in.tum.de
parents: 31411
diff changeset
   125
    (* get clauses and prepare them for writing *)
37171
fc1e20373e6a make sure chained facts appear in Isar proofs generated by Sledgehammer -- otherwise the proof won't work
blanchet
parents: 36965
diff changeset
   126
    val (ctxt, (chained_ths, th)) = goal;
32942
b6711ec9de26 misc tuning and recovery of Isabelle coding style;
wenzelm
parents: 32941
diff changeset
   127
    val thy = ProofContext.theory_of ctxt;
36400
c5bae529f967 rename options and keep track of conjecture shape (to facilitate proof reconstruction)
blanchet
parents: 36393
diff changeset
   128
    val goal_clss = #1 (neg_conjecture_clauses ctxt th subgoal)
c5bae529f967 rename options and keep track of conjecture shape (to facilitate proof reconstruction)
blanchet
parents: 36393
diff changeset
   129
    val goal_cls = List.concat goal_clss
31752
19a5f1c8a844 use results of relevance-filter to determine additional clauses;
immler@in.tum.de
parents: 31751
diff changeset
   130
    val the_filtered_clauses =
32942
b6711ec9de26 misc tuning and recovery of Isabelle coding style;
wenzelm
parents: 32941
diff changeset
   131
      (case filtered_clauses of
35969
c9565298df9e added support for Sledgehammer parameters;
blanchet
parents: 35869
diff changeset
   132
        NONE => get_facts relevance_override goal goal_cls
32942
b6711ec9de26 misc tuning and recovery of Isabelle coding style;
wenzelm
parents: 32941
diff changeset
   133
      | SOME fcls => fcls);
31409
d8537ba165b5 split preparing clauses and writing problemfile;
immler@in.tum.de
parents: 31368
diff changeset
   134
    val the_axiom_clauses =
32942
b6711ec9de26 misc tuning and recovery of Isabelle coding style;
wenzelm
parents: 32941
diff changeset
   135
      (case axiom_clauses of
b6711ec9de26 misc tuning and recovery of Isabelle coding style;
wenzelm
parents: 32941
diff changeset
   136
        NONE => the_filtered_clauses
b6711ec9de26 misc tuning and recovery of Isabelle coding style;
wenzelm
parents: 32941
diff changeset
   137
      | SOME axcls => axcls);
35969
c9565298df9e added support for Sledgehammer parameters;
blanchet
parents: 35869
diff changeset
   138
    val (internal_thm_names, clauses) =
37171
fc1e20373e6a make sure chained facts appear in Isar proofs generated by Sledgehammer -- otherwise the proof won't work
blanchet
parents: 36965
diff changeset
   139
      prepare goal_cls chained_ths the_axiom_clauses the_filtered_clauses thy;
31750
f28b7365fabf restructured external_prover
immler@in.tum.de
parents: 31411
diff changeset
   140
32864
a226f29d4bdc re-organized signature of AtpWrapper structure: records instead of unnamed parameters and return values,
boehmes
parents: 32740
diff changeset
   141
    (* path to unique problem file *)
36376
e83d52a52449 renamed module "ATP_Wrapper" to "ATP_Systems"
blanchet
parents: 36371
diff changeset
   142
    val the_dest_dir = if overlord then getenv "ISABELLE_HOME_USER"
e83d52a52449 renamed module "ATP_Wrapper" to "ATP_Systems"
blanchet
parents: 36371
diff changeset
   143
                       else Config.get ctxt dest_dir;
e83d52a52449 renamed module "ATP_Wrapper" to "ATP_Systems"
blanchet
parents: 36371
diff changeset
   144
    val the_problem_prefix = Config.get ctxt problem_prefix;
32864
a226f29d4bdc re-organized signature of AtpWrapper structure: records instead of unnamed parameters and return values,
boehmes
parents: 32740
diff changeset
   145
    fun prob_pathname nr =
36143
6490319b1703 added "overlord" option (to get easy access to output files for debugging) + systematically use "raw_goal" rather than an inconsistent mixture
blanchet
parents: 36142
diff changeset
   146
      let
6490319b1703 added "overlord" option (to get easy access to output files for debugging) + systematically use "raw_goal" rather than an inconsistent mixture
blanchet
parents: 36142
diff changeset
   147
        val probfile =
36568
d495d2e1f0a6 in "overlord" mode: ignore problem prefix specified in the .thy file
blanchet
parents: 36552
diff changeset
   148
          Path.basic ((if overlord then "prob_" ^ name
d495d2e1f0a6 in "overlord" mode: ignore problem prefix specified in the .thy file
blanchet
parents: 36552
diff changeset
   149
                       else the_problem_prefix ^ serial_string ())
36143
6490319b1703 added "overlord" option (to get easy access to output files for debugging) + systematically use "raw_goal" rather than an inconsistent mixture
blanchet
parents: 36142
diff changeset
   150
                      ^ "_" ^ string_of_int nr)
32942
b6711ec9de26 misc tuning and recovery of Isabelle coding style;
wenzelm
parents: 32941
diff changeset
   151
      in
36376
e83d52a52449 renamed module "ATP_Wrapper" to "ATP_Systems"
blanchet
parents: 36371
diff changeset
   152
        if the_dest_dir = "" then File.tmp_path probfile
e83d52a52449 renamed module "ATP_Wrapper" to "ATP_Systems"
blanchet
parents: 36371
diff changeset
   153
        else if File.exists (Path.explode the_dest_dir)
e83d52a52449 renamed module "ATP_Wrapper" to "ATP_Systems"
blanchet
parents: 36371
diff changeset
   154
        then Path.append (Path.explode the_dest_dir) probfile
e83d52a52449 renamed module "ATP_Wrapper" to "ATP_Systems"
blanchet
parents: 36371
diff changeset
   155
        else error ("No such directory: " ^ the_dest_dir ^ ".")
32942
b6711ec9de26 misc tuning and recovery of Isabelle coding style;
wenzelm
parents: 32941
diff changeset
   156
      end;
32864
a226f29d4bdc re-organized signature of AtpWrapper structure: records instead of unnamed parameters and return values,
boehmes
parents: 32740
diff changeset
   157
36917
8674cdb0b8cc query _HOME environment variables at run-time, not at build-time
blanchet
parents: 36910
diff changeset
   158
    val home = getenv home_var
36289
f75b6a3e1450 set "atps" reference's default value to "(remote_)e (remote_)spass (remote_)vampire", based on what is installed
blanchet
parents: 36287
diff changeset
   159
    val command = Path.explode (home ^ "/" ^ executable)
31750
f28b7365fabf restructured external_prover
immler@in.tum.de
parents: 31411
diff changeset
   160
    (* write out problem file and call prover *)
36289
f75b6a3e1450 set "atps" reference's default value to "(remote_)e (remote_)spass (remote_)vampire", based on what is installed
blanchet
parents: 36287
diff changeset
   161
    fun command_line probfile =
36284
0e24322474a4 postprocess ATP output in "overlord" mode to make it more readable
blanchet
parents: 36283
diff changeset
   162
      (if Config.get ctxt measure_runtime then
36289
f75b6a3e1450 set "atps" reference's default value to "(remote_)e (remote_)spass (remote_)vampire", based on what is installed
blanchet
parents: 36287
diff changeset
   163
         "TIMEFORMAT='%3U'; { time " ^
f75b6a3e1450 set "atps" reference's default value to "(remote_)e (remote_)spass (remote_)vampire", based on what is installed
blanchet
parents: 36287
diff changeset
   164
         space_implode " " [File.shell_path command, args,
f75b6a3e1450 set "atps" reference's default value to "(remote_)e (remote_)spass (remote_)vampire", based on what is installed
blanchet
parents: 36287
diff changeset
   165
                            File.shell_path probfile] ^ " ; } 2>&1"
36284
0e24322474a4 postprocess ATP output in "overlord" mode to make it more readable
blanchet
parents: 36283
diff changeset
   166
       else
36289
f75b6a3e1450 set "atps" reference's default value to "(remote_)e (remote_)spass (remote_)vampire", based on what is installed
blanchet
parents: 36287
diff changeset
   167
         space_implode " " ["exec", File.shell_path command, args,
f75b6a3e1450 set "atps" reference's default value to "(remote_)e (remote_)spass (remote_)vampire", based on what is installed
blanchet
parents: 36287
diff changeset
   168
                            File.shell_path probfile, "2>&1"]) ^
36284
0e24322474a4 postprocess ATP output in "overlord" mode to make it more readable
blanchet
parents: 36283
diff changeset
   169
      (if overlord then
36286
fa6d03d42aab "remote_e" and "remote_vampire" support TSTP proof output + fix "overlord" mode ATP output postprocessing
blanchet
parents: 36284
diff changeset
   170
         " | sed 's/,/, /g' \
36485
blanchet
parents: 36473
diff changeset
   171
         \| sed 's/\\([^!=<]\\)\\([=|]\\)\\([^=>]\\)/\\1 \\2 \\3/g' \
36286
fa6d03d42aab "remote_e" and "remote_vampire" support TSTP proof output + fix "overlord" mode ATP output postprocessing
blanchet
parents: 36284
diff changeset
   172
         \| sed 's/  / /g' | sed 's/| |/||/g' \
fa6d03d42aab "remote_e" and "remote_vampire" support TSTP proof output + fix "overlord" mode ATP output postprocessing
blanchet
parents: 36284
diff changeset
   173
         \| sed 's/ = = =/===/g' \
fa6d03d42aab "remote_e" and "remote_vampire" support TSTP proof output + fix "overlord" mode ATP output postprocessing
blanchet
parents: 36284
diff changeset
   174
         \| sed 's/= = /== /g'"
36284
0e24322474a4 postprocess ATP output in "overlord" mode to make it more readable
blanchet
parents: 36283
diff changeset
   175
       else
0e24322474a4 postprocess ATP output in "overlord" mode to make it more readable
blanchet
parents: 36283
diff changeset
   176
         "")
32510
1b56f8b1e5cc added runtime information to sledgehammer
boehmes
parents: 32458
diff changeset
   177
    fun split_time s =
1b56f8b1e5cc added runtime information to sledgehammer
boehmes
parents: 32458
diff changeset
   178
      let
32942
b6711ec9de26 misc tuning and recovery of Isabelle coding style;
wenzelm
parents: 32941
diff changeset
   179
        val split = String.tokens (fn c => str c = "\n");
36369
d2cd0d04b8e6 handle ATP proof delimiters in a cleaner, more extensible fashion
blanchet
parents: 36289
diff changeset
   180
        val (output, t) = s |> split |> split_last |> apfst cat_lines;
32942
b6711ec9de26 misc tuning and recovery of Isabelle coding style;
wenzelm
parents: 32941
diff changeset
   181
        fun as_num f = f >> (fst o read_int);
b6711ec9de26 misc tuning and recovery of Isabelle coding style;
wenzelm
parents: 32941
diff changeset
   182
        val num = as_num (Scan.many1 Symbol.is_ascii_digit);
b6711ec9de26 misc tuning and recovery of Isabelle coding style;
wenzelm
parents: 32941
diff changeset
   183
        val digit = Scan.one Symbol.is_ascii_digit;
b6711ec9de26 misc tuning and recovery of Isabelle coding style;
wenzelm
parents: 32941
diff changeset
   184
        val num3 = as_num (digit ::: digit ::: (digit >> single));
b6711ec9de26 misc tuning and recovery of Isabelle coding style;
wenzelm
parents: 32941
diff changeset
   185
        val time = num --| Scan.$$ "." -- num3 >> (fn (a, b) => a * 1000 + b);
b6711ec9de26 misc tuning and recovery of Isabelle coding style;
wenzelm
parents: 32941
diff changeset
   186
        val as_time = the_default 0 o Scan.read Symbol.stopper time o explode;
36369
d2cd0d04b8e6 handle ATP proof delimiters in a cleaner, more extensible fashion
blanchet
parents: 36289
diff changeset
   187
      in (output, as_time t) end;
33247
ed1681284f62 measure runtime of ATPs only if requested
boehmes
parents: 33082
diff changeset
   188
    fun split_time' s =
ed1681284f62 measure runtime of ATPs only if requested
boehmes
parents: 33082
diff changeset
   189
      if Config.get ctxt measure_runtime then split_time s else (s, 0)
32458
de6834b20e9e sledgehammer's temporary files are removed properly (even in case of an exception occurs)
boehmes
parents: 32451
diff changeset
   190
    fun run_on probfile =
36289
f75b6a3e1450 set "atps" reference's default value to "(remote_)e (remote_)spass (remote_)vampire", based on what is installed
blanchet
parents: 36287
diff changeset
   191
      if File.exists command then
36235
61159615a0c5 added "explicit_apply" option to Sledgehammer, to control whether an explicit apply function should be used as much or as little as possible (replaces a previous global variable)
blanchet
parents: 36231
diff changeset
   192
        write_file full_types explicit_apply probfile clauses
36289
f75b6a3e1450 set "atps" reference's default value to "(remote_)e (remote_)spass (remote_)vampire", based on what is installed
blanchet
parents: 36287
diff changeset
   193
        |> pair (apfst split_time' (bash_output (command_line probfile)))
36917
8674cdb0b8cc query _HOME environment variables at run-time, not at build-time
blanchet
parents: 36910
diff changeset
   194
      else if home = "" then
8674cdb0b8cc query _HOME environment variables at run-time, not at build-time
blanchet
parents: 36910
diff changeset
   195
        error ("The environment variable " ^ quote home_var ^ " is not set.")
36382
b90fc0d75bca cosmetics
blanchet
parents: 36377
diff changeset
   196
      else
b90fc0d75bca cosmetics
blanchet
parents: 36377
diff changeset
   197
        error ("Bad executable: " ^ Path.implode command ^ ".");
28592
824f8390aaa2 renamed AtpThread to AtpWrapper;
wenzelm
parents:
diff changeset
   198
36167
c1a35be8e476 make Sledgehammer's output more debugging friendly
blanchet
parents: 36143
diff changeset
   199
    (* If the problem file has not been exported, remove it; otherwise, export
c1a35be8e476 make Sledgehammer's output more debugging friendly
blanchet
parents: 36143
diff changeset
   200
       the proof file too. *)
36376
e83d52a52449 renamed module "ATP_Wrapper" to "ATP_Systems"
blanchet
parents: 36371
diff changeset
   201
    fun cleanup probfile =
e83d52a52449 renamed module "ATP_Wrapper" to "ATP_Systems"
blanchet
parents: 36371
diff changeset
   202
      if the_dest_dir = "" then try File.rm probfile else NONE
36369
d2cd0d04b8e6 handle ATP proof delimiters in a cleaner, more extensible fashion
blanchet
parents: 36289
diff changeset
   203
    fun export probfile (((output, _), _), _) =
36376
e83d52a52449 renamed module "ATP_Wrapper" to "ATP_Systems"
blanchet
parents: 36371
diff changeset
   204
      if the_dest_dir = "" then
36187
4deef08608ee added timestamp to proof
blanchet
parents: 36169
diff changeset
   205
        ()
4deef08608ee added timestamp to proof
blanchet
parents: 36169
diff changeset
   206
      else
4deef08608ee added timestamp to proof
blanchet
parents: 36169
diff changeset
   207
        File.write (Path.explode (Path.implode probfile ^ "_proof"))
36282
9a7c5b86a105 generate command-line in addition to timestamp in ATP output file, for debugging purposes
blanchet
parents: 36281
diff changeset
   208
                   ((if overlord then
36289
f75b6a3e1450 set "atps" reference's default value to "(remote_)e (remote_)spass (remote_)vampire", based on what is installed
blanchet
parents: 36287
diff changeset
   209
                       "% " ^ command_line probfile ^ "\n% " ^ timestamp () ^
f75b6a3e1450 set "atps" reference's default value to "(remote_)e (remote_)spass (remote_)vampire", based on what is installed
blanchet
parents: 36287
diff changeset
   210
                       "\n"
36282
9a7c5b86a105 generate command-line in addition to timestamp in ATP output file, for debugging purposes
blanchet
parents: 36281
diff changeset
   211
                     else
36400
c5bae529f967 rename options and keep track of conjecture shape (to facilitate proof reconstruction)
blanchet
parents: 36393
diff changeset
   212
                       "") ^ output)
32257
bad5a99c16d8 neg_conjecture_clauses, neg_clausify_tac: proper context, eliminated METAHYPS;
wenzelm
parents: 32091
diff changeset
   213
36400
c5bae529f967 rename options and keep track of conjecture shape (to facilitate proof reconstruction)
blanchet
parents: 36393
diff changeset
   214
    val (((output, atp_run_time_in_msecs), res_code),
c5bae529f967 rename options and keep track of conjecture shape (to facilitate proof reconstruction)
blanchet
parents: 36393
diff changeset
   215
         (pool, conjecture_offset)) =
35570
0e30eef52d85 basic simplification of external_prover signature;
wenzelm
parents: 35010
diff changeset
   216
      with_path cleanup export run_on (prob_pathname subgoal);
36400
c5bae529f967 rename options and keep track of conjecture shape (to facilitate proof reconstruction)
blanchet
parents: 36393
diff changeset
   217
    val conjecture_shape = shape_of_clauses (conjecture_offset + 1) goal_clss
36167
c1a35be8e476 make Sledgehammer's output more debugging friendly
blanchet
parents: 36143
diff changeset
   218
    (* Check for success and print out some information on failure. *)
36370
a4f601daa175 centralized ATP-specific error handling in "atp_wrapper.ML"
blanchet
parents: 36369
diff changeset
   219
    val (proof, outcome) =
a4f601daa175 centralized ATP-specific error handling in "atp_wrapper.ML"
blanchet
parents: 36369
diff changeset
   220
      extract_proof_and_outcome res_code proof_delims known_failures output
35969
c9565298df9e added support for Sledgehammer parameters;
blanchet
parents: 35869
diff changeset
   221
    val (message, relevant_thm_names) =
36370
a4f601daa175 centralized ATP-specific error handling in "atp_wrapper.ML"
blanchet
parents: 36369
diff changeset
   222
      case outcome of
36400
c5bae529f967 rename options and keep track of conjecture shape (to facilitate proof reconstruction)
blanchet
parents: 36393
diff changeset
   223
        NONE =>
c5bae529f967 rename options and keep track of conjecture shape (to facilitate proof reconstruction)
blanchet
parents: 36393
diff changeset
   224
        proof_text isar_proof
36924
ff01d3ae9ad4 renamed options
blanchet
parents: 36922
diff changeset
   225
            (pool, debug, full_types, isar_shrink_factor, ctxt,
ff01d3ae9ad4 renamed options
blanchet
parents: 36922
diff changeset
   226
             conjecture_shape)
36910
dd5a31098f85 pass "full_type" argument to proof reconstruction
blanchet
parents: 36568
diff changeset
   227
            (minimize_command, proof, internal_thm_names, th, subgoal)
36370
a4f601daa175 centralized ATP-specific error handling in "atp_wrapper.ML"
blanchet
parents: 36369
diff changeset
   228
      | SOME failure => (string_for_failure failure ^ "\n", [])
32864
a226f29d4bdc re-organized signature of AtpWrapper structure: records instead of unnamed parameters and return values,
boehmes
parents: 32740
diff changeset
   229
  in
36393
be73a2b2443b support readable names even when Isar proof reconstruction is enabled -- useful for debugging
blanchet
parents: 36382
diff changeset
   230
    {outcome = outcome, message = message, pool = pool,
35969
c9565298df9e added support for Sledgehammer parameters;
blanchet
parents: 35869
diff changeset
   231
     relevant_thm_names = relevant_thm_names,
36369
d2cd0d04b8e6 handle ATP proof delimiters in a cleaner, more extensible fashion
blanchet
parents: 36289
diff changeset
   232
     atp_run_time_in_msecs = atp_run_time_in_msecs, output = output,
d2cd0d04b8e6 handle ATP proof delimiters in a cleaner, more extensible fashion
blanchet
parents: 36289
diff changeset
   233
     proof = proof, internal_thm_names = internal_thm_names,
36400
c5bae529f967 rename options and keep track of conjecture shape (to facilitate proof reconstruction)
blanchet
parents: 36393
diff changeset
   234
     conjecture_shape = conjecture_shape,
35969
c9565298df9e added support for Sledgehammer parameters;
blanchet
parents: 35869
diff changeset
   235
     filtered_clauses = the_filtered_clauses}
32942
b6711ec9de26 misc tuning and recovery of Isabelle coding style;
wenzelm
parents: 32941
diff changeset
   236
  end;
28592
824f8390aaa2 renamed AtpThread to AtpWrapper;
wenzelm
parents:
diff changeset
   237
28596
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
   238
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
   239
(* generic TPTP-based provers *)
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
   240
35865
2f8fb5242799 more Sledgehammer refactoring
blanchet
parents: 35826
diff changeset
   241
fun generic_tptp_prover
36917
8674cdb0b8cc query _HOME environment variables at run-time, not at build-time
blanchet
parents: 36910
diff changeset
   242
        (name, {home_var, executable, arguments, proof_delims, known_failures,
36382
b90fc0d75bca cosmetics
blanchet
parents: 36377
diff changeset
   243
                max_axiom_clauses, prefers_theory_relevant})
37347
635425a442e8 show more respect for user-specified facts, even if they could lead to unsound proofs + don't throw away "unsound" theorems in "full_type" mode, since they are then sound
blanchet
parents: 37346
diff changeset
   244
        (params as {debug, overlord, full_types, respect_no_atp,
635425a442e8 show more respect for user-specified facts, even if they could lead to unsound proofs + don't throw away "unsound" theorems in "full_type" mode, since they are then sound
blanchet
parents: 37346
diff changeset
   245
                    relevance_threshold, relevance_convergence, theory_relevant,
635425a442e8 show more respect for user-specified facts, even if they could lead to unsound proofs + don't throw away "unsound" theorems in "full_type" mode, since they are then sound
blanchet
parents: 37346
diff changeset
   246
                    defs_relevant, isar_proof, ...})
36281
dbbf4d5d584d pass relevant options from "sledgehammer" to "sledgehammer minimize";
blanchet
parents: 36265
diff changeset
   247
        minimize_command timeout =
36143
6490319b1703 added "overlord" option (to get easy access to output files for debugging) + systematically use "raw_goal" rather than an inconsistent mixture
blanchet
parents: 36142
diff changeset
   248
  generic_prover overlord
37347
635425a442e8 show more respect for user-specified facts, even if they could lead to unsound proofs + don't throw away "unsound" theorems in "full_type" mode, since they are then sound
blanchet
parents: 37346
diff changeset
   249
      (relevant_facts full_types respect_no_atp relevance_threshold
635425a442e8 show more respect for user-specified facts, even if they could lead to unsound proofs + don't throw away "unsound" theorems in "full_type" mode, since they are then sound
blanchet
parents: 37346
diff changeset
   250
                      relevance_convergence defs_relevant max_axiom_clauses
635425a442e8 show more respect for user-specified facts, even if they could lead to unsound proofs + don't throw away "unsound" theorems in "full_type" mode, since they are then sound
blanchet
parents: 37346
diff changeset
   251
                      (the_default prefers_theory_relevant theory_relevant))
36473
8a5c99a1c965 remove "higher_order" option from Sledgehammer -- the "smart" default is good enough
blanchet
parents: 36400
diff changeset
   252
      (prepare_clauses false)
36917
8674cdb0b8cc query _HOME environment variables at run-time, not at build-time
blanchet
parents: 36910
diff changeset
   253
      (write_tptp_file (debug andalso overlord)) home_var
36369
d2cd0d04b8e6 handle ATP proof delimiters in a cleaner, more extensible fashion
blanchet
parents: 36289
diff changeset
   254
      executable (arguments timeout) proof_delims known_failures name params
d2cd0d04b8e6 handle ATP proof delimiters in a cleaner, more extensible fashion
blanchet
parents: 36289
diff changeset
   255
      minimize_command
28596
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
   256
35969
c9565298df9e added support for Sledgehammer parameters;
blanchet
parents: 35869
diff changeset
   257
fun tptp_prover name p = (name, generic_tptp_prover (name, p));
28596
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
   258
32941
72d48e333b77 eliminated extraneous wrapping of public records;
wenzelm
parents: 32936
diff changeset
   259
32864
a226f29d4bdc re-organized signature of AtpWrapper structure: records instead of unnamed parameters and return values,
boehmes
parents: 32740
diff changeset
   260
(** common provers **)
28592
824f8390aaa2 renamed AtpThread to AtpWrapper;
wenzelm
parents:
diff changeset
   261
36382
b90fc0d75bca cosmetics
blanchet
parents: 36377
diff changeset
   262
fun to_generous_secs time = (Time.toMilliseconds time + 999) div 1000
36142
f5e15e9aae10 make Sledgehammer "minimize" output less confusing + round up (not down) time limits to nearest second
blanchet
parents: 36064
diff changeset
   263
28596
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
   264
(* Vampire *)
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
   265
36289
f75b6a3e1450 set "atps" reference's default value to "(remote_)e (remote_)spass (remote_)vampire", based on what is installed
blanchet
parents: 36287
diff changeset
   266
(* Vampire requires an explicit time limit. *)
28596
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
   267
35969
c9565298df9e added support for Sledgehammer parameters;
blanchet
parents: 35869
diff changeset
   268
val vampire_config : prover_config =
36917
8674cdb0b8cc query _HOME environment variables at run-time, not at build-time
blanchet
parents: 36910
diff changeset
   269
  {home_var = "VAMPIRE_HOME",
36289
f75b6a3e1450 set "atps" reference's default value to "(remote_)e (remote_)spass (remote_)vampire", based on what is installed
blanchet
parents: 36287
diff changeset
   270
   executable = "vampire",
36382
b90fc0d75bca cosmetics
blanchet
parents: 36377
diff changeset
   271
   arguments = fn timeout =>
b90fc0d75bca cosmetics
blanchet
parents: 36377
diff changeset
   272
     "--output_syntax tptp --mode casc -t " ^
b90fc0d75bca cosmetics
blanchet
parents: 36377
diff changeset
   273
     string_of_int (to_generous_secs timeout),
36548
a8a6d7172c8c try out Vampire 11 and parse its output correctly;
blanchet
parents: 36489
diff changeset
   274
   proof_delims =
a8a6d7172c8c try out Vampire 11 and parse its output correctly;
blanchet
parents: 36489
diff changeset
   275
     [("=========== Refutation ==========",
a8a6d7172c8c try out Vampire 11 and parse its output correctly;
blanchet
parents: 36489
diff changeset
   276
       "======= End of refutation ======="),
a8a6d7172c8c try out Vampire 11 and parse its output correctly;
blanchet
parents: 36489
diff changeset
   277
      ("% SZS output start Refutation", "% SZS output end Refutation")],
36265
41c9e755e552 distinguish between the different ATP errors in the user interface;
blanchet
parents: 36264
diff changeset
   278
   known_failures =
37415
521bc1d10445 better error reporting for Vampire
blanchet
parents: 37414
diff changeset
   279
     [(Unprovable, "UNPROVABLE"),
521bc1d10445 better error reporting for Vampire
blanchet
parents: 37414
diff changeset
   280
      (IncompleteUnprovable, "CANNOT PROVE"),
521bc1d10445 better error reporting for Vampire
blanchet
parents: 37414
diff changeset
   281
      (Unprovable, "Satisfiability detected"),
36370
a4f601daa175 centralized ATP-specific error handling in "atp_wrapper.ML"
blanchet
parents: 36369
diff changeset
   282
      (OutOfResources, "Refutation not found")],
36382
b90fc0d75bca cosmetics
blanchet
parents: 36377
diff changeset
   283
   max_axiom_clauses = 60,
36289
f75b6a3e1450 set "atps" reference's default value to "(remote_)e (remote_)spass (remote_)vampire", based on what is installed
blanchet
parents: 36287
diff changeset
   284
   prefers_theory_relevant = false}
35969
c9565298df9e added support for Sledgehammer parameters;
blanchet
parents: 35869
diff changeset
   285
val vampire = tptp_prover "vampire" vampire_config
28596
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
   286
28592
824f8390aaa2 renamed AtpThread to AtpWrapper;
wenzelm
parents:
diff changeset
   287
28596
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
   288
(* E prover *)
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
   289
36369
d2cd0d04b8e6 handle ATP proof delimiters in a cleaner, more extensible fashion
blanchet
parents: 36289
diff changeset
   290
val tstp_proof_delims =
d2cd0d04b8e6 handle ATP proof delimiters in a cleaner, more extensible fashion
blanchet
parents: 36289
diff changeset
   291
  ("# SZS output start CNFRefutation.", "# SZS output end CNFRefutation")
d2cd0d04b8e6 handle ATP proof delimiters in a cleaner, more extensible fashion
blanchet
parents: 36289
diff changeset
   292
35969
c9565298df9e added support for Sledgehammer parameters;
blanchet
parents: 35869
diff changeset
   293
val e_config : prover_config =
36917
8674cdb0b8cc query _HOME environment variables at run-time, not at build-time
blanchet
parents: 36910
diff changeset
   294
  {home_var = "E_HOME",
36289
f75b6a3e1450 set "atps" reference's default value to "(remote_)e (remote_)spass (remote_)vampire", based on what is installed
blanchet
parents: 36287
diff changeset
   295
   executable = "eproof",
36382
b90fc0d75bca cosmetics
blanchet
parents: 36377
diff changeset
   296
   arguments = fn timeout =>
b90fc0d75bca cosmetics
blanchet
parents: 36377
diff changeset
   297
     "--tstp-in --tstp-out -l5 -xAutoDev -tAutoDev --silent --cpu-limit=" ^
b90fc0d75bca cosmetics
blanchet
parents: 36377
diff changeset
   298
     string_of_int (to_generous_secs timeout),
36369
d2cd0d04b8e6 handle ATP proof delimiters in a cleaner, more extensible fashion
blanchet
parents: 36289
diff changeset
   299
   proof_delims = [tstp_proof_delims],
36265
41c9e755e552 distinguish between the different ATP errors in the user interface;
blanchet
parents: 36264
diff changeset
   300
   known_failures =
36370
a4f601daa175 centralized ATP-specific error handling in "atp_wrapper.ML"
blanchet
parents: 36369
diff changeset
   301
     [(Unprovable, "SZS status: Satisfiable"),
a4f601daa175 centralized ATP-specific error handling in "atp_wrapper.ML"
blanchet
parents: 36369
diff changeset
   302
      (Unprovable, "SZS status Satisfiable"),
a4f601daa175 centralized ATP-specific error handling in "atp_wrapper.ML"
blanchet
parents: 36369
diff changeset
   303
      (TimedOut, "Failure: Resource limit exceeded (time)"),
a4f601daa175 centralized ATP-specific error handling in "atp_wrapper.ML"
blanchet
parents: 36369
diff changeset
   304
      (TimedOut, "time limit exceeded"),
a4f601daa175 centralized ATP-specific error handling in "atp_wrapper.ML"
blanchet
parents: 36369
diff changeset
   305
      (OutOfResources,
a4f601daa175 centralized ATP-specific error handling in "atp_wrapper.ML"
blanchet
parents: 36369
diff changeset
   306
       "# Cannot determine problem status within resource limit"),
a4f601daa175 centralized ATP-specific error handling in "atp_wrapper.ML"
blanchet
parents: 36369
diff changeset
   307
      (OutOfResources, "SZS status: ResourceOut"),
a4f601daa175 centralized ATP-specific error handling in "atp_wrapper.ML"
blanchet
parents: 36369
diff changeset
   308
      (OutOfResources, "SZS status ResourceOut")],
36382
b90fc0d75bca cosmetics
blanchet
parents: 36377
diff changeset
   309
   max_axiom_clauses = 100,
36289
f75b6a3e1450 set "atps" reference's default value to "(remote_)e (remote_)spass (remote_)vampire", based on what is installed
blanchet
parents: 36287
diff changeset
   310
   prefers_theory_relevant = false}
35969
c9565298df9e added support for Sledgehammer parameters;
blanchet
parents: 35869
diff changeset
   311
val e = tptp_prover "e" e_config
28596
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
   312
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
   313
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
   314
(* SPASS *)
28592
824f8390aaa2 renamed AtpThread to AtpWrapper;
wenzelm
parents:
diff changeset
   315
35865
2f8fb5242799 more Sledgehammer refactoring
blanchet
parents: 35826
diff changeset
   316
fun generic_dfg_prover
36917
8674cdb0b8cc query _HOME environment variables at run-time, not at build-time
blanchet
parents: 36910
diff changeset
   317
        (name, {home_var, executable, arguments, proof_delims, known_failures,
36382
b90fc0d75bca cosmetics
blanchet
parents: 36377
diff changeset
   318
                max_axiom_clauses, prefers_theory_relevant})
37347
635425a442e8 show more respect for user-specified facts, even if they could lead to unsound proofs + don't throw away "unsound" theorems in "full_type" mode, since they are then sound
blanchet
parents: 37346
diff changeset
   319
        (params as {overlord, full_types, respect_no_atp, relevance_threshold,
36922
12f87df9c1a5 renamed two Sledgehammer options
blanchet
parents: 36917
diff changeset
   320
                    relevance_convergence, theory_relevant, defs_relevant, ...})
36281
dbbf4d5d584d pass relevant options from "sledgehammer" to "sledgehammer minimize";
blanchet
parents: 36265
diff changeset
   321
        minimize_command timeout =
36143
6490319b1703 added "overlord" option (to get easy access to output files for debugging) + systematically use "raw_goal" rather than an inconsistent mixture
blanchet
parents: 36142
diff changeset
   322
  generic_prover overlord
37347
635425a442e8 show more respect for user-specified facts, even if they could lead to unsound proofs + don't throw away "unsound" theorems in "full_type" mode, since they are then sound
blanchet
parents: 37346
diff changeset
   323
      (relevant_facts full_types respect_no_atp relevance_threshold
635425a442e8 show more respect for user-specified facts, even if they could lead to unsound proofs + don't throw away "unsound" theorems in "full_type" mode, since they are then sound
blanchet
parents: 37346
diff changeset
   324
                      relevance_convergence defs_relevant max_axiom_clauses
635425a442e8 show more respect for user-specified facts, even if they could lead to unsound proofs + don't throw away "unsound" theorems in "full_type" mode, since they are then sound
blanchet
parents: 37346
diff changeset
   325
                      (the_default prefers_theory_relevant theory_relevant))
36917
8674cdb0b8cc query _HOME environment variables at run-time, not at build-time
blanchet
parents: 36910
diff changeset
   326
      (prepare_clauses true) write_dfg_file home_var executable
36369
d2cd0d04b8e6 handle ATP proof delimiters in a cleaner, more extensible fashion
blanchet
parents: 36289
diff changeset
   327
      (arguments timeout) proof_delims known_failures name params
d2cd0d04b8e6 handle ATP proof delimiters in a cleaner, more extensible fashion
blanchet
parents: 36289
diff changeset
   328
      minimize_command
32869
159309603edc recovered support for Spass: re-enabled writing problems in DFG format
boehmes
parents: 32864
diff changeset
   329
36264
3c2490917710 added "spass_tptp" prover, which requires SPASS x.y > 3.0;
blanchet
parents: 36235
diff changeset
   330
fun dfg_prover name p = (name, generic_dfg_prover (name, p))
32869
159309603edc recovered support for Spass: re-enabled writing problems in DFG format
boehmes
parents: 32864
diff changeset
   331
36219
16670b4f0baa set SPASS option on the command-line, so that it doesn't vanish when moving to TPTP format
blanchet
parents: 36190
diff changeset
   332
(* The "-VarWeight=3" option helps the higher-order problems, probably by
16670b4f0baa set SPASS option on the command-line, so that it doesn't vanish when moving to TPTP format
blanchet
parents: 36190
diff changeset
   333
   counteracting the presence of "hAPP". *)
37414
d0cea0796295 expect SPASS 3.7, and give a friendly warning if an older version is used
blanchet
parents: 37413
diff changeset
   334
fun generic_spass_config dfg : prover_config =
36917
8674cdb0b8cc query _HOME environment variables at run-time, not at build-time
blanchet
parents: 36910
diff changeset
   335
  {home_var = "SPASS_HOME",
36289
f75b6a3e1450 set "atps" reference's default value to "(remote_)e (remote_)spass (remote_)vampire", based on what is installed
blanchet
parents: 36287
diff changeset
   336
   executable = "SPASS",
36382
b90fc0d75bca cosmetics
blanchet
parents: 36377
diff changeset
   337
   arguments = fn timeout =>
b90fc0d75bca cosmetics
blanchet
parents: 36377
diff changeset
   338
     "-Auto -SOS=1 -PGiven=0 -PProblem=0 -Splits=0 -FullRed=0 -DocProof \
37414
d0cea0796295 expect SPASS 3.7, and give a friendly warning if an older version is used
blanchet
parents: 37413
diff changeset
   339
     \-VarWeight=3 -TimeLimit=" ^ string_of_int (to_generous_secs timeout)
d0cea0796295 expect SPASS 3.7, and give a friendly warning if an older version is used
blanchet
parents: 37413
diff changeset
   340
     |> not dfg ? prefix "-TPTP ",
36369
d2cd0d04b8e6 handle ATP proof delimiters in a cleaner, more extensible fashion
blanchet
parents: 36289
diff changeset
   341
   proof_delims = [("Here is a proof", "Formulae used in the proof")],
36289
f75b6a3e1450 set "atps" reference's default value to "(remote_)e (remote_)spass (remote_)vampire", based on what is installed
blanchet
parents: 36287
diff changeset
   342
   known_failures =
37413
e856582fe9c4 improve ATP-specific error messages
blanchet
parents: 37347
diff changeset
   343
     [(IncompleteUnprovable, "SPASS beiseite: Completion found"),
36370
a4f601daa175 centralized ATP-specific error handling in "atp_wrapper.ML"
blanchet
parents: 36369
diff changeset
   344
      (TimedOut, "SPASS beiseite: Ran out of time"),
36965
67ae217c6b5c identify common SPASS error more clearly
blanchet
parents: 36924
diff changeset
   345
      (OutOfResources, "SPASS beiseite: Maximal number of loops exceeded"),
37413
e856582fe9c4 improve ATP-specific error messages
blanchet
parents: 37347
diff changeset
   346
      (MalformedInput, "Undefined symbol"),
37414
d0cea0796295 expect SPASS 3.7, and give a friendly warning if an older version is used
blanchet
parents: 37413
diff changeset
   347
      (MalformedInput, "Free Variable"),
d0cea0796295 expect SPASS 3.7, and give a friendly warning if an older version is used
blanchet
parents: 37413
diff changeset
   348
      (OldSpass, "unrecognized option `-TPTP'"),
d0cea0796295 expect SPASS 3.7, and give a friendly warning if an older version is used
blanchet
parents: 37413
diff changeset
   349
      (OldSpass, "Unrecognized option TPTP")],
36382
b90fc0d75bca cosmetics
blanchet
parents: 36377
diff changeset
   350
   max_axiom_clauses = 40,
36289
f75b6a3e1450 set "atps" reference's default value to "(remote_)e (remote_)spass (remote_)vampire", based on what is installed
blanchet
parents: 36287
diff changeset
   351
   prefers_theory_relevant = true}
37414
d0cea0796295 expect SPASS 3.7, and give a friendly warning if an older version is used
blanchet
parents: 37413
diff changeset
   352
val spass_dfg_config = generic_spass_config true
d0cea0796295 expect SPASS 3.7, and give a friendly warning if an older version is used
blanchet
parents: 37413
diff changeset
   353
val spass_dfg = dfg_prover "spass_dfg" spass_dfg_config
35969
c9565298df9e added support for Sledgehammer parameters;
blanchet
parents: 35869
diff changeset
   354
37414
d0cea0796295 expect SPASS 3.7, and give a friendly warning if an older version is used
blanchet
parents: 37413
diff changeset
   355
val spass_config = generic_spass_config false
d0cea0796295 expect SPASS 3.7, and give a friendly warning if an older version is used
blanchet
parents: 37413
diff changeset
   356
val spass = tptp_prover "spass" spass_config
28596
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
   357
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
   358
(* remote prover invocation via SystemOnTPTP *)
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
   359
36376
e83d52a52449 renamed module "ATP_Wrapper" to "ATP_Systems"
blanchet
parents: 36371
diff changeset
   360
val systems = Synchronized.var "atp_systems" ([]: string list);
31835
b686d4df54c2 check for current versions on server
immler@in.tum.de
parents: 31832
diff changeset
   361
b686d4df54c2 check for current versions on server
immler@in.tum.de
parents: 31832
diff changeset
   362
fun get_systems () =
36370
a4f601daa175 centralized ATP-specific error handling in "atp_wrapper.ML"
blanchet
parents: 36369
diff changeset
   363
  case bash_output "\"$ISABELLE_ATP_MANAGER/SystemOnTPTP\" -w" of
a4f601daa175 centralized ATP-specific error handling in "atp_wrapper.ML"
blanchet
parents: 36369
diff changeset
   364
    (answer, 0) => split_lines answer
a4f601daa175 centralized ATP-specific error handling in "atp_wrapper.ML"
blanchet
parents: 36369
diff changeset
   365
  | (answer, _) =>
a4f601daa175 centralized ATP-specific error handling in "atp_wrapper.ML"
blanchet
parents: 36369
diff changeset
   366
    error ("Failed to get available systems at SystemOnTPTP:\n" ^ answer)
31835
b686d4df54c2 check for current versions on server
immler@in.tum.de
parents: 31832
diff changeset
   367
35867
16279c4c7a33 move all ATP setup code into ATP_Wrapper
blanchet
parents: 35865
diff changeset
   368
fun refresh_systems_on_tptp () =
16279c4c7a33 move all ATP setup code into ATP_Wrapper
blanchet
parents: 35865
diff changeset
   369
  Synchronized.change systems (fn _ => get_systems ());
31835
b686d4df54c2 check for current versions on server
immler@in.tum.de
parents: 31832
diff changeset
   370
b686d4df54c2 check for current versions on server
immler@in.tum.de
parents: 31832
diff changeset
   371
fun get_system prefix = Synchronized.change_result systems (fn systems =>
32864
a226f29d4bdc re-organized signature of AtpWrapper structure: records instead of unnamed parameters and return values,
boehmes
parents: 32740
diff changeset
   372
  (if null systems then get_systems () else systems)
32942
b6711ec9de26 misc tuning and recovery of Isabelle coding style;
wenzelm
parents: 32941
diff changeset
   373
  |> `(find_first (String.isPrefix prefix)));
32864
a226f29d4bdc re-organized signature of AtpWrapper structure: records instead of unnamed parameters and return values,
boehmes
parents: 32740
diff changeset
   374
32948
e95a4be101a8 natural argument order for prover;
wenzelm
parents: 32944
diff changeset
   375
fun the_system prefix =
32864
a226f29d4bdc re-organized signature of AtpWrapper structure: records instead of unnamed parameters and return values,
boehmes
parents: 32740
diff changeset
   376
  (case get_system prefix of
36370
a4f601daa175 centralized ATP-specific error handling in "atp_wrapper.ML"
blanchet
parents: 36369
diff changeset
   377
    NONE => error ("System " ^ quote prefix ^
a4f601daa175 centralized ATP-specific error handling in "atp_wrapper.ML"
blanchet
parents: 36369
diff changeset
   378
                   " not available at SystemOnTPTP.")
32942
b6711ec9de26 misc tuning and recovery of Isabelle coding style;
wenzelm
parents: 32941
diff changeset
   379
  | SOME sys => sys);
31835
b686d4df54c2 check for current versions on server
immler@in.tum.de
parents: 31832
diff changeset
   380
36265
41c9e755e552 distinguish between the different ATP errors in the user interface;
blanchet
parents: 36264
diff changeset
   381
val remote_known_failures =
36370
a4f601daa175 centralized ATP-specific error handling in "atp_wrapper.ML"
blanchet
parents: 36369
diff changeset
   382
  [(TimedOut, "says Timeout"),
36377
b3dce4c715d0 now rename the file "atp_wrapper.ML" to "atp_systems.ML" + fix typo in "SystemOnTPTP" script
blanchet
parents: 36376
diff changeset
   383
   (MalformedOutput, "Remote script could not extract proof")]
35865
2f8fb5242799 more Sledgehammer refactoring
blanchet
parents: 35826
diff changeset
   384
36382
b90fc0d75bca cosmetics
blanchet
parents: 36377
diff changeset
   385
fun remote_prover_config atp_prefix args
b90fc0d75bca cosmetics
blanchet
parents: 36377
diff changeset
   386
        ({proof_delims, known_failures, max_axiom_clauses,
36369
d2cd0d04b8e6 handle ATP proof delimiters in a cleaner, more extensible fashion
blanchet
parents: 36289
diff changeset
   387
          prefers_theory_relevant, ...} : prover_config) : prover_config =
36917
8674cdb0b8cc query _HOME environment variables at run-time, not at build-time
blanchet
parents: 36910
diff changeset
   388
  {home_var = "ISABELLE_ATP_MANAGER",
36289
f75b6a3e1450 set "atps" reference's default value to "(remote_)e (remote_)spass (remote_)vampire", based on what is installed
blanchet
parents: 36287
diff changeset
   389
   executable = "SystemOnTPTP",
36382
b90fc0d75bca cosmetics
blanchet
parents: 36377
diff changeset
   390
   arguments = fn timeout =>
b90fc0d75bca cosmetics
blanchet
parents: 36377
diff changeset
   391
     args ^ " -t " ^ string_of_int (to_generous_secs timeout) ^ " -s " ^
b90fc0d75bca cosmetics
blanchet
parents: 36377
diff changeset
   392
     the_system atp_prefix,
36369
d2cd0d04b8e6 handle ATP proof delimiters in a cleaner, more extensible fashion
blanchet
parents: 36289
diff changeset
   393
   proof_delims = insert (op =) tstp_proof_delims proof_delims,
36265
41c9e755e552 distinguish between the different ATP errors in the user interface;
blanchet
parents: 36264
diff changeset
   394
   known_failures = remote_known_failures @ known_failures,
36382
b90fc0d75bca cosmetics
blanchet
parents: 36377
diff changeset
   395
   max_axiom_clauses = max_axiom_clauses,
36289
f75b6a3e1450 set "atps" reference's default value to "(remote_)e (remote_)spass (remote_)vampire", based on what is installed
blanchet
parents: 36287
diff changeset
   396
   prefers_theory_relevant = prefers_theory_relevant}
28596
fcd463a6b6de tuned interfaces -- plain prover function, without thread;
wenzelm
parents: 28592
diff changeset
   397
35969
c9565298df9e added support for Sledgehammer parameters;
blanchet
parents: 35869
diff changeset
   398
val remote_vampire =
36289
f75b6a3e1450 set "atps" reference's default value to "(remote_)e (remote_)spass (remote_)vampire", based on what is installed
blanchet
parents: 36287
diff changeset
   399
  tptp_prover (remotify (fst vampire))
36552
2c042d86c711 back to Vampire 9 -- Vampire 11 sometimes outputs really weird proofs
blanchet
parents: 36549
diff changeset
   400
              (remote_prover_config "Vampire---9" "" vampire_config)
32864
a226f29d4bdc re-organized signature of AtpWrapper structure: records instead of unnamed parameters and return values,
boehmes
parents: 32740
diff changeset
   401
35969
c9565298df9e added support for Sledgehammer parameters;
blanchet
parents: 35869
diff changeset
   402
val remote_e =
36289
f75b6a3e1450 set "atps" reference's default value to "(remote_)e (remote_)spass (remote_)vampire", based on what is installed
blanchet
parents: 36287
diff changeset
   403
  tptp_prover (remotify (fst e))
f75b6a3e1450 set "atps" reference's default value to "(remote_)e (remote_)spass (remote_)vampire", based on what is installed
blanchet
parents: 36287
diff changeset
   404
              (remote_prover_config "EP---" "" e_config)
32864
a226f29d4bdc re-organized signature of AtpWrapper structure: records instead of unnamed parameters and return values,
boehmes
parents: 32740
diff changeset
   405
35969
c9565298df9e added support for Sledgehammer parameters;
blanchet
parents: 35869
diff changeset
   406
val remote_spass =
36289
f75b6a3e1450 set "atps" reference's default value to "(remote_)e (remote_)spass (remote_)vampire", based on what is installed
blanchet
parents: 36287
diff changeset
   407
  tptp_prover (remotify (fst spass))
f75b6a3e1450 set "atps" reference's default value to "(remote_)e (remote_)spass (remote_)vampire", based on what is installed
blanchet
parents: 36287
diff changeset
   408
              (remote_prover_config "SPASS---" "-x" spass_config)
28592
824f8390aaa2 renamed AtpThread to AtpWrapper;
wenzelm
parents:
diff changeset
   409
36917
8674cdb0b8cc query _HOME environment variables at run-time, not at build-time
blanchet
parents: 36910
diff changeset
   410
fun maybe_remote (name, _) ({home_var, ...} : prover_config) =
8674cdb0b8cc query _HOME environment variables at run-time, not at build-time
blanchet
parents: 36910
diff changeset
   411
  name |> getenv home_var = "" ? remotify
36371
8c83ea1a7740 move the Sledgehammer menu options to "sledgehammer_isar.ML"
blanchet
parents: 36370
diff changeset
   412
8c83ea1a7740 move the Sledgehammer menu options to "sledgehammer_isar.ML"
blanchet
parents: 36370
diff changeset
   413
fun default_atps_param_value () =
8c83ea1a7740 move the Sledgehammer menu options to "sledgehammer_isar.ML"
blanchet
parents: 36370
diff changeset
   414
  space_implode " " [maybe_remote e e_config, maybe_remote spass spass_config,
8c83ea1a7740 move the Sledgehammer menu options to "sledgehammer_isar.ML"
blanchet
parents: 36370
diff changeset
   415
                     remotify (fst vampire)]
8c83ea1a7740 move the Sledgehammer menu options to "sledgehammer_isar.ML"
blanchet
parents: 36370
diff changeset
   416
36289
f75b6a3e1450 set "atps" reference's default value to "(remote_)e (remote_)spass (remote_)vampire", based on what is installed
blanchet
parents: 36287
diff changeset
   417
val provers =
37414
d0cea0796295 expect SPASS 3.7, and give a friendly warning if an older version is used
blanchet
parents: 37413
diff changeset
   418
  [spass, spass_dfg, vampire, e, remote_vampire, remote_spass, remote_e]
35867
16279c4c7a33 move all ATP setup code into ATP_Wrapper
blanchet
parents: 35865
diff changeset
   419
val prover_setup = fold add_prover provers
16279c4c7a33 move all ATP setup code into ATP_Wrapper
blanchet
parents: 35865
diff changeset
   420
16279c4c7a33 move all ATP setup code into ATP_Wrapper
blanchet
parents: 35865
diff changeset
   421
val setup =
36376
e83d52a52449 renamed module "ATP_Wrapper" to "ATP_Systems"
blanchet
parents: 36371
diff changeset
   422
  dest_dir_setup
35867
16279c4c7a33 move all ATP setup code into ATP_Wrapper
blanchet
parents: 35865
diff changeset
   423
  #> problem_prefix_setup
16279c4c7a33 move all ATP setup code into ATP_Wrapper
blanchet
parents: 35865
diff changeset
   424
  #> measure_runtime_setup
36371
8c83ea1a7740 move the Sledgehammer menu options to "sledgehammer_isar.ML"
blanchet
parents: 36370
diff changeset
   425
  #> prover_setup
35867
16279c4c7a33 move all ATP setup code into ATP_Wrapper
blanchet
parents: 35865
diff changeset
   426
28592
824f8390aaa2 renamed AtpThread to AtpWrapper;
wenzelm
parents:
diff changeset
   427
end;