src/HOL/Tools/Sledgehammer/sledgehammer_isar.ML
author blanchet
Thu May 05 00:22:37 2011 +0200 (2011-05-05 ago)
changeset 42688 097a61baeca9
parent 42613 23b13b1bd565
child 42724 4d6bcf846759
permissions -rw-r--r--
smoother handling of ! and ? in type system names
blanchet@36375
     1
(*  Title:      HOL/Tools/Sledgehammer/sledgehammer_isar.ML
blanchet@35866
     2
    Author:     Jasmin Blanchette, TU Muenchen
blanchet@35866
     3
blanchet@35866
     4
Adds "sledgehammer" and related commands to Isabelle/Isar's outer syntax.
blanchet@35866
     5
*)
blanchet@35866
     6
blanchet@35963
     7
signature SLEDGEHAMMER_ISAR =
blanchet@35963
     8
sig
blanchet@41087
     9
  type params = Sledgehammer_Provers.params
blanchet@35963
    10
blanchet@39318
    11
  val auto : bool Unsynchronized.ref
blanchet@40059
    12
  val provers : string Unsynchronized.ref
blanchet@39318
    13
  val timeout : int Unsynchronized.ref
blanchet@39318
    14
  val full_types : bool Unsynchronized.ref
blanchet@40069
    15
  val default_params : Proof.context -> (string * string) list -> params
blanchet@39318
    16
  val setup : theory -> theory
blanchet@35963
    17
end;
blanchet@35963
    18
blanchet@35971
    19
structure Sledgehammer_Isar : SLEDGEHAMMER_ISAR =
blanchet@35866
    20
struct
blanchet@35866
    21
blanchet@38028
    22
open ATP_Systems
blanchet@35971
    23
open Sledgehammer_Util
blanchet@41138
    24
open Sledgehammer_ATP_Translate
blanchet@41087
    25
open Sledgehammer_Provers
blanchet@38988
    26
open Sledgehammer_Minimize
blanchet@41087
    27
open Sledgehammer_Run
blanchet@35866
    28
blanchet@39318
    29
val auto = Unsynchronized.ref false
blanchet@39318
    30
blanchet@39318
    31
val _ =
blanchet@39318
    32
  ProofGeneralPgip.add_preference Preferences.category_tracing
blanchet@39318
    33
      (Preferences.bool_pref auto "auto-sledgehammer"
blanchet@39327
    34
           "Run Sledgehammer automatically.")
blanchet@39318
    35
blanchet@36394
    36
(** Sledgehammer commands **)
blanchet@36394
    37
blanchet@39318
    38
val no_relevance_override = {add = [], del = [], only = false}
blanchet@39318
    39
fun add_relevance_override ns : relevance_override =
blanchet@35966
    40
  {add = ns, del = [], only = false}
blanchet@39318
    41
fun del_relevance_override ns : relevance_override =
blanchet@35966
    42
  {add = [], del = ns, only = false}
blanchet@35966
    43
fun only_relevance_override ns : relevance_override =
blanchet@35966
    44
  {add = ns, del = [], only = true}
blanchet@36003
    45
fun merge_relevance_override_pairwise (r1 : relevance_override)
blanchet@36003
    46
                                      (r2 : relevance_override) =
