src/Pure/Isar/method.ML
author wenzelm
Wed Sep 29 13:49:07 1999 +0200 (1999-09-29)
changeset 7632 25a0d2ba3a87
parent 7611 5b5aba10c8f6
child 7664 c151ac595551
permissions -rw-r--r--
removed extra shyps error;
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@7601
    24
  val unfold: thm list -> Proof.method
wenzelm@7419
    25
  val fold: 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@7611
    34
  val help_methods: theory option -> 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@7601
    43
  val sectioned_args: (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@7601
    46
  val bang_sectioned_args:
wenzelm@7601
    47
    (Args.T list -> modifier * Args.T list) list ->
wenzelm@7555
    48
    (thm list -> Proof.context -> Proof.method) -> Args.src -> Proof.context -> Proof.method
wenzelm@7601
    49
  val only_sectioned_args:
wenzelm@7601
    50
    (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@7506
    61
  val refine_no_facts: text -> Proof.state -> Proof.state Seq.seq
wenzelm@5824
    62
  val proof: text option -> Proof.state -> Proof.state Seq.seq
wenzelm@6981
    63
  val local_qed: text option
wenzelm@6981
    64
    -> ({kind: string, name: string, thm: thm} -> unit) * (thm -> unit)
wenzelm@6736
    65
    -> Proof.state -> Proof.state Seq.seq
wenzelm@6981
    66
  val local_terminal_proof: text * text option
wenzelm@6981
    67
    -> ({kind: string, name: string, thm: thm} -> unit) * (thm -> unit)
wenzelm@6736
    68
    -> Proof.state -> Proof.state Seq.seq
wenzelm@6981
    69
  val local_immediate_proof: ({kind: string, name: string, thm: thm} -> unit) * (thm -> unit)
wenzelm@6981
    70
    -> Proof.state -> Proof.state Seq.seq
wenzelm@6981
    71
  val local_default_proof: ({kind: string, name: string, thm: thm} -> unit) * (thm -> unit)
wenzelm@6736
    72
    -> Proof.state -> Proof.state Seq.seq
wenzelm@6951
    73
  val global_qed: text option -> Proof.state -> theory * {kind: string, name: string, thm: thm}
wenzelm@6934
    74
  val global_terminal_proof: text * text option
wenzelm@6934
    75
    -> Proof.state -> theory * {kind: string, name: string, thm: thm}
wenzelm@6532
    76
  val global_immediate_proof: Proof.state -> theory * {kind: string, name: string, thm: thm}
wenzelm@6532
    77
  val global_default_proof: Proof.state -> theory * {kind: string, name: string, thm: thm}
wenzelm@5824
    78
  val setup: (theory -> theory) list
wenzelm@5824
    79
end;
wenzelm@5824
    80
wenzelm@5824
    81
structure Method: METHOD =
wenzelm@5824
    82
struct
wenzelm@5824
    83
wenzelm@5824
    84
wenzelm@5824
    85
(** proof methods **)
wenzelm@5824
    86
wenzelm@5824
    87
(* method from tactic *)
wenzelm@5824
    88
wenzelm@6849
    89
val METHOD = Proof.method;
wenzelm@5824
    90
fun METHOD0 tac = METHOD (fn [] => tac | _ => error "Method may not be used with facts");
wenzelm@5824
    91
wenzelm@5824
    92
wenzelm@5824
    93
(* primitive *)
wenzelm@5824
    94
wenzelm@5824
    95
val fail = METHOD (K no_tac);
wenzelm@5824
    96
val succeed = METHOD (K all_tac);
wenzelm@5824
    97
wenzelm@5824
    98
wenzelm@7419
    99
(* insert *)
wenzelm@7419
   100
wenzelm@7419
   101
local
wenzelm@5824
   102
wenzelm@6981
   103
fun cut_rule_tac raw_rule =
wenzelm@6981
   104
  let
wenzelm@6981
   105
    val rule = Drule.forall_intr_vars raw_rule;
wenzelm@6981
   106
    val revcut_rl = Drule.incr_indexes_wrt [] [] [] [rule] Drule.revcut_rl;
wenzelm@7555
   107
  in Tactic.rtac (rule COMP revcut_rl) end;
wenzelm@6981
   108
wenzelm@7419
   109
in
wenzelm@5824
   110
wenzelm@7419
   111
fun insert_tac [] i = all_tac
wenzelm@7419
   112
  | insert_tac facts i = EVERY (map (fn th => cut_rule_tac th i) facts);
wenzelm@6981
   113
wenzelm@7555
   114
val insert_facts = METHOD (ALLGOALS o insert_tac);
wenzelm@7574
   115
fun insert thms = METHOD (fn facts => ALLGOALS (insert_tac (thms @ facts)));
wenzelm@7419
   116
wenzelm@7419
   117
end;
wenzelm@5824
   118
wenzelm@5824
   119
wenzelm@7601
   120
(* unfold / fold definitions *)
wenzelm@6532
   121
wenzelm@7601
   122
fun unfold thms = METHOD (fn facts => ALLGOALS (insert_tac facts) THEN rewrite_goals_tac thms);
wenzelm@7555
   123
fun fold thms = METHOD (fn facts => ALLGOALS (insert_tac facts) THEN fold_goals_tac thms);
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@7555
   166
(* assumption / finish *)
wenzelm@7555
   167
wenzelm@7555
   168
fun assm_tac ctxt =
wenzelm@7555
   169
  assume_tac APPEND' resolve_tac (filter Thm.no_prems (ProofContext.prems_of ctxt));
wenzelm@7419
   170
wenzelm@7555
   171
fun assumption_tac ctxt [] = assm_tac ctxt
wenzelm@7555
   172
  | assumption_tac _ [fact] = resolve_tac [fact]
wenzelm@7555
   173
  | assumption_tac _ _ = K no_tac;
wenzelm@7419
   174
wenzelm@7555
   175
fun assumption ctxt = METHOD (FIRSTGOAL o assumption_tac ctxt);
wenzelm@7555
   176
fun finish ctxt = METHOD (K (FILTER Thm.no_prems (ALLGOALS (assm_tac ctxt))));
wenzelm@7419
   177
wenzelm@7419
   178
wenzelm@5824
   179
wenzelm@5824
   180
(** methods theory data **)
wenzelm@5824
   181
wenzelm@5824
   182
(* data kind 'Isar/methods' *)
wenzelm@5824
   183
wenzelm@5824
   184
structure MethodsDataArgs =
wenzelm@5824
   185
struct
wenzelm@5824
   186
  val name = "Isar/methods";
wenzelm@5824
   187
  type T =
wenzelm@5824
   188
    {space: NameSpace.T,
wenzelm@5824
   189
     meths: (((Args.src -> Proof.context -> Proof.method) * string) * stamp) Symtab.table};
wenzelm@5824
   190
wenzelm@5824
   191
  val empty = {space = NameSpace.empty, meths = Symtab.empty};
wenzelm@6546
   192
  val copy = I;
wenzelm@5824
   193
  val prep_ext = I;
wenzelm@5824
   194
  fun merge ({space = space1, meths = meths1}, {space = space2, meths = meths2}) =
wenzelm@5824
   195
    {space = NameSpace.merge (space1, space2),
wenzelm@5824
   196
      meths = Symtab.merge eq_snd (meths1, meths2) handle Symtab.DUPS dups =>
wenzelm@5824
   197
        error ("Attempt to merge different versions of methods " ^ commas_quote dups)};
wenzelm@5824
   198
wenzelm@7367
   199
  fun print_meths verbose {space, meths} =
wenzelm@5824
   200
    let
wenzelm@5824
   201
      fun prt_meth (name, ((_, comment), _)) = Pretty.block
wenzelm@6849
   202
        [Pretty.str (name ^ ":"), Pretty.brk 2, Pretty.str comment];
wenzelm@5824
   203
    in
wenzelm@7367
   204
      if not verbose then ()
wenzelm@7367
   205
      else Pretty.writeln (Display.pretty_name_space ("method name space", space));
wenzelm@6849
   206
      Pretty.writeln (Pretty.big_list "methods:"
wenzelm@6849
   207
        (map prt_meth (NameSpace.cond_extern_table space meths)))
wenzelm@5824
   208
    end;
wenzelm@7367
   209
wenzelm@7367
   210
  fun print _ = print_meths true;
wenzelm@5824
   211
end;
wenzelm@5824
   212
wenzelm@5824
   213
structure MethodsData = TheoryDataFun(MethodsDataArgs);
wenzelm@5824
   214
val print_methods = MethodsData.print;
wenzelm@7611
   215
wenzelm@7611
   216
fun help_methods None = writeln "methods: (unkown theory context)"
wenzelm@7611
   217
  | help_methods (Some thy) = MethodsDataArgs.print_meths false (MethodsData.get thy);
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@7555
   268
fun ctxt_args (f: Proof.context -> Proof.method) src ctxt =
wenzelm@7555
   269
  #2 (syntax (Scan.succeed (f ctxt)) ctxt src);
wenzelm@7555
   270
wenzelm@7555
   271
fun no_args m = ctxt_args (K m);
wenzelm@5884
   272
wenzelm@5884
   273
wenzelm@5884
   274
(* sections *)
wenzelm@5824
   275
wenzelm@7268
   276
type modifier = (Proof.context -> Proof.context) * Proof.context attribute;
wenzelm@7268
   277
wenzelm@7268
   278
local
wenzelm@7268
   279
wenzelm@5884
   280
fun sect ss = Scan.first (map (fn s => Scan.lift (s --| Args.$$$ ":")) ss);
wenzelm@5884
   281
fun thms ss = Scan.unless (sect ss) Attrib.local_thms;
wenzelm@5884
   282
fun thmss ss = Scan.repeat (thms ss) >> flat;
wenzelm@5884
   283
wenzelm@7268
   284
fun apply (f, att) (ctxt, ths) = Thm.applys_attributes ((f ctxt, ths), [att]);
wenzelm@5824
   285
wenzelm@7268
   286
fun section ss = (sect ss -- thmss ss) :-- (fn (m, ths) => Scan.depend (fn ctxt =>
wenzelm@7268
   287
  Scan.succeed (apply m (ctxt, ths)))) >> #2;
wenzelm@5884
   288
wenzelm@7601
   289
fun sectioned args ss = args -- Scan.repeat (section ss);
wenzelm@5884
   290
wenzelm@7268
   291
in
wenzelm@5824
   292
wenzelm@5884
   293
fun sectioned_args args ss f src ctxt =
wenzelm@5921
   294
  let val (ctxt', (x, _)) = syntax (sectioned args ss) ctxt src
wenzelm@5921
   295
  in f x ctxt' end;
wenzelm@5884
   296
wenzelm@7601
   297
fun bang_sectioned_args ss f = sectioned_args Args.bang_facts ss f;
wenzelm@7601
   298
fun only_sectioned_args ss f = sectioned_args (Scan.succeed ()) ss (fn () => f);
wenzelm@7268
   299
wenzelm@7601
   300
fun thms_args f = sectioned_args (thmss []) [] (fn ths => fn _ => f ths);
wenzelm@5824
   301
wenzelm@7268
   302
end;
wenzelm@7268
   303
wenzelm@5824
   304
wenzelm@5824
   305
wenzelm@5824
   306
(** method text **)
wenzelm@5824
   307
wenzelm@5824
   308
(* datatype text *)
wenzelm@5824
   309
wenzelm@5824
   310
datatype text =
wenzelm@5824
   311
  Basic of (Proof.context -> Proof.method) |
wenzelm@5824
   312
  Source of Args.src |
wenzelm@5824
   313
  Then of text list |
wenzelm@5824
   314
  Orelse of text list |
wenzelm@5824
   315
  Try of text |
wenzelm@5824
   316
  Repeat1 of text;
wenzelm@5824
   317
wenzelm@5824
   318
wenzelm@5824
   319
(* refine *)
wenzelm@5824
   320
wenzelm@5824
   321
fun refine text state =
wenzelm@5824
   322
  let
wenzelm@5824
   323
    val thy = Proof.theory_of state;
wenzelm@5824
   324
wenzelm@5824
   325
    fun eval (Basic mth) = Proof.refine mth
wenzelm@5824
   326
      | eval (Source src) = Proof.refine (method thy src)
wenzelm@5824
   327
      | eval (Then txts) = Seq.EVERY (map eval txts)
wenzelm@5824
   328
      | eval (Orelse txts) = Seq.FIRST (map eval txts)
wenzelm@5824
   329
      | eval (Try txt) = Seq.TRY (eval txt)
wenzelm@5824
   330
      | eval (Repeat1 txt) = Seq.REPEAT1 (eval txt);
wenzelm@5824
   331
  in eval text state end;
wenzelm@5824
   332
wenzelm@7506
   333
fun refine_no_facts text state =
wenzelm@7506
   334
  state
wenzelm@7506
   335
  |> Proof.goal_facts (K [])
wenzelm@7506
   336
  |> refine text;
wenzelm@6404
   337
wenzelm@5824
   338
wenzelm@6404
   339
(* structured proof steps *)
wenzelm@5824
   340
wenzelm@7506
   341
val default_text = Source (Args.src (("default", []), Position.none));
wenzelm@7555
   342
wenzelm@7555
   343
fun finish_text None = Basic finish
wenzelm@7555
   344
  | finish_text (Some txt) = Then [txt, Basic finish];
wenzelm@6872
   345
wenzelm@5824
   346
fun proof opt_text state =
wenzelm@5824
   347
  state
wenzelm@5824
   348
  |> Proof.assert_backward
wenzelm@6404
   349
  |> refine (if_none opt_text default_text)
wenzelm@5824
   350
  |> Seq.map Proof.enter_forward;
wenzelm@5824
   351
wenzelm@7439
   352
fun local_qed opt_text = Proof.local_qed (refine (finish_text opt_text));
wenzelm@6934
   353
fun local_terminal_proof (text, opt_text) pr = Seq.THEN (proof (Some text), local_qed opt_text pr);
wenzelm@7555
   354
val local_immediate_proof = local_terminal_proof (Basic assumption, None);
wenzelm@6934
   355
val local_default_proof = local_terminal_proof (default_text, None);
wenzelm@5824
   356
wenzelm@6872
   357
wenzelm@7439
   358
fun global_qeds opt_text = Proof.global_qed (refine (finish_text opt_text));
wenzelm@5824
   359
wenzelm@6951
   360
fun global_qed opt_text state =
wenzelm@6872
   361
  state
wenzelm@6951
   362
  |> global_qeds opt_text
wenzelm@6872
   363
  |> Proof.check_result "Failed to finish proof" state
wenzelm@6872
   364
  |> Seq.hd;
wenzelm@6872
   365
wenzelm@6934
   366
fun global_terminal_proof (text, opt_text) state =
wenzelm@6872
   367
  state
wenzelm@6872
   368
  |> proof (Some text)
wenzelm@6872
   369
  |> Proof.check_result "Terminal proof method failed" state
wenzelm@6951
   370
  |> (Seq.flat o Seq.map (global_qeds opt_text))
wenzelm@6872
   371
  |> Proof.check_result "Failed to finish proof (after successful terminal method)" state
wenzelm@6872
   372
  |> Seq.hd;
wenzelm@6872
   373
wenzelm@7555
   374
val global_immediate_proof = global_terminal_proof (Basic assumption, None);
wenzelm@6934
   375
val global_default_proof = global_terminal_proof (default_text, None);
wenzelm@5824
   376
wenzelm@5824
   377
wenzelm@5824
   378
wenzelm@5824
   379
(** theory setup **)
wenzelm@5824
   380
wenzelm@5824
   381
(* pure_methods *)
wenzelm@5824
   382
wenzelm@5824
   383
val pure_methods =
wenzelm@5824
   384
 [("fail", no_args fail, "force failure"),
wenzelm@5824
   385
  ("succeed", no_args succeed, "succeed"),
wenzelm@7574
   386
  ("-", no_args insert_facts, "do nothing, inserting current facts only"),
wenzelm@7574
   387
  ("insert", thms_args insert, "insert facts (improper!)"),
wenzelm@7601
   388
  ("unfold", thms_args unfold, "unfold definitions"),
wenzelm@7601
   389
  ("fold", thms_args fold, "fold definitions"),
wenzelm@7130
   390
  ("rule", thms_args rule, "apply some rule"),
wenzelm@7419
   391
  ("erule", thms_args erule, "apply some erule (improper!)"),
wenzelm@7555
   392
  ("assumption", ctxt_args assumption, "proof by assumption, preferring facts")];
wenzelm@5824
   393
wenzelm@5824
   394
wenzelm@5824
   395
(* setup *)
wenzelm@5824
   396
wenzelm@5824
   397
val setup = [MethodsData.init, add_methods pure_methods];
wenzelm@5824
   398
wenzelm@5824
   399
wenzelm@5824
   400
end;
wenzelm@5824
   401
wenzelm@5824
   402
wenzelm@5824
   403
structure BasicMethod: BASIC_METHOD = Method;
wenzelm@5824
   404
open BasicMethod;