src/Pure/Isar/method.ML
author wenzelm
Wed Sep 01 21:19:37 1999 +0200 (1999-09-01)
changeset 7419 5a1035047bae
parent 7367 a79d4683fadf
child 7439 a1b3310b4985
permissions -rw-r--r--
tuned;
renamed same_tac to insert_tac;
improved assumption;
removed Repeat;
immediate_proof: assumption;
wenzelm@5824
     1
(*  Title:      Pure/Isar/method.ML
wenzelm@5824
     2
    ID:         $Id$
wenzelm@5824
     3
    Author:     Markus Wenzel, TU Muenchen
wenzelm@5824
     4
wenzelm@5824
     5
Proof methods.
wenzelm@5824
     6
*)
wenzelm@5824
     7
wenzelm@5824
     8
signature BASIC_METHOD =
wenzelm@5824
     9
sig
wenzelm@5824
    10
  val print_methods: theory -> unit
wenzelm@5824
    11
  val Method: bstring -> (Args.src -> Proof.context -> Proof.method) -> string -> unit
wenzelm@5824
    12
end;
wenzelm@5824
    13
wenzelm@5824
    14
signature METHOD =
wenzelm@5824
    15
sig
wenzelm@5824
    16
  include BASIC_METHOD
wenzelm@6091
    17
  val METHOD: (thm list -> tactic) -> Proof.method
wenzelm@5824
    18
  val METHOD0: tactic -> Proof.method
wenzelm@5824
    19
  val fail: Proof.method
wenzelm@5824
    20
  val succeed: Proof.method
wenzelm@7419
    21
  val insert_tac: thm list -> int -> tactic
wenzelm@7419
    22
  val insert: Proof.method
wenzelm@7419
    23
  val fold: thm list -> Proof.method
wenzelm@7419
    24
  val unfold: thm list -> Proof.method
wenzelm@7419
    25
  val multi_resolve: thm list -> thm -> thm Seq.seq
wenzelm@7419
    26
  val multi_resolves: thm list -> thm list -> thm Seq.seq
wenzelm@6091
    27
  val rule_tac: thm list -> thm list -> int -> tactic
wenzelm@7130
    28
  val erule_tac: thm list -> thm list -> int -> tactic
wenzelm@6091
    29
  val rule: thm list -> Proof.method
wenzelm@7130
    30
  val erule: thm list -> Proof.method
wenzelm@7419
    31
  val assumption: Proof.method
wenzelm@7419
    32
  val FINISHED: tactic -> tactic
wenzelm@7419
    33
  val finish: Proof.method
wenzelm@5916
    34
  exception METHOD_FAIL of (string * Position.T) * exn
wenzelm@7419
    35
  val help_methods: theory -> unit
wenzelm@5824
    36
  val method: theory -> Args.src -> Proof.context -> Proof.method
wenzelm@5824
    37
  val add_methods: (bstring * (Args.src -> Proof.context -> Proof.method) * string) list
wenzelm@5824
    38
    -> theory -> theory