blanchet@35966
    47
  {add = #add r1 @ #add r2, del = #del r1 @ #del r2,
blanchet@36183
    48
   only = #only r1 andalso #only r2}
blanchet@36188
    49
fun merge_relevance_overrides rs =
blanchet@36188
    50
  fold merge_relevance_override_pairwise rs (only_relevance_override [])
blanchet@35965
    51
blanchet@36371
    52
(*** parameters ***)
blanchet@36371
    53
blanchet@40059
    54
val provers = Unsynchronized.ref ""
blanchet@39335
    55
val timeout = Unsynchronized.ref 30
blanchet@36371
    56
val full_types = Unsynchronized.ref false
blanchet@36371
    57
blanchet@36371
    58
val _ =
blanchet@36371
    59
  ProofGeneralPgip.add_preference Preferences.category_proof
blanchet@40059
    60
      (Preferences.string_pref provers
blanchet@40059
    61
          "Sledgehammer: Provers"
blanchet@36371
    62
          "Default automatic provers (separated by whitespace)")
blanchet@36371
    63
blanchet@36371
    64
val _ =
blanchet@36371
    65
  ProofGeneralPgip.add_preference Preferences.category_proof
blanchet@36371
    66
      (Preferences.int_pref timeout
blanchet@36373
    67
          "Sledgehammer: Time Limit"
blanchet@36371
    68
          "ATPs will be interrupted after this time (in seconds)")
blanchet@36371
    69
blanchet@36371
    70
val _ =
blanchet@36371
    71
  ProofGeneralPgip.add_preference Preferences.category_proof
blanchet@36371
    72
      (Preferences.bool_pref full_types
blanchet@36373
    73
          "Sledgehammer: Full Types" "ATPs will use full type information")
blanchet@36371
    74
blanchet@35963
    75
type raw_param = string * string list
blanchet@35963
    76
blanchet@35963
    77
val default_default_params =
blanchet@41208
    78
  [("debug", "false"),
blanchet@35963
    79
   ("verbose", "false"),
blanchet@36143
    80
   ("overlord", "false"),
blanchet@41208
    81
   ("blocking", "false"),
blanchet@42523
    82
   ("type_sys", "smart"),
blanchet@42180
    83
   ("relevance_thresholds", "0.45 0.85"),
blanchet@42180
    84
   ("max_relevant", "smart"),
blanchet@42180
    85
   ("monomorphize_limit", "4"),
blanchet@36235
    86
   ("explicit_apply", "false"),
blanchet@35963
    87
   ("isar_proof", "false"),
blanchet@42443
    88
   ("isar_shrink_factor", "1"),
blanchet@42443
    89
   ("slicing", "true")]
blanchet@35963
    90
blanchet@36140
    91
val alias_params =
blanchet@40059
    92
  [("prover", "provers"),
blanchet@40059
    93
   ("atps", "provers"), (* FIXME: legacy *)
blanchet@40059
    94
   ("atp", "provers")]  (* FIXME: legacy *)
blanchet@36140
    95
val negated_alias_params =
blanchet@41208
    96
  [("no_debug", "debug"),
blanchet@35963
    97
   ("quiet", "verbose"),
blanchet@36143
    98
   ("no_overlord", "overlord"),
blanchet@41208
    99
   ("non_blocking", "blocking"),
blanchet@36399
   100
   ("partial_types", "full_types"),
blanchet@36235
   101
   ("implicit_apply", "explicit_apply"),
blanchet@42443
   102
   ("no_isar_proof", "isar_proof"),
blanchet@42443
   103
   ("no_slicing", "slicing")]
blanchet@35963
   104
blanchet@36281
   105
val params_for_minimize =
blanchet@41136
   106
  ["debug", "verbose", "overlord", "type_sys", "full_types", "isar_proof",
blanchet@38590
   107
   "isar_shrink_factor", "timeout"]
blanchet@36281
   108
blanchet@40059
   109
val property_dependent_params = ["provers", "full_types", "timeout"]
blanchet@35866
   110
blanchet@35963
   111
fun is_known_raw_param s =
blanchet@35963
   112
  AList.defined (op =) default_default_params s orelse
blanchet@36140
   113
  AList.defined (op =) alias_params s orelse
blanchet@36140
   114
  AList.defined (op =) negated_alias_params s orelse
blanchet@38985
   115
  member (op =) property_dependent_params s orelse s = "expect"
blanchet@35963
   116
blanchet@41258
   117
fun is_prover_list ctxt s =
blanchet@41258
   118
  case space_explode " " s of
blanchet@41727
   119
    ss as _ :: _ => forall (is_prover_supported ctxt) ss
blanchet@41258
   120
  | _ => false
blanchet@41258
   121
blanchet@41258
   122
fun check_and_repair_raw_param ctxt (name, value) =
blanchet@41258
   123
  if is_known_raw_param name then (name, value)
blanchet@41258
   124
  else if is_prover_list ctxt name andalso null value then ("provers", [name])
blanchet@41258
   125
  else error ("Unknown parameter: " ^ quote name ^ ".")
blanchet@35866
   126
blanchet@36140
   127
fun unalias_raw_param (name, value) =
blanchet@36140
   128
  case AList.lookup (op =) alias_params name of
blanchet@36140
   129
    SOME name' => (name', value)
blanchet@36140
   130
  | NONE =>
blanchet@36140
   131
    case AList.lookup (op =) negated_alias_params name of
blanchet@36140
   132
      SOME name' => (name', case value of
