src/HOL/Tools/Sledgehammer/sledgehammer_isar.ML
author blanchet
Tue Feb 08 16:10:10 2011 +0100 (2011-02-08 ago)
changeset 41727 ab3f6d76fb23
parent 41472 f6ab14e61604
child 42180 a6c141925a8a
permissions -rw-r--r--
available_provers ~> supported_provers (for clarity)
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@41134
    82
   ("type_sys", "smart"),
blanchet@36235
    83
   ("explicit_apply", "false"),
blanchet@40343
    84
   ("relevance_thresholds", "0.45 0.85"),
blanchet@38744
    85
   ("max_relevant", "smart"),
blanchet@35963
    86
   ("isar_proof", "false"),
blanchet@38590
    87
   ("isar_shrink_factor", "1")]
blanchet@35963
    88
blanchet@36140
    89
val alias_params =
blanchet@40059
    90
  [("prover", "provers"),
blanchet@40059
    91
   ("atps", "provers"), (* FIXME: legacy *)
blanchet@40059
    92
   ("atp", "provers")]  (* FIXME: legacy *)
blanchet@36140
    93
val negated_alias_params =
blanchet@41208
    94
  [("no_debug", "debug"),
blanchet@35963
    95
   ("quiet", "verbose"),
blanchet@36143
    96
   ("no_overlord", "overlord"),
blanchet@41208
    97
   ("non_blocking", "blocking"),
blanchet@36399
    98
   ("partial_types", "full_types"),
blanchet@36235
    99
   ("implicit_apply", "explicit_apply"),
blanchet@36908
   100
   ("no_isar_proof", "isar_proof")]
blanchet@35963
   101
blanchet@36281
   102
val params_for_minimize =
blanchet@41136
   103
  ["debug", "verbose", "overlord", "type_sys", "full_types", "isar_proof",
blanchet@38590
   104
   "isar_shrink_factor", "timeout"]
blanchet@36281
   105
blanchet@40059
   106
val property_dependent_params = ["provers", "full_types", "timeout"]
blanchet@35866
   107
blanchet@35963
   108
fun is_known_raw_param s =
blanchet@35963
   109
  AList.defined (op =) default_default_params s orelse
blanchet@36140
   110
  AList.defined (op =) alias_params s orelse
blanchet@36140
   111
  AList.defined (op =) negated_alias_params s orelse
blanchet@38985
   112
  member (op =) property_dependent_params s orelse s = "expect"
blanchet@35963
   113
blanchet@41258
   114
fun is_prover_list ctxt s =
blanchet@41258
   115
  case space_explode " " s of
blanchet@41727
   116
    ss as _ :: _ => forall (is_prover_supported ctxt) ss
blanchet@41258
   117
  | _ => false
blanchet@41258
   118
blanchet@41258
   119
fun check_and_repair_raw_param ctxt (name, value) =
blanchet@41258
   120
  if is_known_raw_param name then (name, value)
blanchet@41258
   121
  else if is_prover_list ctxt name andalso null value then ("provers", [name])
blanchet@41258
   122
  else error ("Unknown parameter: " ^ quote name ^ ".")
blanchet@35866
   123
blanchet@36140
   124
fun unalias_raw_param (name, value) =
blanchet@36140
   125
  case AList.lookup (op =) alias_params name of
blanchet@36140
   126
    SOME name' => (name', value)
blanchet@36140
   127
  | NONE =>
blanchet@36140
   128
    case AList.lookup (op =) negated_alias_params name of
blanchet@36140
   129
      SOME name' => (name', case value of
blanchet@36140
   130
                              ["false"] => ["true"]
blanchet@36140
   131
                            | ["true"] => ["false"]
blanchet@36140
   132
                            | [] => ["false"]
blanchet@36140
   133
                            | _ => value)
blanchet@36140
   134
    | NONE => (name, value)
blanchet@35963
   135
wenzelm@41472
   136
structure Data = Theory_Data
wenzelm@41472
   137
