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