blanchet@36140
   133
                              ["false"] => ["true"]
blanchet@36140
   134
                            | ["true"] => ["false"]
blanchet@36140
   135
                            | [] => ["false"]
blanchet@36140
   136
                            | _ => value)
blanchet@36140
   137
    | NONE => (name, value)
blanchet@35963
   138
wenzelm@41472
   139
structure Data = Theory_Data
wenzelm@41472
   140
(
blanchet@35963
   141
  type T = raw_param list
blanchet@35963
   142
  val empty = default_default_params |> map (apsnd single)
blanchet@35963
   143
  val extend = I
wenzelm@41472
   144
  fun merge data : T = AList.merge (op =) (K true) data
wenzelm@41472
   145
)
blanchet@35866
   146
blanchet@41727
   147
fun remotify_prover_if_supported_and_not_already_remote ctxt name =
blanchet@40072
   148
  if String.isPrefix remote_prefix name then
blanchet@40072
   149
    SOME name
blanchet@40072
   150
  else
blanchet@40072
   151
    let val remote_name = remote_prefix ^ name in
blanchet@41727
   152
      if is_prover_supported ctxt remote_name then SOME remote_name else NONE
blanchet@40072
   153
    end
blanchet@40072
   154
blanchet@40072
   155
fun remotify_prover_if_not_installed ctxt name =
blanchet@41727
   156
  if is_prover_supported ctxt name andalso is_prover_installed ctxt name then
blanchet@40941
   157
    SOME name
blanchet@40941
   158
  else
blanchet@41727
   159
    remotify_prover_if_supported_and_not_already_remote ctxt name
blanchet@40072
   160
blanchet@40072
   161
fun avoid_too_many_local_threads _ _ [] = []
blanchet@40941
   162
  | avoid_too_many_local_threads ctxt 0 provers =
blanchet@41727
   163
    map_filter (remotify_prover_if_supported_and_not_already_remote ctxt)
blanchet@40941
   164
               provers
blanchet@40941
   165
  | avoid_too_many_local_threads ctxt n (prover :: provers) =
blanchet@40072
   166
    let val n = if String.isPrefix remote_prefix prover then n else n - 1 in
blanchet@40941
   167
      prover :: avoid_too_many_local_threads ctxt n provers
blanchet@40072
   168
    end
blanchet@40059
   169
blanchet@42688
   170
(* Ensure that type systems such as "simple!" and "mangled_preds?" are handled
blanchet@42688
   171
   correctly. *)
blanchet@42688
   172
fun implode_param_value [s, "?"] = s ^ "?"
blanchet@42688
   173
  | implode_param_value [s, "!"] = s ^ "!"
blanchet@42688
   174
  | implode_param_value ss = space_implode " " ss
blanchet@42688
   175
blanchet@40059
   176
(* The first ATP of the list is used by Auto Sledgehammer. Because of the low
blanchet@40059
   177
   timeout, it makes sense to put SPASS first. *)
blanchet@40069
   178
fun default_provers_param_value ctxt =
blanchet@40941
   179
  [spassN, eN, vampireN, sine_eN, SMT_Solver.solver_name_of ctxt]
blanchet@40941
   180
  |> map_filter (remotify_prover_if_not_installed ctxt)
blanchet@40941
   181
  |> avoid_too_many_local_threads ctxt (Multithreading.max_threads_value ())
blanchet@42688
   182
  |> implode_param_value
blanchet@40059
   183
blanchet@36140
   184
val set_default_raw_param = Data.map o AList.update (op =) o unalias_raw_param
blanchet@40069
   185
fun default_raw_params ctxt =
wenzelm@42361
   186
  let val thy = Proof_Context.theory_of ctxt in
blanchet@40069
   187
    Data.get thy
blanchet@40069
   188
    |> fold (AList.default (op =))
blanchet@40069
   189
            [("provers", [case !provers of
blanchet@40069
   190
                            "" => default_provers_param_value ctxt
blanchet@40069
   191
                          | s => s]),
blanchet@40069
   192
             ("full_types", [if !full_types then "true" else "false"]),
blanchet@40069
   193
             ("timeout", let val timeout = !timeout in
blanchet@40069
   194
                           [if timeout <= 0 then "none"
blanchet@40341
   195
                            else string_of_int timeout]
blanchet@40069
   196
                         end)]
blanchet@40069
   197
  end