(
blanchet@35963
   138
  type T = raw_param list
blanchet@35963
   139
  val empty = default_default_params |> map (apsnd single)
blanchet@35963
   140
  val extend = I
wenzelm@41472
   141
  fun merge data : T = AList.merge (op =) (K true) data
wenzelm@41472
   142
)
blanchet@35866
   143
blanchet@41727
   144
fun remotify_prover_if_supported_and_not_already_remote ctxt name =
blanchet@40072
   145
  if String.isPrefix remote_prefix name then
blanchet@40072
   146
    SOME name
blanchet@40072
   147
  else
blanchet@40072
   148
    let val remote_name = remote_prefix ^ name in
blanchet@41727
   149
      if is_prover_supported ctxt remote_name then SOME remote_name else NONE
blanchet@40072
   150
    end
blanchet@40072
   151
blanchet@40072
   152
fun remotify_prover_if_not_installed ctxt name =
blanchet@41727
   153
  if is_prover_supported ctxt name andalso is_prover_installed ctxt name then
blanchet@40941
   154
    SOME name
blanchet@40941
   155
  else
blanchet@41727
   156
    remotify_prover_if_supported_and_not_already_remote ctxt name
blanchet@40072
   157
blanchet@40072
   158
fun avoid_too_many_local_threads _ _ [] = []
blanchet@40941
   159
  | avoid_too_many_local_threads ctxt 0 provers =
blanchet@41727
   160
    map_filter (remotify_prover_if_supported_and_not_already_remote ctxt)
blanchet@40941
   161
               provers
blanchet@40941
   162
  | avoid_too_many_local_threads ctxt n (prover :: provers) =
blanchet@40072
   163
    let val n = if String.isPrefix remote_prefix prover then n else n - 1 in
blanchet@40941
   164
      prover :: avoid_too_many_local_threads ctxt n provers
blanchet@40072
   165
    end
blanchet@40059
   166
blanchet@40059
   167
(* The first ATP of the list is used by Auto Sledgehammer. Because of the low
blanchet@40059
   168
   timeout, it makes sense to put SPASS first. *)
blanchet@40069
   169
fun default_provers_param_value ctxt =
blanchet@40941
   170
  [spassN, eN, vampireN, sine_eN, SMT_Solver.solver_name_of ctxt]
blanchet@40941
   171
  |> map_filter (remotify_prover_if_not_installed ctxt)
blanchet@40941
   172
  |> avoid_too_many_local_threads ctxt (Multithreading.max_threads_value ())
blanchet@40941
   173
  |> space_implode " "
blanchet@40059
   174
blanchet@36140
   175
val set_default_raw_param = Data.map o AList.update (op =) o unalias_raw_param
blanchet@40069
   176
fun default_raw_params ctxt =
blanchet@40069
   177
  let val thy = ProofContext.theory_of ctxt in
blanchet@40069
   178
    Data.get thy
blanchet@40069
   179
    |> fold (AList.default (op =))
blanchet@40069
   180
            [("provers", [case !provers of
blanchet@40069
   181
                            "" => default_provers_param_value ctxt
blanchet@40069
   182
                          | s => s]),
blanchet@40069
   183
             ("full_types", [if !full_types then "true" else "false"]),
blanchet@40069
   184
             ("timeout", let val timeout = !timeout in
blanchet@40069
   185
                           [if timeout <= 0 then "none"
blanchet@40341
   186
                            else string_of_int timeout]
blanchet@40069
   187
                         end)]
blanchet@40069
   188
  end
blanchet@35963
   189
blanchet@41153
   190
val smart_full_type_sys = Tags true
blanchet@41153
   191
val smart_partial_type_sys = Const_Args
blanchet@41153
   192
blanchet@35963
   193
val infinity_time_in_secs = 60 * 60 * 24 * 365
blanchet@35963
   194
val the_timeout = the_default (Time.fromSeconds infinity_time_in_secs)
blanchet@35866
   195
blanchet@39318
   196
fun extract_params auto default_params override_params =
blanchet@35963
   197
  let
blanchet@36140
   198
    val override_params = map unalias_raw_param override_params
blanchet@35963
   199
    val raw_params = rev override_params @ rev default_params
blanchet@35963
   200
    val lookup = Option.map (space_implode " ") o AList.lookup (op =) raw_params