wenzelm@5884
    39
  val syntax: (Proof.context * Args.T list -> 'a * (Proof.context * Args.T list)) ->
wenzelm@5884
    40
    Proof.context -> Args.src -> Proof.context * 'a
wenzelm@5884
    41
  val no_args: Proof.method -> Args.src -> Proof.context -> Proof.method
wenzelm@7268
    42
  type modifier
wenzelm@7268
    43
  val sectioned_args: ((Args.T list -> modifier * Args.T list) list ->
wenzelm@5884
    44
      Proof.context * Args.T list -> 'a * (Proof.context * Args.T list)) ->
wenzelm@7268
    45
    (Args.T list -> modifier * Args.T list) list ->
wenzelm@5884
    46
    ('a -> Proof.context -> Proof.method) -> Args.src -> Proof.context -> Proof.method
wenzelm@7268
    47
  val default_sectioned_args: modifier ->
wenzelm@7268
    48
    (Args.T list -> modifier * Args.T list) list ->
wenzelm@5884
    49
    (Proof.context -> Proof.method) -> Args.src -> Proof.context -> Proof.method
wenzelm@7268
    50
  val only_sectioned_args: (Args.T list -> modifier * Args.T list) list ->
wenzelm@5884
    51
    (Proof.context -> Proof.method) -> Args.src -> Proof.context -> Proof.method
wenzelm@6091
    52
  val thms_args: (thm list -> Proof.method) -> Args.src -> Proof.context -> Proof.method
wenzelm@5824
    53
  datatype text =
wenzelm@5824
    54
    Basic of (Proof.context -> Proof.method) |
wenzelm@5824
    55
    Source of Args.src |
wenzelm@5824
    56
    Then of text list |
wenzelm@5824
    57
    Orelse of text list |
wenzelm@5824
    58
    Try of text |
wenzelm@5824
    59
    Repeat1 of text
wenzelm@5824
    60
  val refine: text -> Proof.state -> Proof.state Seq.seq
wenzelm@5824
    61
  val tac: text -> Proof.state -> Proof.state Seq.seq
wenzelm@5884
    62
  val then_tac: text -> Proof.state -> Proof.state Seq.seq
wenzelm@5824
    63
  val proof: text option -> Proof.state -> Proof.state Seq.seq
wenzelm@6981
    64
  val local_qed: text option
wenzelm@6981
    65
    -> ({kind: string, name: string, thm: thm} -> unit) * (thm -> unit)
wenzelm@6736
    66
    -> Proof.state -> Proof.state Seq.seq
wenzelm@6981
    67
  val local_terminal_proof: text * text option
wenzelm@6981
    68
    -> ({kind: string, name: string, thm: thm} -> unit) * (thm -> unit)
wenzelm@6736
    69
    -> Proof.state -> Proof.state Seq.seq
wenzelm@6981
    70
  val local_immediate_proof: ({kind: string, name: string, thm: thm} -> unit) * (thm -> unit)
wenzelm@6981
    71
    -> Proof.state -> Proof.state Seq.seq
wenzelm@6981
    72
  val local_default_proof: ({kind: string, name: string, thm: thm} -> unit) * (thm -> unit)
wenzelm@6736
    73
    -> Proof.state -> Proof.state Seq.seq
wenzelm@6951
    74
  val global_qed: text option -> Proof.state -> theory * {kind: string, name: string, thm: thm}
wenzelm@6934
    75
  val global_terminal_proof: text * text option
wenzelm@6934
    76
    -> Proof.state -> theory * {kind: string, name: string, thm: thm}
wenzelm@6532
    77
  val global_immediate_proof: Proof.state -> theory * {kind: string, name: string, thm: thm}
wenzelm@6532
    78
  val global_default_proof: Proof.state -> theory * {kind: string, name: string, thm: thm}
wenzelm@5824
    79
  val setup: (theory -> theory) list
wenzelm@5824
    80
end;
wenzelm@5824
    81
wenzelm@5824
    82
structure Method: METHOD =
wenzelm@5824
    83
struct
wenzelm@5824
    84
wenzelm@5824
    85
wenzelm@5824
    86
(** proof methods **)
wenzelm@5824
    87
wenzelm@5824
    88
(* method from tactic *)
wenzelm@5824
    89
wenzelm@6849
    90
val METHOD = Proof.method;
wenzelm@5824
    91
fun METHOD0 tac = METHOD (fn [] => tac | _ => error "Method may not be used with facts");
wenzelm@5824
    92
wenzelm@5824
    93
wenzelm@5824
    94
(* primitive *)
wenzelm@5824
    95
wenzelm@5824
    96
val fail = METHOD (K no_tac);
wenzelm@5824
    97
val succeed = METHOD (K all_tac);
wenzelm@5824
    98
wenzelm@5824
    99
wenzelm@7419
   100
(* insert *)
wenzelm@7419
   101
wenzelm@7419
   102
local
wenzelm@5824
   103
wenzelm@6981
   104
fun cut_rule_tac raw_rule =
wenzelm@6981
   105
  let
wenzelm@6981
   106
    val rule = Drule.forall_intr_vars raw_rule;
wenzelm@6981
   107
    val revcut_rl = Drule.incr_indexes_wrt [] [] [] [rule] Drule.revcut_rl;
wenzelm@6981
   108
  in Tactic.rtac (rule COMP revcut_rl) THEN' Tactic.rotate_tac ~1 end;
wenzelm@6981
   109
wenzelm@7419
   110
in
wenzelm@5824
   111
wenzelm@7419
   112
fun insert_tac [] i = all_tac
wenzelm@7419
   113
  | insert_tac facts i = EVERY (map (fn th => cut_rule_tac th i) facts);
wenzelm@6981
   114
wenzelm@7419
   115
val insert = METHOD (ALLGOALS o insert_tac);
wenzelm@7419
   116
wenzelm@7419
   117
end;
wenzelm@5824
   118
wenzelm@5824
   119
wenzelm@6532
   120
(* fold / unfold definitions *)
wenzelm@6532
   121
wenzelm@6532
   122
val fold = METHOD0 o fold_goals_tac;
wenzelm@6532
   123
val unfold = METHOD0 o rewrite_goals_tac;
wenzelm@6532
   124
wenzelm@6532
   125
wenzelm@7419
   126
(* multi_resolve *)
wenzelm@7419
   127
wenzelm@7419
   128
local
wenzelm@7419
   129
wenzelm@7419
   130
fun res th i rule =
wenzelm@7419
   131
  Thm.biresolution false [(false, th)] i rule handle THM _ => Seq.empty;
wenzelm@7419
   132
wenzelm@7419
   133
fun multi_res _ [] rule = Seq.single rule
wenzelm@7419
   134
  | multi_res i (th :: ths) rule = Seq.flat (Seq.map (res th i) (multi_res (i + 1) ths rule));
wenzelm@7419
   135
wenzelm@7419
   136
in
wenzelm@7419
   137
wenzelm@7419
   138
val multi_resolve = multi_res 1;
wenzelm@7419
   139
fun multi_resolves facts rules = Seq.flat (Seq.map (multi_resolve facts) (Seq.of_list rules));
wenzelm@7419
   140
wenzelm@7419
   141
end;
wenzelm@7419
   142
wenzelm@7419
   143
wenzelm@5824
   144
(* rule *)
wenzelm@5824
   145
wenzelm@7419
   146
local
wenzelm@5824
   147
wenzelm@7130
   148
fun gen_rule_tac tac rules [] = tac rules
wenzelm@7130
   149
  | gen_rule_tac tac erules facts =
wenzelm@5824
   150
      let
wenzelm@7419
   151
        val rules = multi_resolves facts erules;
wenzelm@7130
   152
        fun tactic i state = Seq.flat (Seq.map (fn rule => tac [rule] i state) rules);
wenzelm@7130
   153
      in tactic end;
wenzelm@7130
   154
wenzelm@7419
   155
in
wenzelm@7419
   156
wenzelm@7130
   157
val rule_tac = gen_rule_tac Tactic.resolve_tac;
wenzelm@7130
   158
val erule_tac = gen_rule_tac Tactic.eresolve_tac;
wenzelm@5824
   159
wenzelm@5824
   160
fun rule rules = METHOD (FIRSTGOAL o rule_tac rules);
wenzelm@7130
   161
fun erule rules = METHOD (FIRSTGOAL o erule_tac rules);
wenzelm@5824
   162
wenzelm@7419
   163
end;
wenzelm@7419
   164
wenzelm@7419
   165
wenzelm@7419
   166
(* assumption *)
wenzelm@7419
   167
wenzelm@7419
   168
fun assumption_tac [] = assume_tac
wenzelm@7419
   169
  | assumption_tac [fact] = resolve_tac [fact]
wenzelm@7419
   170
  | assumption_tac _ = K no_tac;
wenzelm@7419
   171
wenzelm@7419
   172
val assumption = METHOD (FIRSTGOAL o assumption_tac);
wenzelm@7419
   173
wenzelm@7419
   174
wenzelm@7419
   175
(* finish *)
wenzelm@7419
   176
wenzelm@7419
   177
val FINISHED = FILTER (equal 0 o Thm.nprems_of);
wenzelm@7419
   178
val finish = METHOD (K (FINISHED (ALLGOALS assume_tac)));
wenzelm@7419
   179
wenzelm@5824
   180
wenzelm@5824
   181
wenzelm@5824
   182
(** methods theory data **)
wenzelm@5824
   183
wenzelm@5824
   184
(* data kind 'Isar/methods' *)
wenzelm@5824
   185
wenzelm@5824
   186
structure MethodsDataArgs =
wenzelm@5824
   187
struct
wenzelm@5824
   188
  val name = "Isar/methods";
wenzelm@5824
   189
  type T =
wenzelm@5824
   190
    {space: NameSpace.T,
wenzelm@5824
   191
     meths: (((Args.src -> Proof.context -> Proof.method) * string) * stamp) Symtab.table};
wenzelm@5824
   192
wenzelm@5824
   193
  val empty = {space = NameSpace.empty, meths = Symtab.empty};
wenzelm@6546
   194
  val copy = I;
wenzelm@5824
   195
  val prep_ext = I;
wenzelm@5824
   196
  fun merge ({space = space1, meths = meths1}, {space = space2, meths = meths2}) =
wenzelm@5824
   197
    {space = NameSpace.merge (space1, space2),
wenzelm@5824
   198
      meths = Symtab.merge eq_snd (meths1, meths2) handle Symtab.DUPS dups =>
wenzelm@5824
   199
        error ("Attempt to merge different versions of methods " ^ commas_quote dups)};
wenzelm@5824
   200
wenzelm@7367
   201
  fun print_meths verbose {space, meths} =
wenzelm@5824
   202
    let
wenzelm@5824
   203
      fun prt_meth (name, ((_, comment), _)) = Pretty.block
wenzelm@6849
   204
        [Pretty.str (name ^ ":"), Pretty.brk 2, Pretty.str comment];
wenzelm@5824
   205
    in
wenzelm@7367
   206
      if not verbose then ()
wenzelm@7367
   207
      else Pretty.writeln (Display.pretty_name_space ("method name space", space));
wenzelm@6849
   208
      Pretty.writeln (Pretty.big_list "methods:"
wenzelm@6849
   209
        (map prt_meth (NameSpace.cond_extern_table space meths)))
wenzelm@5824
   210
    end;
wenzelm@7367
   211
wenzelm@7367
   212
  fun print _ = print_meths true;
wenzelm@5824
   213
end;
wenzelm@5824
   214
wenzelm@5824
   215
structure MethodsData = TheoryDataFun(MethodsDataArgs);
wenzelm@5824
   216
val print_methods = MethodsData.print;
wenzelm@7367
   217
val help_methods = MethodsDataArgs.print_meths false o MethodsData.get;
wenzelm@5824
   218
wenzelm@5824
   219
wenzelm@5824
   220
(* get methods *)
wenzelm@5824
   221
wenzelm@5916
   222
exception METHOD_FAIL of (string * Position.T) * exn;
wenzelm@5916
   223
wenzelm@5824
   224
fun method thy =
wenzelm@5824
   225
  let
wenzelm@5824
   226
    val {space, meths} = MethodsData.get thy;
wenzelm@5824
   227
wenzelm@5884
   228
    fun meth src =
wenzelm@5884
   229
      let
wenzelm@5884
   230
        val ((raw_name, _), pos) = Args.dest_src src;
wenzelm@5884
   231
        val name = NameSpace.intern space raw_name;
wenzelm@5884
   232
      in
wenzelm@5824
   233
        (case Symtab.lookup (meths, name) of
wenzelm@5824
   234
          None => error ("Unknown proof method: " ^ quote name ^ Position.str_of pos)
wenzelm@5916
   235
        | Some ((mth, _), _) => transform_failure (curry METHOD_FAIL (name, pos)) (mth src))
wenzelm@5824
   236
      end;
wenzelm@5824
   237
  in meth end;
wenzelm@5824
   238
wenzelm@5824
   239
wenzelm@5824
   240
(* add_methods *)
wenzelm@5824
   241
wenzelm@5824
   242
fun add_methods raw_meths thy =
wenzelm@5824
   243
  let
wenzelm@5824
   244
    val full = Sign.full_name (Theory.sign_of thy);
wenzelm@5824
   245
    val new_meths =
wenzelm@5824
   246
      map (fn (name, f, comment) => (full name, ((f, comment), stamp ()))) raw_meths;
wenzelm@5824
   247
wenzelm@5824
   248
    val {space, meths} = MethodsData.get thy;
wenzelm@5824
   249
    val space' = NameSpace.extend (space, map fst new_meths);
wenzelm@5824
   250
    val meths' = Symtab.extend (meths, new_meths) handle Symtab.DUPS dups =>
wenzelm@5824
   251
      error ("Duplicate declaration of method(s) " ^ commas_quote dups);
wenzelm@5824
   252
  in
wenzelm@5824
   253
    thy |> MethodsData.put {space = space', meths = meths'}
wenzelm@5824
   254
  end;
wenzelm@5824
   255
wenzelm@5824
   256
(*implicit version*)
wenzelm@5824
   257
fun Method name meth cmt = Context.>> (add_methods [(name, meth, cmt)]);
wenzelm@5824
   258
wenzelm@5824
   259
wenzelm@5884
   260
wenzelm@5884
   261
(** method syntax **)
wenzelm@5824
   262
wenzelm@5884
   263
(* basic *)
wenzelm@5884
   264
wenzelm@5884
   265
fun syntax (scan: (Proof.context * Args.T list -> 'a * (Proof.context * Args.T list))) =
wenzelm@5884
   266
  Args.syntax "method" scan;
wenzelm@5824
   267
wenzelm@5884
   268
fun no_args (x: Proof.method) src ctxt = #2 (syntax (Scan.succeed x) ctxt src);
wenzelm@5884
   269
wenzelm@5884
   270
wenzelm@5884
   271
(* sections *)
wenzelm@5824
   272
wenzelm@7268
   273
type modifier = (Proof.context -> Proof.context) * Proof.context attribute;
wenzelm@7268
   274
wenzelm@7268
   275
local
wenzelm@7268
   276
wenzelm@5884
   277
fun sect ss = Scan.first (map (fn s => Scan.lift (s --| Args.$$$ ":")) ss);
wenzelm@5884
   278
fun thms ss = Scan.unless (sect ss) Attrib.local_thms;
wenzelm@5884
   279
fun thmss ss = Scan.repeat (thms ss) >> flat;
wenzelm@5884
   280
wenzelm@7268
   281
fun apply (f, att) (ctxt, ths) = Thm.applys_attributes ((f ctxt, ths), [att]);
wenzelm@5824
   282
wenzelm@7268
   283
fun section ss = (sect ss -- thmss ss) :-- (fn (m, ths) => Scan.depend (fn ctxt =>
wenzelm@7268
   284
  Scan.succeed (apply m (ctxt, ths)))) >> #2;
wenzelm@5884
   285
wenzelm@5884
   286
fun sectioned args ss = args ss -- Scan.repeat (section ss);
wenzelm@5884
   287
wenzelm@7268
   288
in
wenzelm@5824
   289
wenzelm@5884
   290
fun sectioned_args args ss f src ctxt =
wenzelm@5921
   291
  let val (ctxt', (x, _)) = syntax (sectioned args ss) ctxt src
wenzelm@5921
   292
  in f x ctxt' end;
wenzelm@5884
   293
wenzelm@7268
   294
fun default_sectioned_args m ss f src ctxt =
wenzelm@7268
   295
  sectioned_args thmss ss (fn ths => fn ctxt' => f (#1 (apply m (ctxt', ths)))) src ctxt;
wenzelm@5884
   296
wenzelm@5884
   297
fun only_sectioned_args ss f = sectioned_args (K (Scan.succeed ())) ss (fn () => f);
wenzelm@7268
   298
wenzelm@5884
   299
fun thms_args f = sectioned_args thmss [] (fn ths => fn _ => f ths);
wenzelm@5824
   300
wenzelm@7268
   301
end;
wenzelm@7268
   302
wenzelm@5824
   303
wenzelm@5824
   304
wenzelm@5824
   305
(** method text **)
wenzelm@5824
   306
wenzelm@5824
   307
(* datatype text *)
wenzelm@5824
   308
wenzelm@5824
   309
datatype text =
wenzelm@5824
   310
  Basic of (Proof.context -> Proof.method) |
wenzelm@5824
   311
  Source of Args.src |
wenzelm@5824
   312
  Then of text list |
wenzelm@5824
   313
  Orelse of text list |
wenzelm@5824
   314
  Try of text |
wenzelm@5824
   315
  Repeat1 of text;
wenzelm@5824
   316
wenzelm@5824
   317
wenzelm@5824
   318
(* refine *)
wenzelm@5824
   319
wenzelm@5824
   320
fun refine text state =
wenzelm@5824
   321
  let
wenzelm@5824
   322
    val thy = Proof.theory_of state;
wenzelm@5824
   323
wenzelm@5824
   324
    fun eval (Basic mth) = Proof.refine mth
wenzelm@5824
   325
      | eval (Source src) = Proof.refine (method thy src)
wenzelm@5824
   326
      | eval (Then txts) = Seq.EVERY (map eval txts)
wenzelm@5824
   327
      | eval (Orelse txts) = Seq.FIRST (map eval txts)
wenzelm@5824
   328
      | eval (Try txt) = Seq.TRY (eval txt)
wenzelm@5824
   329
      | eval (Repeat1 txt) = Seq.REPEAT1 (eval txt);
wenzelm@5824
   330
  in eval text state end;
wenzelm@5824
   331
wenzelm@6404
   332
fun named_method name = Source (Args.src ((name, []), Position.none));
wenzelm@6404
   333
wenzelm@5824
   334
wenzelm@5824
   335
(* unstructured steps *)
wenzelm@5824
   336
wenzelm@5824
   337
fun tac text state =
wenzelm@5824
   338
  state
wenzelm@5824
   339
  |> Proof.goal_facts (K [])
wenzelm@5824
   340
  |> refine text;
wenzelm@5824
   341
wenzelm@5884
   342
fun then_tac text state =
wenzelm@5824
   343
  state
wenzelm@5824
   344
  |> Proof.goal_facts Proof.the_facts
wenzelm@5824
   345
  |> refine text;
wenzelm@5824
   346
wenzelm@5824
   347
wenzelm@6404
   348
(* structured proof steps *)
wenzelm@5824
   349
wenzelm@6404
   350
val default_text = named_method "default";
wenzelm@6404
   351
val finish_text = named_method "finish";
wenzelm@5824
   352
wenzelm@6872
   353
wenzelm@5824
   354
fun proof opt_text state =
wenzelm@5824
   355
  state
wenzelm@5824
   356
  |> Proof.assert_backward
wenzelm@6404
   357
  |> refine (if_none opt_text default_text)
wenzelm@5824
   358
  |> Seq.map Proof.enter_forward;
wenzelm@5824
   359
wenzelm@6404
   360
fun local_qed opt_text = Proof.local_qed (refine (if_none opt_text finish_text));
wenzelm@6934
   361
fun local_terminal_proof (text, opt_text) pr = Seq.THEN (proof (Some text), local_qed opt_text pr);
wenzelm@7419
   362
val local_immediate_proof = local_terminal_proof (Basic (K assumption), None);
wenzelm@6934
   363
val local_default_proof = local_terminal_proof (default_text, None);
wenzelm@5824
   364
wenzelm@6872
   365
wenzelm@6951
   366
fun global_qeds opt_text = Proof.global_qed (refine (if_none opt_text finish_text));
wenzelm@5824
   367
wenzelm@6951
   368
fun global_qed opt_text state =
wenzelm@6872
   369
  state
wenzelm@6951
   370
  |> global_qeds opt_text
wenzelm@6872
   371
  |> Proof.check_result "Failed to finish proof" state
wenzelm@6872
   372
  |> Seq.hd;
wenzelm@6872
   373
wenzelm@6934
   374
fun global_terminal_proof (text, opt_text) state =
wenzelm@6872
   375
  state
wenzelm@6872
   376
  |> proof (Some text)
wenzelm@6872
   377
  |> Proof.check_result "Terminal proof method failed" state
wenzelm@6951
   378
  |> (Seq.flat o Seq.map (global_qeds opt_text))
wenzelm@6872
   379
  |> Proof.check_result "Failed to finish proof (after successful terminal method)" state
wenzelm@6872
   380
  |> Seq.hd;
wenzelm@6872
   381
wenzelm@7419
   382
val global_immediate_proof = global_terminal_proof (Basic (K assumption), None);
wenzelm@6934
   383
val global_default_proof = global_terminal_proof (default_text, None);
wenzelm@5824
   384
wenzelm@5824
   385
wenzelm@5824
   386
wenzelm@5824
   387
(** theory setup **)
wenzelm@5824
   388
wenzelm@5824
   389
(* pure_methods *)
wenzelm@5824
   390
wenzelm@5824
   391
val pure_methods =
wenzelm@5824
   392
 [("fail", no_args fail, "force failure"),
wenzelm@5824
   393
  ("succeed", no_args succeed, "succeed"),
wenzelm@7419
   394
  ("-", no_args insert, "insert facts, nothing else"),
wenzelm@6532
   395
  ("fold", thms_args fold, "fold definitions"),
wenzelm@6532
   396
  ("unfold", thms_args unfold, "unfold definitions"),
wenzelm@7130
   397
  ("rule", thms_args rule, "apply some rule"),
wenzelm@7419
   398
  ("erule", thms_args erule, "apply some erule (improper!)"),
wenzelm@7419
   399
  ("assumption", no_args assumption, "proof by assumption"),
wenzelm@7419
   400
  ("finish", no_args finish, "finish proof by assumption")];
wenzelm@5824
   401
wenzelm@5824
   402
wenzelm@5824
   403
(* setup *)
wenzelm@5824
   404
wenzelm@5824
   405
val setup = [MethodsData.init, add_methods pure_methods];
wenzelm@5824
   406
wenzelm@5824
   407
wenzelm@5824
   408
end;
wenzelm@5824
   409
wenzelm@5824
   410
wenzelm@5824
   411
structure BasicMethod: BASIC_METHOD = Method;
wenzelm@5824
   412
open BasicMethod;