blanchet@35963
   198
blanchet@35963
   199
val infinity_time_in_secs = 60 * 60 * 24 * 365
blanchet@35963
   200
val the_timeout = the_default (Time.fromSeconds infinity_time_in_secs)
blanchet@35866
   201
blanchet@39318
   202
fun extract_params auto default_params override_params =
blanchet@35963
   203
  let
blanchet@36140
   204
    val override_params = map unalias_raw_param override_params
blanchet@35963
   205
    val raw_params = rev override_params @ rev default_params
blanchet@42688
   206
    val lookup = Option.map implode_param_value o AList.lookup (op =) raw_params
blanchet@35963
   207
    val lookup_string = the_default "" o lookup
blanchet@35963
   208
    fun general_lookup_bool option default_value name =
blanchet@35963
   209
      case lookup name of
blanchet@35970
   210
        SOME s => parse_bool_option option name s
blanchet@35963
   211
      | NONE => default_value
blanchet@35963
   212
    val lookup_bool = the o general_lookup_bool false (SOME false)
blanchet@35963
   213
    fun lookup_time name =
blanchet@39318
   214
      case lookup name of
blanchet@39318
   215
        SOME s => parse_time_option name s
blanchet@39318
   216
      | NONE => NONE
blanchet@35966
   217
    fun lookup_int name =
blanchet@35963
   218
      case lookup name of
blanchet@35966
   219
        NONE => 0
blanchet@35966
   220
      | SOME s => case Int.fromString s of
blanchet@35966
   221
                    SOME n => n
blanchet@35966
   222
                  | NONE => error ("Parameter " ^ quote name ^
blanchet@35966
   223
                                   " must be assigned an integer value.")
blanchet@40343
   224
    fun lookup_real_pair name =
blanchet@38745
   225
      case lookup name of
blanchet@40343
   226
        NONE => (0.0, 0.0)
blanchet@40343
   227
      | SOME s => case s |> space_explode " " |> map Real.fromString of
blanchet@40343
   228
                    [SOME r1, SOME r2] => (r1, r2)
