src/HOL/Tools/atp_manager.ML
author immler@in.tum.de
Mon May 04 23:37:39 2009 +0200 (2009-05-04)
changeset 31037 ac8669134e7a
parent 30982 7882a1268a48
child 31368 763f4b0fd579
permissions -rw-r--r--
added Philipp Meyer's implementation of AtpMinimal
together with related changes in the sledgehammer-interface:
adapted type of prover, optional relevance filtering,
public get_prover for registered atps in AtpManager,
included atp_minimize in s/h response;
wenzelm@28477
     1
(*  Title:      HOL/Tools/atp_manager.ML
wenzelm@28477
     2
    Author:     Fabian Immler, TU Muenchen
wenzelm@28477
     3
wenzelm@28571
     4
ATP threads are registered here.
wenzelm@28571
     5
Threads with the same birth-time are seen as one group.
wenzelm@28571
     6
All threads of a group are killed when one thread of it has been successful,
wenzelm@28571
     7
or after a certain time,
wenzelm@28571
     8
or when the maximum number of threads exceeds; then the oldest thread is killed.
wenzelm@28477
     9
*)
wenzelm@28477
    10
wenzelm@28477
    11
signature ATP_MANAGER =
wenzelm@28477
    12
sig
wenzelm@28586
    13
  val get_atps: unit -> string
wenzelm@28477
    14
  val set_atps: string -> unit
wenzelm@28586
    15
  val get_max_atps: unit -> int
wenzelm@28586
    16
  val set_max_atps: int -> unit
wenzelm@28586
    17
  val get_timeout: unit -> int
wenzelm@28477
    18
  val set_timeout: int -> unit
wenzelm@28586
    19
  val kill: unit -> unit
wenzelm@28586
    20
  val info: unit -> unit
wenzelm@29112
    21
  val messages: int option -> unit
immler@31037
    22
  type prover = int -> (thm * (string * int)) list option -> string -> int ->
immler@31037
    23
    Proof.context * (thm list * thm) -> bool * string * string * string vector
wenzelm@28595
    24
  val add_prover: string -> prover -> theory -> theory
wenzelm@28484
    25
  val print_provers: theory -> unit
immler@31037
    26
  val get_prover: string -> theory -> prover option
wenzelm@28571
    27
  val sledgehammer: string list -> Proof.state -> unit
wenzelm@28477
    28
end;
wenzelm@28477
    29
wenzelm@28586
    30
structure AtpManager: ATP_MANAGER =
wenzelm@28477
    31
struct
wenzelm@28477
    32
wenzelm@28586
    33
(** preferences **)
wenzelm@28586
    34
wenzelm@29112
    35
val message_store_limit = 20;
wenzelm@29112
    36
val message_display_limit = 5;
wenzelm@29112
    37
wenzelm@28586
    38
local
wenzelm@28586
    39
immler@29598
    40
val atps = ref "e remote_vampire";
wenzelm@28586
    41
val max_atps = ref 5;   (* ~1 means infinite number of atps *)
immler@29784
    42
val timeout = ref 60;
wenzelm@28586
    43
wenzelm@28586
    44
in
wenzelm@28586
    45
wenzelm@28586
    46
fun get_atps () = CRITICAL (fn () => ! atps);
wenzelm@28586
    47
fun set_atps str = CRITICAL (fn () => atps := str);
wenzelm@28586
    48
wenzelm@28586
    49
fun get_max_atps () = CRITICAL (fn () => ! max_atps);
wenzelm@28586
    50
fun set_max_atps number = CRITICAL (fn () => max_atps := number);
wenzelm@28586
    51
wenzelm@28586
    52
fun get_timeout () = CRITICAL (fn () => ! timeout);
wenzelm@28586
    53
fun set_timeout time = CRITICAL (fn () => timeout := time);
wenzelm@28586
    54
wenzelm@28586
    55
val _ =
wenzelm@30982
    56
  ProofGeneralPgip.add_preference Preferences.category_proof
wenzelm@28586
    57
    (Preferences.string_pref atps
wenzelm@28589
    58
      "ATP: provers" "Default automatic provers (separated by whitespace)");
wenzelm@28586
    59
wenzelm@30982
    60
val _ =
wenzelm@30982
    61
  ProofGeneralPgip.add_preference Preferences.category_proof