blanchet@35963
   201
    val lookup_string = the_default "" o lookup
blanchet@35963
   202
    fun general_lookup_bool option default_value name =
blanchet@35963
   203
      case lookup name of
blanchet@35970
   204
        SOME s => parse_bool_option option name s
blanchet@35963
   205
      | NONE => default_value
blanchet@35963
   206
    val lookup_bool = the o general_lookup_bool false (SOME false)
blanchet@35963
   207
    fun lookup_time name =
blanchet@39318
   208
      case lookup name of
blanchet@39318
   209
        SOME s => parse_time_option name s
blanchet@39318
   210
      | NONE => NONE
blanchet@35966
   211
    fun lookup_int name =
blanchet@35963
   212
      case lookup name of
blanchet@35966
   213
        NONE => 0
blanchet@35966
   214
      | SOME s => case Int.fromString s of
blanchet@35966
   215
                    SOME n => n
blanchet@35966
   216
                  | NONE => error ("Parameter " ^ quote name ^
blanchet@35966
   217
                                   " must be assigned an integer value.")
blanchet@40343
   218
    fun lookup_real_pair name =
blanchet@38745
   219
      case lookup name of
blanchet@40343
   220
        NONE => (0.0, 0.0)
blanchet@40343
   221
      | SOME s => case s |> space_explode " " |> map Real.fromString of
blanchet@40343
   222
                    [SOME r1, SOME r2] => (r1, r2)