blanchet@38745
   229
                  | _ => error ("Parameter " ^ quote name ^
blanchet@40343
   230
                                "must be assigned a pair of floating-point \
blanchet@40343
   231
                                \values (e.g., \"0.6 0.95\")")
blanchet@38589
   232
    fun lookup_int_option name =
blanchet@38589
   233
      case lookup name of
blanchet@38589
   234
        SOME "smart" => NONE
blanchet@38589
   235
      | _ => SOME (lookup_int name)
blanchet@39318
   236
    val debug = not auto andalso lookup_bool "debug"
blanchet@39318
   237
    val verbose = debug orelse (not auto andalso lookup_bool "verbose")
blanchet@36143
   238
    val overlord = lookup_bool "overlord"
blanchet@41208
   239
    val blocking = auto orelse debug orelse lookup_bool "blocking"
blanchet@40059
   240
    val provers = lookup_string "provers" |> space_explode " "
blanchet@40059
   241
                  |> auto ? single o hd
blanchet@42548
   242
    val type_sys =
blanchet@42613
   243
      case lookup_string "type_sys" of
blanchet@42613
   244
        "smart" => Smart_Type_Sys (lookup_bool "full_types")
blanchet@42613
   245
      | s => Dumb_Type_Sys (type_sys_from_string s)
blanchet@42180
   246
    val relevance_thresholds = lookup_real_pair "relevance_thresholds"
blanchet@42180
   247
    val max_relevant = lookup_int_option "max_relevant"
blanchet@42180
   248
    val monomorphize_limit = lookup_int "monomorphize_limit"
blanchet@36235
   249
    val explicit_apply = lookup_bool "explicit_apply"
blanchet@35963
   250
    val isar_proof = lookup_bool "isar_proof"
blanchet@36924
   251
    val isar_shrink_factor = Int.max (1, lookup_int "isar_shrink_factor")
blanchet@42444
   252
    val slicing = not auto andalso lookup_bool "slicing"
blanchet@39318
   253
    val timeout = (if auto then NONE else lookup_time "timeout") |> the_timeout
blanchet@38985
   254
    val expect = lookup_string "expect"
blanchet@35963
   255
  in
blanchet@41208
   256
    {debug = debug, verbose = verbose, overlord = overlord, blocking = blocking,
blanchet@42180
   257
     provers = provers, relevance_thresholds = relevance_thresholds,
blanchet@42579
   258
     max_relevant = max_relevant, monomorphize_limit = monomorphize_limit,
blanchet@42579
   259
     type_sys = type_sys, explicit_apply = explicit_apply,
blanchet@42579
   260
     isar_proof = isar_proof, isar_shrink_factor = isar_shrink_factor,
blanchet@42579
   261
     slicing = slicing, timeout = timeout, expect = expect}
blanchet@35963
   262
  end
blanchet@35866
   263
blanchet@40069
   264
fun get_params auto ctxt = extract_params auto (default_raw_params ctxt)
blanchet@39318
   265
fun default_params thy = get_params false thy o map (apsnd single)
blanchet@35866
   266
blanchet@36373
   267
(* Sledgehammer the given subgoal *)
blanchet@36373
   268
blanchet@36373
   269
val sledgehammerN = "sledgehammer"
blanchet@36373
   270
val sledgehammer_paramsN = "sledgehammer_params"
blanchet@36373
   271
blanchet@35965
   272
val runN = "run"
blanchet@35965
   273
val minimizeN = "minimize"
blanchet@35965
   274
val messagesN = "messages"
blanchet@41727
   275
val supported_proversN = "supported_provers"
blanchet@40059
   276
val running_proversN = "running_provers"
blanchet@40059
   277
val kill_proversN = "kill_provers"
blanchet@35965
   278
val refresh_tptpN = "refresh_tptp"
blanchet@35866
   279
blanchet@36281
   280
val is_raw_param_relevant_for_minimize =
blanchet@36281
   281
  member (op =) params_for_minimize o fst o unalias_raw_param
blanchet@36281
   282
fun string_for_raw_param (key, values) =
blanchet@42688
   283
  key ^ (case implode_param_value values of "" => "" | value => " = " ^ value)
blanchet@36281
   284
blanchet@40059
   285
fun minimize_command override_params i prover_name fact_names =
blanchet@40059
   286
  sledgehammerN ^ " " ^ minimizeN ^ " [prover = " ^ prover_name ^
blanchet@36281
   287
  (override_params |> filter is_raw_param_relevant_for_minimize
blanchet@36281
   288
                   |> implode o map (prefix ", " o string_for_raw_param)) ^
blanchet@37171
   289
  "] (" ^ space_implode " " fact_names ^ ")" ^
blanchet@36281
   290
  (if i = 1 then "" else " " ^ string_of_int i)
blanchet@36281
   291
blanchet@35966
   292
fun hammer_away override_params subcommand opt_i relevance_override state =
blanchet@35963
   293
  let
blanchet@40069
   294
    val ctxt = Proof.context_of state
blanchet@41258
   295
    val override_params =
blanchet@41258
   296
      override_params |> map (check_and_repair_raw_param ctxt)
blanchet@35965
   297
  in
blanchet@35965
   298
    if subcommand = runN then
blanchet@36281
   299
      let val i = the_default 1 opt_i in
blanchet@42444
   300
        run_sledgehammer (get_params false ctxt override_params) false i
blanchet@39318
   301
                         relevance_override (minimize_command override_params i)
blanchet@39318
   302
                         state
blanchet@39318
   303
        |> K ()
blanchet@36281
   304
      end
blanchet@35965
   305
    else if subcommand = minimizeN then
blanchet@40069
   306
      run_minimize (get_params false ctxt override_params) (the_default 1 opt_i)
blanchet@38590
   307
                   (#add relevance_override) state
blanchet@35965
   308
    else if subcommand = messagesN then
blanchet@35965
   309
      messages opt_i
blanchet@41727
   310
    else if subcommand = supported_proversN then
blanchet@41727
   311
      supported_provers ctxt
blanchet@40059
   312
    else if subcommand = running_proversN then
blanchet@40059
   313
      running_provers ()
blanchet@40059
   314
    else if subcommand = kill_proversN then
blanchet@40059
   315
      kill_provers ()
blanchet@35965
   316
    else if subcommand = refresh_tptpN then
blanchet@35965
   317
      refresh_systems_on_tptp ()
blanchet@35965
   318
    else
blanchet@35965
   319
      error ("Unknown subcommand: " ^ quote subcommand ^ ".")
blanchet@35965
   320
  end
blanchet@35963
   321
blanchet@35966
   322
fun sledgehammer_trans (((subcommand, params), relevance_override), opt_i) =
blanchet@35966
   323
  Toplevel.keep (hammer_away params subcommand opt_i relevance_override
blanchet@35966
   324
                 o Toplevel.proof_of)
blanchet@35963
   325
blanchet@42688
   326
fun string_for_raw_param (name, value) = name ^ " = " ^ implode_param_value value
blanchet@35963
   327
blanchet@35965
   328
fun sledgehammer_params_trans params =
blanchet@35963
   329
  Toplevel.theory
blanchet@35965
   330
      (fold set_default_raw_param params
blanchet@39318
   331
       #> tap (fn thy =>
wenzelm@42361
   332
                  let val ctxt = Proof_Context.init_global thy in
blanchet@40069
   333
                    writeln ("Default parameters for Sledgehammer:\n" ^
blanchet@40069
   334
                             (case default_raw_params ctxt |> rev of
blanchet@40069
   335
                                [] => "none"
blanchet@40069
   336
                              | params =>
blanchet@41258
   337
                                params |> map (check_and_repair_raw_param ctxt)
blanchet@41258
   338
                                       |> map string_for_raw_param
blanchet@41258
   339
                                       |> sort_strings |> cat_lines))
blanchet@40069
   340
                  end))
blanchet@35963
   341
wenzelm@36960
   342
val parse_key = Scan.repeat1 Parse.typ_group >> space_implode " "
blanchet@42581
   343
val parse_value =
blanchet@42589
   344
  Scan.repeat1 (Parse.xname || Parse.float_number || Parse.$$$ "?"
blanchet@42581
   345
                || Parse.$$$ "!")
wenzelm@36960
   346
val parse_param = parse_key -- Scan.optional (Parse.$$$ "=" |-- parse_value) []
wenzelm@36960
   347
val parse_params = Scan.optional (Args.bracks (Parse.list parse_param)) []
blanchet@35965
   348
val parse_fact_refs =
blanchet@38996
   349
  Scan.repeat1 (Scan.unless (Parse.name -- Args.colon) Parse_Spec.xthm)
blanchet@35966
   350
val parse_relevance_chunk =
blanchet@39318
   351
  (Args.add |-- Args.colon |-- parse_fact_refs >> add_relevance_override)
blanchet@39318
   352
  || (Args.del |-- Args.colon |-- parse_fact_refs >> del_relevance_override)
blanchet@36188
   353
  || (parse_fact_refs >> only_relevance_override)
blanchet@35966
   354
val parse_relevance_override =
blanchet@36188
   355
  Scan.optional (Args.parens (Scan.repeat parse_relevance_chunk
blanchet@36188
   356
                              >> merge_relevance_overrides))
blanchet@39318
   357
                no_relevance_override
blanchet@35963
   358
val parse_sledgehammer_command =
blanchet@37399
   359
  (Scan.optional Parse.short_ident runN -- parse_params
blanchet@37399
   360
   -- parse_relevance_override -- Scan.option Parse.nat) #>> sledgehammer_trans
blanchet@35963
   361
val parse_sledgehammer_params_command =
blanchet@35963
   362
  parse_params #>> sledgehammer_params_trans
blanchet@35963
   363
blanchet@35963
   364
val _ =
wenzelm@36960
   365
  Outer_Syntax.improper_command sledgehammerN
wenzelm@36960
   366
      "search for first-order proof using automatic theorem provers" Keyword.diag
blanchet@36394
   367
      parse_sledgehammer_command
blanchet@35963
   368
val _ =
wenzelm@36960
   369
  Outer_Syntax.command sledgehammer_paramsN
wenzelm@36960
   370
      "set and display the default parameters for Sledgehammer" Keyword.thy_decl
blanchet@36394
   371
      parse_sledgehammer_params_command
blanchet@36394
   372
blanchet@39318
   373
fun auto_sledgehammer state =
blanchet@40931
   374
  let val ctxt = Proof.context_of state in
blanchet@42447
   375
    run_sledgehammer (get_params true ctxt []) true 1 no_relevance_override
blanchet@42447
   376
                     (minimize_command [] 1) state
blanchet@40931
   377
  end
blanchet@39318
   378
blanchet@40931
   379
val setup = Auto_Tools.register_tool (auto, auto_sledgehammer)
blanchet@39318
   380
blanchet@35866
   381
end;