wenzelm@28586
    62
    (Preferences.int_pref max_atps
wenzelm@28589
    63
      "ATP: maximum number" "How many provers may run in parallel");
wenzelm@28586
    64
wenzelm@30982
    65
val _ =
wenzelm@30982
    66
  ProofGeneralPgip.add_preference Preferences.category_proof
wenzelm@28586
    67
    (Preferences.int_pref timeout
wenzelm@28589
    68
      "ATP: timeout" "ATPs will be interrupted after this time (in seconds)");
wenzelm@28586
    69
wenzelm@28586
    70
end;
wenzelm@28586
    71
wenzelm@28586
    72
wenzelm@28586
    73
wenzelm@28586
    74
(** thread management **)
wenzelm@28586
    75
wenzelm@28582
    76
(* data structures over threads *)
wenzelm@28582
    77
wenzelm@28582
    78
structure ThreadHeap = HeapFun
wenzelm@28582
    79
(
wenzelm@28582
    80
  type elem = Time.time * Thread.thread;
wenzelm@28582
    81
  fun ord ((a, _), (b, _)) = Time.compare (a, b);
wenzelm@28595
    82
);
wenzelm@28582
    83
wenzelm@28582
    84
val lookup_thread = AList.lookup Thread.equal;
wenzelm@28582
    85
val delete_thread = AList.delete Thread.equal;
wenzelm@28582
    86
val update_thread = AList.update Thread.equal;
wenzelm@28582
    87
wenzelm@28582
    88
wenzelm@28582
    89
(* state of thread manager *)
wenzelm@28477
    90
wenzelm@28582
    91
datatype T = State of
immler@30830
    92
 {managing_thread: Thread.thread option,
immler@30830
    93
  timeout_heap: ThreadHeap.T,
wenzelm@28582
    94
  oldest_heap: ThreadHeap.T,
wenzelm@28582
    95
  active: (Thread.thread * (Time.time * Time.time * string)) list,
wenzelm@29112
    96
  cancelling: (Thread.thread * (Time.time * Time.time * string)) list,
immler@29620
    97
  messages: string list,
immler@29620
    98
  store: string list};
wenzelm@28582
    99
immler@30830
   100
fun make_state managing_thread timeout_heap oldest_heap active cancelling messages store =
immler@30830
   101
  State {managing_thread = managing_thread, timeout_heap = timeout_heap, oldest_heap = oldest_heap,
immler@29620
   102
    active = active, cancelling = cancelling, messages = messages, store = store};
wenzelm@28582
   103
immler@30830
   104
val state = Synchronized.var "atp_manager"
immler@30830
   105
  (make_state NONE ThreadHeap.empty ThreadHeap.empty [] [] [] []);
wenzelm@28582
   106
wenzelm@29150
   107
(* unregister thread *)
wenzelm@28582
   108
immler@29620
   109