blanchet@38745
   223
                  | _ => error ("Parameter " ^ quote name ^
blanchet@40343
   224
                                "must be assigned a pair of floating-point \
blanchet@40343
   225
                                \values (e.g., \"0.6 0.95\")")
blanchet@38589
   226
    fun lookup_int_option name =
blanchet@38589
   227
      case lookup name of
blanchet@38589
   228
        SOME "smart" => NONE
blanchet@38589
   229
      | _ => SOME (lookup_int name)
blanchet@39318
   230
    val debug = not auto andalso lookup_bool "debug"
blanchet@39318
   231
    val verbose = debug orelse (not auto andalso lookup_bool "verbose")
blanchet@36143
   232
    val overlord = lookup_bool "overlord"
blanchet@41208
   233
    val blocking = auto orelse debug orelse lookup_bool "blocking"
blanchet@40059
   234
    val provers = lookup_string "provers" |> space_explode " "
blanchet@40059
   235
                  |> auto ? single o hd
blanchet@41153
   236
    val type_sys =
blanchet@41138
   237
      case (lookup_string "type_sys", lookup_bool "full_types") of
blanchet@41138
   238
        ("tags", full_types) => Tags full_types
blanchet@41138
   239
      | ("preds", full_types) => Preds full_types
blanchet@41153
   240
      | ("const_args", false) => Const_Args
blanchet@41153
   241
      | ("none", false) => No_Types
blanchet@41153
   242
      | (type_sys, full_types) =>
blanchet@41153
   243
        if member (op =) ["const_args", "none", "smart"] type_sys then
blanchet@41153
   244
          if full_types then smart_full_type_sys else smart_partial_type_sys
blanchet@41153
   245
        else
blanchet@41153
   246
          error ("Unknown type system: " ^ quote type_sys ^ ".")
blanchet@36235
   247
    val explicit_apply = lookup_bool "explicit_apply"
blanchet@40343
   248
    val relevance_thresholds = lookup_real_pair "relevance_thresholds"
blanchet@38744
   249
    val max_relevant = lookup_int_option "max_relevant"
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@39318
   252
    val timeout = (if auto then NONE else lookup_time "timeout") |> the_timeout
blanchet@38985
   253
    val expect = lookup_string "expect"
blanchet@35963
   254
  in
blanchet@41208
   255
    {debug = debug, verbose = verbose, overlord = overlord, blocking = blocking,
blanchet@41138
   256
     provers = provers, type_sys = type_sys, explicit_apply = explicit_apply,
blanchet@38745
   257
     relevance_thresholds = relevance_thresholds, max_relevant = max_relevant,
blanchet@38997
   258
     isar_proof = isar_proof, isar_shrink_factor = isar_shrink_factor,
blanchet@38997
   259
     timeout = timeout, expect = expect}
blanchet@35963
   260
  end
blanchet@35866
   261
blanchet@40069
   262
fun get_params auto ctxt = extract_params auto (default_raw_params ctxt)
blanchet@39318
   263
fun default_params thy = get_params false thy o map (apsnd single)
blanchet@35866
   264
blanchet@36373
   265
(* Sledgehammer the given subgoal *)
blanchet@36373
   266
blanchet@36373
   267
val sledgehammerN = "sledgehammer"
blanchet@36373
   268
val sledgehammer_paramsN = "sledgehammer_params"
blanchet@36373
   269
blanchet@35965
   270
val runN = "run"
blanchet@35965
   271
val minimizeN = "minimize"
blanchet@35965
   272
val messagesN = "messages"
blanchet@41727
   273
val supported_proversN = "supported_provers"
blanchet@40059
   274
val running_proversN = "running_provers"
blanchet@40059
   275
val kill_proversN = "kill_provers"
blanchet@35965
   276
val refresh_tptpN = "refresh_tptp"
blanchet@35866
   277
blanchet@36281
   278
val is_raw_param_relevant_for_minimize =
blanchet@36281
   279
  member (op =) params_for_minimize o fst o unalias_raw_param
blanchet@36281
   280
fun string_for_raw_param (key, values) =
blanchet@36481
   281
  key ^ (case space_implode " " values of "" => "" | value => " = " ^ value)
blanchet@36281
   282
blanchet@40059
   283
fun minimize_command override_params i prover_name fact_names =
blanchet@40059
   284
  sledgehammerN ^ " " ^ minimizeN ^ " [prover = " ^ prover_name ^
blanchet@36281
   285
  (override_params |> filter is_raw_param_relevant_for_minimize
blanchet@36281
   286
                   |> implode o map (prefix ", " o string_for_raw_param)) ^
blanchet@37171
   287
  "] (" ^ space_implode " " fact_names ^ ")" ^
blanchet@36281
   288
  (if i = 1 then "" else " " ^ string_of_int i)
blanchet@36281
   289
blanchet@35966
   290
fun hammer_away override_params subcommand opt_i relevance_override state =
blanchet@35963
   291
  let
blanchet@40069
   292
    val ctxt = Proof.context_of state
blanchet@41258
   293
    val override_params =
blanchet@41258
   294
      override_params |> map (check_and_repair_raw_param ctxt)
blanchet@35965
   295
  in
blanchet@35965
   296
    if subcommand = runN then
blanchet@36281
   297
      let val i = the_default 1 opt_i in
blanchet@40069
   298
        run_sledgehammer (get_params false ctxt override_params) false i
blanchet@39318
   299
                         relevance_override (minimize_command override_params i)
blanchet@39318
   300
                         state
blanchet@39318
   301
        |> K ()
blanchet@36281
   302
      end
blanchet@35965
   303
    else if subcommand = minimizeN then
blanchet@40069
   304
      run_minimize (get_params false ctxt override_params) (the_default 1 opt_i)
blanchet@38590
   305
                   (#add relevance_override) state
blanchet@35965
   306
    else if subcommand = messagesN then
blanchet@35965
   307
      messages opt_i
blanchet@41727
   308
    else if subcommand = supported_proversN then
blanchet@41727
   309
      supported_provers ctxt
blanchet@40059
   310
    else if subcommand = running_proversN then
blanchet@40059
   311
      running_provers ()
blanchet@40059
   312
    else if subcommand = kill_proversN then
blanchet@40059
   313
      kill_provers ()
blanchet@35965
   314
    else if subcommand = refresh_tptpN then
blanchet@35965
   315
      refresh_systems_on_tptp ()
blanchet@35965
   316
    else
blanchet@35965
   317
      error ("Unknown subcommand: " ^ quote subcommand ^ ".")
blanchet@35965
   318
  end
blanchet@35963
   319
blanchet@35966
   320
fun sledgehammer_trans (((subcommand, params), relevance_override), opt_i) =
blanchet@35966
   321
  Toplevel.keep (hammer_away params subcommand opt_i relevance_override
blanchet@35966
   322
                 o Toplevel.proof_of)
blanchet@35963
   323
blanchet@35963
   324
fun string_for_raw_param (name, value) = name ^ " = " ^ space_implode " " value
blanchet@35963
   325
blanchet@35965
   326
fun sledgehammer_params_trans params =
blanchet@35963
   327
  Toplevel.theory
blanchet@35965
   328
      (fold set_default_raw_param params
blanchet@39318
   329
       #> tap (fn thy =>
blanchet@40069
   330
                  let val ctxt = ProofContext.init_global thy in
blanchet@40069
   331
                    writeln ("Default parameters for Sledgehammer:\n" ^
blanchet@40069
   332
                             (case default_raw_params ctxt |> rev of
blanchet@40069
   333
                                [] => "none"
blanchet@40069
   334
                              | params =>
blanchet@41258
   335
                                params |> map (check_and_repair_raw_param ctxt)
blanchet@41258
   336
                                       |> map string_for_raw_param
blanchet@41258
   337
                                       |> sort_strings |> cat_lines))
blanchet@40069
   338
                  end))
blanchet@35963
   339
wenzelm@36960
   340
val parse_key = Scan.repeat1 Parse.typ_group >> space_implode " "
blanchet@40341
   341
val parse_value = Scan.repeat1 (Parse.xname || Parse.float_number)
wenzelm@36960
   342
val parse_param = parse_key -- Scan.optional (Parse.$$$ "=" |-- parse_value) []
wenzelm@36960
   343
val parse_params = Scan.optional (Args.bracks (Parse.list parse_param)) []
blanchet@35965
   344
val parse_fact_refs =
blanchet@38996
   345
  Scan.repeat1 (Scan.unless (Parse.name -- Args.colon) Parse_Spec.xthm)
blanchet@35966
   346
val parse_relevance_chunk =
blanchet@39318
   347
  (Args.add |-- Args.colon |-- parse_fact_refs >> add_relevance_override)
blanchet@39318
   348
  || (Args.del |-- Args.colon |-- parse_fact_refs >> del_relevance_override)
blanchet@36188
   349
  || (parse_fact_refs >> only_relevance_override)
blanchet@35966
   350
val parse_relevance_override =
blanchet@36188
   351
  Scan.optional (Args.parens (Scan.repeat parse_relevance_chunk
blanchet@36188
   352
                              >> merge_relevance_overrides))
blanchet@39318
   353
                no_relevance_override
blanchet@35963
   354
val parse_sledgehammer_command =
blanchet@37399
   355
  (Scan.optional Parse.short_ident runN -- parse_params
blanchet@37399
   356
   -- parse_relevance_override -- Scan.option Parse.nat) #>> sledgehammer_trans
blanchet@35963
   357
val parse_sledgehammer_params_command =
blanchet@35963
   358
  parse_params #>> sledgehammer_params_trans
blanchet@35963
   359
blanchet@35963
   360
val _ =
wenzelm@36960
   361
  Outer_Syntax.improper_command sledgehammerN
wenzelm@36960
   362
      "search for first-order proof using automatic theorem provers" Keyword.diag
blanchet@36394
   363
      parse_sledgehammer_command
blanchet@35963
   364
val _ =
wenzelm@36960
   365
  Outer_Syntax.command sledgehammer_paramsN
wenzelm@36960
   366
      "set and display the default parameters for Sledgehammer" Keyword.thy_decl
blanchet@36394
   367
      parse_sledgehammer_params_command
blanchet@36394
   368
blanchet@39318
   369
fun auto_sledgehammer state =
blanchet@40931
   370
  let val ctxt = Proof.context_of state in
blanchet@40931
   371
    run_sledgehammer (get_params true ctxt []) true 1 no_relevance_override
blanchet@40931
   372
                     (minimize_command [] 1) state
blanchet@40931
   373
  end
blanchet@39318
   374
blanchet@40931
   375
val setup = Auto_Tools.register_tool (auto, auto_sledgehammer)
blanchet@39318
   376
blanchet@35866
   377
end;