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