fun unregister (success, message) thread = Synchronized.change state
immler@30830
   110
  (fn state as State {managing_thread, timeout_heap, oldest_heap, active, cancelling, messages, store} =>
wenzelm@29150
   111
    (case lookup_thread active thread of
wenzelm@29150
   112
      SOME (birthtime, _, description) =>
wenzelm@29150
   113
        let
wenzelm@29150
   114
          val (group, active') =
wenzelm@29150
   115
            if success then List.partition (fn (_, (tb, _, _)) => tb = birthtime) active
wenzelm@29150
   116
            else List.partition (fn (th, _) => Thread.equal (th, thread)) active
wenzelm@28582
   117
wenzelm@29150
   118
          val now = Time.now ()
wenzelm@29150
   119
          val cancelling' =
immler@29620
   120
            fold (fn (th, (tb, _, desc)) => update_thread (th, (tb, now, desc))) group cancelling
wenzelm@28582
   121
immler@29620
   122
          val message' = description ^ "\n" ^ message ^
immler@29596
   123
            (if length group <= 1 then ""
immler@29596
   124
             else "\nInterrupted " ^ string_of_int (length group - 1) ^ " other group members")
immler@29620
   125
          val store' = message' ::
immler@29620
   126
            (if length store <= message_store_limit then store
immler@29620
   127
             else #1 (chop message_store_limit store))
immler@30830
   128
        in make_state
immler@30830
   129
          managing_thread timeout_heap oldest_heap active' cancelling' (message' :: messages) store'
immler@30830
   130
        end
wenzelm@30800
   131
    | NONE => state));
wenzelm@28582
   132
wenzelm@28582
   133
wenzelm@28595
   134
(* kill excessive atp threads *)
wenzelm@28595
   135
wenzelm@28595
   136
fun excessive_atps active =
wenzelm@28595
   137
  let val max = get_max_atps ()
wenzelm@28595
   138
  in length active > max andalso max > ~1 end;
wenzelm@28595
   139
wenzelm@28595
   140
local
wenzelm@28595
   141
wenzelm@28595
   142
fun kill_oldest () =
wenzelm@28595
   143
  let exception Unchanged in
wenzelm@29112
   144
    Synchronized.change_result state
immler@30830
   145
      (fn State {managing_thread, timeout_heap, oldest_heap, active, cancelling, messages, store} =>
wenzelm@28595
   146
        if ThreadHeap.is_empty oldest_heap orelse not (excessive_atps active)
wenzelm@28595
   147
        then raise Unchanged
wenzelm@28595
   148
        else
wenzelm@28595
   149
          let val ((_, oldest_thread), oldest_heap') = ThreadHeap.min_elem oldest_heap
immler@30830
   150
          in (oldest_thread,
immler@30830
   151
          make_state managing_thread timeout_heap oldest_heap' active cancelling messages store) end)
immler@29620
   152
      |> unregister (false, "Interrupted (maximum number of ATPs exceeded)")
wenzelm@28595
   153
    handle Unchanged => ()
wenzelm@28595
   154
  end;
wenzelm@28595
   155
wenzelm@28595
   156
in
wenzelm@28595
   157
wenzelm@28595
   158
fun kill_excessive () =
wenzelm@28595
   159
  let val State {active, ...} = Synchronized.value state
wenzelm@28595
   160
  in if excessive_atps active then (kill_oldest (); kill_excessive ()) else () end;
wenzelm@28595
   161
wenzelm@28595
   162
end;
wenzelm@28595
   163
immler@29620
   164
fun print_new_messages () =
immler@29620
   165
  let val to_print = Synchronized.change_result state
immler@30830
   166
    (fn State {managing_thread, timeout_heap, oldest_heap, active, cancelling, messages, store} =>
immler@30830
   167
      (messages, make_state managing_thread timeout_heap oldest_heap active cancelling [] store))
wenzelm@30800
   168
  in
wenzelm@30800
   169
    if null to_print then ()
wenzelm@30800
   170
    else priority ("Sledgehammer: " ^ space_implode "\n\n" to_print)
wenzelm@30800
   171
  end;
immler@29620
   172
wenzelm@28595
   173
wenzelm@30800
   174
(* start a watching thread -- only one may exist *)
wenzelm@28582
   175
immler@30830
   176
fun check_thread_manager () = Synchronized.change state
immler@30830
   177
  (fn State {managing_thread, timeout_heap, oldest_heap, active, cancelling, messages, store} =>
immler@30830
   178
    if (case managing_thread of SOME thread => Thread.isActive thread | NONE => false)
immler@30830
   179
    then make_state managing_thread timeout_heap oldest_heap active cancelling messages store
immler@30830
   180
    else let val managing_thread = SOME (SimpleThread.fork false (fn () =>
immler@30830
   181
      let
immler@30830
   182
        val min_wait_time = Time.fromMilliseconds 300
immler@30830
   183
        val max_wait_time = Time.fromSeconds 10
wenzelm@28582
   184
immler@30830
   185
        (* wait for next thread to cancel, or maximum*)
immler@30830
   186
        fun time_limit (State {timeout_heap, ...}) =
immler@30830
   187
          (case try ThreadHeap.min timeout_heap of
immler@30830
   188
            NONE => SOME (Time.+ (Time.now (), max_wait_time))
immler@30830
   189
          | SOME (time, _) => SOME time)
wenzelm@28582
   190
immler@30830
   191
        (* action: find threads whose timeout is reached, and interrupt cancelling threads *)
immler@30830
   192
        fun action (State {managing_thread, timeout_heap, oldest_heap, active, cancelling,
immler@30830
   193
                           messages, store}) =
immler@30830
   194
          let val (timeout_threads, timeout_heap') =
immler@30830
   195
            ThreadHeap.upto (Time.now (), Thread.self ()) timeout_heap
immler@30830
   196
          in
immler@30830
   197
            if null timeout_threads andalso null cancelling andalso not (excessive_atps active)
immler@30830
   198
            then NONE
immler@30830
   199
            else
immler@30830
   200
              let
immler@30830
   201
                val _ = List.app (SimpleThread.interrupt o #1) cancelling
immler@30830
   202
                val cancelling' = filter (Thread.isActive o #1) cancelling
immler@30830
   203
                val state' = make_state
immler@30830
   204
                  managing_thread timeout_heap' oldest_heap active cancelling' messages store
immler@30830
   205
              in SOME (map #2 timeout_threads, state') end
immler@30830
   206
          end
immler@30830
   207
      in
immler@30830
   208
        while Synchronized.change_result state
immler@30830
   209
          (fn st as
immler@30830
   210
            State {managing_thread, timeout_heap, oldest_heap, active, cancelling, messages, store} =>
immler@30830
   211
            if (null active) andalso (null cancelling) andalso (null messages)
immler@30830
   212
            then (false, make_state NONE timeout_heap oldest_heap active cancelling messages store)
immler@30830
   213
            else (true, st))
immler@30830
   214
        do
immler@30830
   215
          (Synchronized.timed_access state time_limit action
immler@30830
   216
            |> these
immler@30830
   217
            |> List.app (unregister (false, "Interrupted (reached timeout)"));
immler@30830
   218
            kill_excessive ();
immler@30830
   219
            print_new_messages ();
immler@30830
   220
            (*give threads time to respond to interrupt*)
immler@30830
   221
            OS.Process.sleep min_wait_time)
immler@30830
   222
      end))
immler@30830
   223
    in make_state managing_thread timeout_heap oldest_heap active cancelling messages store end);
wenzelm@28582
   224
wenzelm@28582
   225
wenzelm@28582
   226
(* thread is registered here by sledgehammer *)
wenzelm@28477
   227
wenzelm@28582
   228
fun register birthtime deadtime (thread, desc) =
immler@30798
   229
 (Synchronized.change state
immler@30830
   230
    (fn State {managing_thread, timeout_heap, oldest_heap, active, cancelling, messages, store} =>
wenzelm@29112
   231
      let
wenzelm@29112
   232
        val timeout_heap' = ThreadHeap.insert (deadtime, thread) timeout_heap
wenzelm@29112
   233
        val oldest_heap' = ThreadHeap.insert (birthtime, thread) oldest_heap
wenzelm@29112
   234
        val active' = update_thread (thread, (birthtime, deadtime, desc)) active
immler@30830
   235
      in make_state managing_thread timeout_heap' oldest_heap' active' cancelling messages store end);
immler@30798
   236
  check_thread_manager ());
wenzelm@28477
   237
wenzelm@28477
   238
wenzelm@28586
   239
wenzelm@28586
   240
(** user commands **)
wenzelm@28582
   241
wenzelm@28586
   242
(* kill: move all threads to cancelling *)
wenzelm@28586
   243
wenzelm@28586
   244
fun kill () = Synchronized.change state
immler@30830
   245
  (fn State {managing_thread, timeout_heap, oldest_heap, active, cancelling, messages, store} =>
wenzelm@28582
   246
    let val formerly_active = map (fn (th, (tb, _, desc)) => (th, (tb, Time.now (), desc))) active
immler@30830
   247
    in make_state
immler@30830
   248
      managing_thread timeout_heap oldest_heap [] (formerly_active @ cancelling) messages store
immler@30830
   249
    end);
wenzelm@28582
   250
wenzelm@28582
   251
wenzelm@29112
   252
(* ATP info *)
wenzelm@28582
   253
wenzelm@28582
   254
fun info () =
wenzelm@28582
   255
  let
wenzelm@29112
   256
    val State {active, cancelling, ...} = Synchronized.value state
wenzelm@29112
   257
wenzelm@28571
   258
    fun running_info (_, (birth_time, dead_time, desc)) = "Running: "
wenzelm@28589
   259
        ^ (string_of_int o Time.toSeconds) (Time.- (Time.now (), birth_time))
wenzelm@28477
   260
        ^ " s  --  "
wenzelm@28589
   261
        ^ (string_of_int o Time.toSeconds) (Time.- (dead_time, Time.now ()))
wenzelm@28571
   262
        ^ " s to live:\n" ^ desc
wenzelm@28571
   263
    fun cancelling_info (_, (_, dead_time, desc)) = "Trying to interrupt thread since "
wenzelm@28586
   264
        ^ (string_of_int o Time.toSeconds) (Time.- (Time.now (), dead_time))
wenzelm@28571
   265
        ^ " s:\n" ^ desc
wenzelm@29112
   266
wenzelm@28589
   267
    val running =
wenzelm@28589
   268
      if null active then "No ATPs running."
wenzelm@28589
   269
      else space_implode "\n\n" ("Running ATPs:" :: map running_info active)
wenzelm@28589
   270
    val interrupting =
wenzelm@28589
   271
      if null cancelling then ""
wenzelm@28589
   272
      else space_implode "\n\n"
wenzelm@28589
   273
        ("Trying to interrupt the following ATPs:" :: map cancelling_info cancelling)
wenzelm@29112
   274
wenzelm@28582
   275
  in writeln (running ^ "\n" ^ interrupting) end;
wenzelm@28582
   276
wenzelm@29112
   277
fun messages opt_limit =
wenzelm@29112
   278
  let
wenzelm@29112
   279
    val limit = the_default message_display_limit opt_limit;
immler@29620
   280
    val State {store = msgs, ...} = Synchronized.value state
wenzelm@29112
   281
    val header = "Recent ATP messages" ^
wenzelm@29112
   282
      (if length msgs <= limit then ":" else " (" ^ string_of_int limit ^ " displayed):");
wenzelm@29116
   283
  in writeln (space_implode "\n\n" (header :: #1 (chop limit msgs))) end;
wenzelm@29112
   284
wenzelm@28582
   285
wenzelm@28477
   286
wenzelm@28586
   287
(** The Sledgehammer **)
wenzelm@28477
   288
wenzelm@28582
   289
(* named provers *)
wenzelm@28484
   290
immler@31037
   291
type prover = int -> (thm * (string * int)) list option -> string -> int ->
immler@31037
   292
  Proof.context * (thm list * thm) -> bool * string * string * string vector
wenzelm@28595
   293
wenzelm@28582
   294
fun err_dup_prover name = error ("Duplicate prover: " ^ quote name);
wenzelm@28477
   295
wenzelm@28582
   296
structure Provers = TheoryDataFun
wenzelm@28582
   297
(
wenzelm@28595
   298
  type T = (prover * stamp) Symtab.table
wenzelm@28582
   299
  val empty = Symtab.empty
wenzelm@28582
   300
  val copy = I
wenzelm@28582
   301
  val extend = I
wenzelm@28582
   302
  fun merge _ tabs : T = Symtab.merge (eq_snd op =) tabs
wenzelm@28589
   303
    handle Symtab.DUP dup => err_dup_prover dup
wenzelm@28582
   304
);
wenzelm@28484
   305
wenzelm@28595
   306
fun add_prover name prover thy =
wenzelm@28595
   307
  Provers.map (Symtab.update_new (name, (prover, stamp ()))) thy
wenzelm@28582
   308
    handle Symtab.DUP dup => err_dup_prover dup;
wenzelm@28582
   309
wenzelm@28582
   310
fun print_provers thy = Pretty.writeln
wenzelm@28582
   311
  (Pretty.strs ("external provers:" :: sort_strings (Symtab.keys (Provers.get thy))));
wenzelm@28571
   312
immler@31037
   313
fun get_prover name thy = case Symtab.lookup (Provers.get thy) name of
immler@31037
   314
  NONE => NONE
immler@31037
   315
| SOME (prover, _) => SOME prover;
wenzelm@28586
   316
wenzelm@28595
   317
(* start prover thread *)
wenzelm@28484
   318
wenzelm@28595
   319
fun start_prover name birthtime deadtime i proof_state =
immler@31037
   320
  (case get_prover name (Proof.theory_of proof_state) of
wenzelm@28595
   321
    NONE => warning ("Unknown external prover: " ^ quote name)
immler@31037
   322
  | SOME prover =>
wenzelm@28595
   323
      let
wenzelm@28595
   324
        val (ctxt, (_, goal)) = Proof.get_goal proof_state
wenzelm@28595
   325
        val desc =
wenzelm@28595
   326
          "external prover " ^ quote name ^ " for subgoal " ^ string_of_int i ^ ":\n" ^
wenzelm@28595
   327
            Syntax.string_of_term ctxt (Thm.term_of (Thm.cprem_of goal i))
wenzelm@28595
   328
        val _ = SimpleThread.fork true (fn () =>
wenzelm@28595
   329
          let
wenzelm@28595
   330
            val _ = register birthtime deadtime (Thread.self (), desc)
immler@31037
   331
            val result =
immler@31037
   332
              let val (success, message, _, _) =
immler@31037
   333
                prover (get_timeout ()) NONE name i (Proof.get_goal proof_state)
immler@31037
   334
              in (success, message) end
wenzelm@28835
   335
              handle ResHolClause.TOO_TRIVIAL
wenzelm@28835
   336
                => (true, "Empty clause: Try this command: " ^ Markup.markup Markup.sendback "apply metis")
wenzelm@28835
   337
              | ERROR msg
wenzelm@28835
   338
                => (false, "Error: " ^ msg)
immler@29620
   339
            val _ = unregister result (Thread.self ())
wenzelm@28595
   340
          in () end handle Interrupt => ())
wenzelm@28595
   341
      in () end);
wenzelm@28582
   342
wenzelm@28582
   343
wenzelm@28582
   344
(* sledghammer for first subgoal *)
wenzelm@28582
   345
wenzelm@28582
   346
fun sledgehammer names proof_state =
wenzelm@28582
   347
  let
wenzelm@28595
   348
    val provers =
wenzelm@28586
   349
      if null names then String.tokens (Symbol.is_ascii_blank o String.str) (get_atps ())
wenzelm@28582
   350
      else names
wenzelm@28582
   351
    val birthtime = Time.now ()
wenzelm@28595
   352
    val deadtime = Time.+ (birthtime, Time.fromSeconds (get_timeout ()))
wenzelm@28595
   353
  in List.app (fn name => start_prover name birthtime deadtime 1 proof_state) provers end;
wenzelm@28582
   354
wenzelm@28582
   355
wenzelm@28586
   356
wenzelm@28586
   357
(** Isar command syntax **)
wenzelm@28582
   358
wenzelm@28582
   359
local structure K = OuterKeyword and P = OuterParse in
wenzelm@28582
   360
wenzelm@28582
   361
val _ =
wenzelm@28582
   362
  OuterSyntax.improper_command "atp_kill" "kill all managed provers" K.diag
wenzelm@28586
   363
    (Scan.succeed (Toplevel.no_timing o Toplevel.imperative kill));
wenzelm@28582
   364
wenzelm@28582
   365
val _ =
wenzelm@28582
   366
  OuterSyntax.improper_command "atp_info" "print information about managed provers" K.diag
wenzelm@28582
   367
    (Scan.succeed (Toplevel.no_timing o Toplevel.imperative info));
wenzelm@28582
   368
wenzelm@28582
   369
val _ =
wenzelm@29112
   370
  OuterSyntax.improper_command "atp_messages" "print recent messages issued by managed provers" K.diag
wenzelm@29112
   371
    (Scan.option (P.$$$ "(" |-- P.nat --| P.$$$ ")") >>
wenzelm@29112
   372
      (fn limit => Toplevel.no_timing o Toplevel.imperative (fn () => messages limit)));
wenzelm@29112
   373
wenzelm@29112
   374
val _ =
wenzelm@28582
   375
  OuterSyntax.improper_command "print_atps" "print external provers" K.diag
wenzelm@28582
   376
    (Scan.succeed (Toplevel.no_timing o Toplevel.unknown_theory o
wenzelm@28582
   377
      Toplevel.keep (print_provers o Toplevel.theory_of)));
wenzelm@28582
   378
wenzelm@28582
   379
val _ =
wenzelm@28582
   380
  OuterSyntax.command "sledgehammer" "call all automatic theorem provers" K.diag
wenzelm@28582
   381
    (Scan.repeat P.xname >> (fn names => Toplevel.no_timing o Toplevel.unknown_proof o
wenzelm@30800
   382
      Toplevel.keep (sledgehammer names o Toplevel.proof_of)));
wenzelm@28582
   383
wenzelm@28582
   384
end;
wenzelm@28582
   385
wenzelm@28582
   386
end;
immler@30537
   387