src/Pure/Isar/rule_insts.ML
author wenzelm
Wed Sep 06 22:48:36 2006 +0200 (2006-09-06)
changeset 20487 6ac7a4fc32a0
parent 20343 e093a54bf25e
child 20509 073a5ed7dd71
permissions -rw-r--r--
read_instantiate: declare names of TVars as well (temporary workaround for no-freeze feature of type inference);
wenzelm@20336
     1
(*  Title:      Pure/Isar/rule_insts.ML
wenzelm@20336
     2
    ID:         $Id$
wenzelm@20336
     3
    Author:     Makarius
wenzelm@20336
     4
wenzelm@20336
     5
Rule instantiations -- operations within a rule/subgoal context.
wenzelm@20336
     6
*)
wenzelm@20336
     7
wenzelm@20336
     8
signature RULE_INSTS =
wenzelm@20336
     9
sig
wenzelm@20336
    10
  val bires_inst_tac: bool -> Proof.context -> (indexname * string) list ->
wenzelm@20336
    11
    thm -> int -> tactic
wenzelm@20336
    12
end;
wenzelm@20336
    13
wenzelm@20336
    14
structure RuleInsts: RULE_INSTS =
wenzelm@20336
    15
struct
wenzelm@20336
    16
wenzelm@20336
    17
wenzelm@20343
    18
(** reading instantiations **)
wenzelm@20336
    19
wenzelm@20336
    20
local
wenzelm@20336
    21
wenzelm@20343
    22
fun is_tvar (x, _) = String.isPrefix "'" x;
wenzelm@20336
    23
wenzelm@20336
    24
fun error_var msg xi = error (msg ^ Syntax.string_of_vname xi);
wenzelm@20336
    25
wenzelm@20343
    26
fun the_sort tvars xi = the (AList.lookup (op =) tvars xi)
wenzelm@20336
    27
  handle Option.Option => error_var "No such type variable in theorem: " xi;
wenzelm@20336
    28
wenzelm@20343
    29
fun the_type vars xi = the (AList.lookup (op =) vars xi)
wenzelm@20336
    30
  handle Option.Option => error_var "No such variable in theorem: " xi;
wenzelm@20336
    31
wenzelm@20343
    32
fun unify_vartypes thy vars (xi, u) (unifier, maxidx) =
wenzelm@20336
    33
  let
wenzelm@20343
    34
    val T = the_type vars xi;
wenzelm@20336
    35
    val U = Term.fastype_of u;
wenzelm@20343
    36
    val maxidx' = Term.maxidx_term u (Int.max (#2 xi, maxidx));
wenzelm@20336
    37
  in
wenzelm@20336
    38
    Sign.typ_unify thy (T, U) (unifier, maxidx')
wenzelm@20336
    39
      handle Type.TUNIFY => error_var "Incompatible type for instantiation of " xi
wenzelm@20336
    40
  end;
wenzelm@20336
    41
wenzelm@20343
    42
fun instantiate inst =
wenzelm@20343
    43
  Term.instantiate ([], map (fn (xi, t) => ((xi, Term.fastype_of t), t)) inst) #>
wenzelm@20343
    44
  Envir.beta_norm;
wenzelm@20336
    45
wenzelm@20343
    46
fun make_instT f v =
wenzelm@20336
    47
  let
wenzelm@20343
    48
    val T = TVar v;
wenzelm@20343
    49
    val T' = f T;
wenzelm@20343
    50
  in if T = T' then NONE else SOME (T, T') end;
wenzelm@20343
    51
wenzelm@20343
    52
fun make_inst f v =
wenzelm@20343
    53
  let
wenzelm@20343
    54
    val t = Var v;
wenzelm@20343
    55
    val t' = f t;
wenzelm@20343
    56
  in if t aconv t' then NONE else SOME (t, t') end;
wenzelm@20336
    57
wenzelm@20336
    58
in
wenzelm@20336
    59
wenzelm@20343
    60
fun read_insts ctxt mixed_insts (tvars, vars) =
wenzelm@20336
    61
  let
wenzelm@20343
    62
    val thy = ProofContext.theory_of ctxt;
wenzelm@20343
    63
    val cert = Thm.cterm_of thy;
wenzelm@20343
    64
    val certT = Thm.ctyp_of thy;
wenzelm@20336
    65
wenzelm@20343
    66
    val (type_insts, term_insts) = List.partition (is_tvar o fst) mixed_insts;
wenzelm@20336
    67
    val internal_insts = term_insts |> map_filter
wenzelm@20336
    68
      (fn (xi, Args.Term t) => SOME (xi, t)
wenzelm@20343
    69
        | (_, Args.Name _) => NONE
wenzelm@20343
    70
        | (xi, _) => error_var "Term argument expected for " xi);
wenzelm@20336
    71
    val external_insts = term_insts |> map_filter
wenzelm@20336
    72
      (fn (xi, Args.Name s) => SOME (xi, s) | _ => NONE);
wenzelm@20336
    73
wenzelm@20336
    74
wenzelm@20343
    75
    (* mixed type instantiations *)
wenzelm@20336
    76
wenzelm@20336
    77
    fun readT (xi, arg) =
wenzelm@20336
    78
      let
wenzelm@20343
    79
        val S = the_sort tvars xi;
wenzelm@20336
    80
        val T =
wenzelm@20336
    81
          (case arg of
wenzelm@20336
    82
            Args.Name s => ProofContext.read_typ ctxt s
wenzelm@20336
    83
          | Args.Typ T => T
wenzelm@20336
    84
          | _ => error_var "Type argument expected for " xi);
wenzelm@20336
    85
      in
wenzelm@20343
    86
        if Sign.of_sort thy (T, S) then ((xi, S), T)
wenzelm@20336
    87
        else error_var "Incompatible sort for typ instantiation of " xi
wenzelm@20336
    88
      end;
wenzelm@20336
    89
wenzelm@20343
    90
    val type_insts1 = map readT type_insts;
wenzelm@20343
    91
    val instT1 = Term.instantiateT type_insts1;
wenzelm@20343
    92
    val vars1 = map (apsnd instT1) vars;
wenzelm@20336
    93
wenzelm@20336
    94
wenzelm@20336
    95
    (* internal term instantiations *)
wenzelm@20336
    96
wenzelm@20343
    97
    val instT2 = Envir.norm_type
wenzelm@20343
    98
      (#1 (fold (unify_vartypes thy vars1) internal_insts (Vartab.empty, 0)));
wenzelm@20343
    99
    val vars2 = map (apsnd instT2) vars1;
wenzelm@20343
   100
    val internal_insts2 = map (apsnd (map_term_types instT2)) internal_insts;
wenzelm@20343
   101
    val inst2 = instantiate internal_insts2;
wenzelm@20336
   102
wenzelm@20336
   103
wenzelm@20336
   104
    (* external term instantiations *)
wenzelm@20336
   105
wenzelm@20343
   106
    val (xs, strs) = split_list external_insts;
wenzelm@20343
   107
    val Ts = map (the_type vars2) xs;
wenzelm@20343
   108
    val (ts, inferred) =   (* FIXME polymorphic!? schematic vs. 'for' context!? *)
wenzelm@20343
   109
      ProofContext.read_termTs_schematic ctxt (K false) (K NONE) (K NONE) [] (strs ~~ Ts);
wenzelm@20336
   110
wenzelm@20343
   111
    val instT3 = Term.typ_subst_TVars inferred;
wenzelm@20343
   112
    val vars3 = map (apsnd instT3) vars2;
wenzelm@20343
   113
    val internal_insts3 = map (apsnd (map_term_types instT3)) internal_insts2;
wenzelm@20343
   114
    val external_insts3 = xs ~~ ts;
wenzelm@20343
   115
    val inst3 = instantiate external_insts3;
wenzelm@20336
   116
wenzelm@20336
   117
wenzelm@20343
   118
    (* results *)
wenzelm@20343
   119
wenzelm@20343
   120
    val type_insts3 = map (fn ((a, _), T) => (a, instT3 (instT2 T))) type_insts1;
wenzelm@20343
   121
    val term_insts3 = internal_insts3 @ external_insts3;
wenzelm@20336
   122
wenzelm@20343
   123
    val inst_tvars = map_filter (make_instT (instT3 o instT2 o instT1)) tvars;
wenzelm@20343
   124
    val inst_vars = map_filter (make_inst (inst3 o inst2)) vars3;
wenzelm@20343
   125
  in
wenzelm@20343
   126
    ((type_insts3, term_insts3),
wenzelm@20343
   127
      (map (pairself certT) inst_tvars, map (pairself cert) inst_vars))
wenzelm@20343
   128
  end;
wenzelm@20343
   129
wenzelm@20343
   130
fun read_instantiate ctxt mixed_insts thm =
wenzelm@20343
   131
  let
wenzelm@20487
   132
    val ctxt' = ctxt |> Variable.declare_thm thm
wenzelm@20487
   133
      |> fold (fn a => Variable.declare_internal (Logic.mk_type (TFree (a, [])))) (Drule.add_used thm []);  (* FIXME tmp *)
wenzelm@20343
   134
    val tvars = Drule.fold_terms Term.add_tvars thm [];
wenzelm@20343
   135
    val vars = Drule.fold_terms Term.add_vars thm [];
wenzelm@20343
   136
    val ((type_insts, term_insts), insts) = read_insts ctxt' (map snd mixed_insts) (tvars, vars);
wenzelm@20343
   137
wenzelm@20343
   138
    val _ = (*assign internalized values*)
wenzelm@20336
   139
      mixed_insts |> List.app (fn (arg, (xi, _)) =>
wenzelm@20336
   140
        if is_tvar xi then
wenzelm@20343
   141
          Args.assign (SOME (Args.Typ (the (AList.lookup (op =) type_insts xi)))) arg
wenzelm@20336
   142
        else
wenzelm@20343
   143
          Args.assign (SOME (Args.Term (the (AList.lookup (op =) term_insts xi)))) arg);
wenzelm@20343
   144
  in
wenzelm@20343
   145
    Drule.instantiate insts thm |> RuleCases.save thm
wenzelm@20343
   146
  end;
wenzelm@20336
   147
wenzelm@20343
   148
fun read_instantiate' ctxt (args, concl_args) thm =
wenzelm@20343
   149
  let
wenzelm@20343
   150
    fun zip_vars _ [] = []
wenzelm@20343
   151
      | zip_vars (_ :: xs) ((_, NONE) :: rest) = zip_vars xs rest
wenzelm@20343
   152
      | zip_vars ((x, _) :: xs) ((arg, SOME t) :: rest) = (arg, (x, t)) :: zip_vars xs rest
wenzelm@20343
   153
      | zip_vars [] _ = error "More instantiations than variables in theorem";
wenzelm@20343
   154
    val insts =
wenzelm@20343
   155
      zip_vars (rev (Term.add_vars (Thm.full_prop_of thm) [])) args @
wenzelm@20343
   156
      zip_vars (rev (Term.add_vars (Thm.concl_of thm) [])) concl_args;
wenzelm@20343
   157
  in read_instantiate ctxt insts thm end;
wenzelm@20336
   158
wenzelm@20336
   159
end;
wenzelm@20336
   160
wenzelm@20336
   161
wenzelm@20343
   162
wenzelm@20343
   163
(** attributes **)
wenzelm@20343
   164
wenzelm@20336
   165
(* where: named instantiation *)
wenzelm@20336
   166
wenzelm@20336
   167
local
wenzelm@20336
   168
wenzelm@20336
   169
val value =
wenzelm@20336
   170
  Args.internal_typ >> Args.Typ ||
wenzelm@20336
   171
  Args.internal_term >> Args.Term ||
wenzelm@20336
   172
  Args.name >> Args.Name;
wenzelm@20336
   173
wenzelm@20336
   174
val inst = Args.var -- (Args.$$$ "=" |-- Args.ahead -- value)
wenzelm@20336
   175
  >> (fn (xi, (a, v)) => (a, (xi, v)));
wenzelm@20336
   176
wenzelm@20336
   177
in
wenzelm@20336
   178
wenzelm@20343
   179
val where_att = Attrib.syntax (Args.and_list (Scan.lift inst) >> (fn args =>
wenzelm@20343
   180
  Thm.rule_attribute (fn context => read_instantiate (Context.proof_of context) args)));
wenzelm@20336
   181
wenzelm@20336
   182
end;
wenzelm@20336
   183
wenzelm@20336
   184
wenzelm@20343
   185
(* of: positional instantiation (terms only) *)
wenzelm@20336
   186
wenzelm@20336
   187
local
wenzelm@20336
   188
wenzelm@20336
   189
val value =
wenzelm@20336
   190
  Args.internal_term >> Args.Term ||
wenzelm@20336
   191
  Args.name >> Args.Name;
wenzelm@20336
   192
wenzelm@20336
   193
val inst = Args.ahead -- Args.maybe value;
wenzelm@20336
   194
val concl = Args.$$$ "concl" -- Args.colon;
wenzelm@20336
   195
wenzelm@20336
   196
val insts =
wenzelm@20336
   197
  Scan.repeat (Scan.unless concl inst) --
wenzelm@20336
   198
  Scan.optional (concl |-- Scan.repeat inst) [];
wenzelm@20336
   199
wenzelm@20336
   200
in
wenzelm@20336
   201
wenzelm@20343
   202
val of_att = Attrib.syntax (Scan.lift insts >> (fn args =>
wenzelm@20343
   203
  Thm.rule_attribute (fn context => read_instantiate' (Context.proof_of context) args)));
wenzelm@20336
   204
wenzelm@20336
   205
end;
wenzelm@20336
   206
wenzelm@20336
   207
wenzelm@20336
   208
(* setup *)
wenzelm@20336
   209
wenzelm@20336
   210
val _ = Context.add_setup (Attrib.add_attributes
wenzelm@20336
   211
 [("where", where_att, "named instantiation of theorem"),
wenzelm@20343
   212
  ("of", of_att, "positional instantiation of theorem")]);
wenzelm@20336
   213
wenzelm@20336
   214
wenzelm@20336
   215
wenzelm@20336
   216
(** methods **)
wenzelm@20336
   217
wenzelm@20336
   218
(* rule_tac etc. -- refer to dynamic goal state!! *)   (* FIXME cleanup!! *)
wenzelm@20336
   219
wenzelm@20336
   220
fun bires_inst_tac bires_flag ctxt insts thm =
wenzelm@20336
   221
  let
wenzelm@20336
   222
    val thy = ProofContext.theory_of ctxt;
wenzelm@20336
   223
    (* Separate type and term insts *)
wenzelm@20336
   224
    fun has_type_var ((x, _), _) = (case Symbol.explode x of
wenzelm@20336
   225
          "'"::cs => true | cs => false);
wenzelm@20336
   226
    val Tinsts = List.filter has_type_var insts;
wenzelm@20336
   227
    val tinsts = filter_out has_type_var insts;
wenzelm@20336
   228
    (* Tactic *)
wenzelm@20336
   229
    fun tac i st =
wenzelm@20336
   230
      let
wenzelm@20336
   231
        (* Preprocess state: extract environment information:
wenzelm@20336
   232
           - variables and their types
wenzelm@20336
   233
           - type variables and their sorts
wenzelm@20336
   234
           - parameters and their types *)
wenzelm@20336
   235
        val (types, sorts) = types_sorts st;
wenzelm@20336
   236
    (* Process type insts: Tinsts_env *)
wenzelm@20336
   237
    fun absent xi = error
wenzelm@20336
   238
          ("No such variable in theorem: " ^ Syntax.string_of_vname xi);
wenzelm@20336
   239
    val (rtypes, rsorts) = types_sorts thm;
wenzelm@20336
   240
    fun readT (xi, s) =
wenzelm@20336
   241
        let val S = case rsorts xi of SOME S => S | NONE => absent xi;
wenzelm@20336
   242
            val T = Sign.read_typ (thy, sorts) s;
wenzelm@20336
   243
            val U = TVar (xi, S);
wenzelm@20336
   244
        in if Sign.typ_instance thy (T, U) then (U, T)
wenzelm@20336
   245
           else error
wenzelm@20336
   246
             ("Instantiation of " ^ Syntax.string_of_vname xi ^ " fails")
wenzelm@20336
   247
        end;
wenzelm@20336
   248
    val Tinsts_env = map readT Tinsts;
wenzelm@20336
   249
    (* Preprocess rule: extract vars and their types, apply Tinsts *)
wenzelm@20336
   250
    fun get_typ xi =
wenzelm@20336
   251
      (case rtypes xi of
wenzelm@20336
   252
           SOME T => typ_subst_atomic Tinsts_env T
wenzelm@20336
   253
         | NONE => absent xi);
wenzelm@20336
   254
    val (xis, ss) = Library.split_list tinsts;
wenzelm@20336
   255
    val Ts = map get_typ xis;
wenzelm@20336
   256
        val (_, _, Bi, _) = dest_state(st,i)
wenzelm@20336
   257
        val params = Logic.strip_params Bi
wenzelm@20336
   258
                             (* params of subgoal i as string typ pairs *)
wenzelm@20336
   259
        val params = rev(Term.rename_wrt_term Bi params)
wenzelm@20336
   260
                           (* as they are printed: bound variables with *)
wenzelm@20336
   261
                           (* the same name are renamed during printing *)
wenzelm@20336
   262
        fun types' (a, ~1) = (case AList.lookup (op =) params a of
wenzelm@20336
   263
                NONE => types (a, ~1)
wenzelm@20336
   264
              | some => some)
wenzelm@20336
   265
          | types' xi = types xi;
wenzelm@20336
   266
        fun internal x = is_some (types' (x, ~1));
wenzelm@20336
   267
        val used = Drule.add_used thm (Drule.add_used st []);
wenzelm@20336
   268
        val (ts, envT) =
wenzelm@20336
   269
          ProofContext.read_termTs_schematic ctxt internal types' sorts used (ss ~~ Ts);
wenzelm@20336
   270
        val envT' = map (fn (ixn, T) =>
wenzelm@20336
   271
          (TVar (ixn, the (rsorts ixn)), T)) envT @ Tinsts_env;
wenzelm@20336
   272
        val cenv =
wenzelm@20336
   273
          map
wenzelm@20336
   274
            (fn (xi, t) =>
wenzelm@20336
   275
              pairself (Thm.cterm_of thy) (Var (xi, fastype_of t), t))
wenzelm@20336
   276
            (distinct
wenzelm@20336
   277
              (fn ((x1, t1), (x2, t2)) => x1 = x2 andalso t1 aconv t2)
wenzelm@20336
   278
              (xis ~~ ts));
wenzelm@20336
   279
        (* Lift and instantiate rule *)
wenzelm@20336
   280
        val {maxidx, ...} = rep_thm st;
wenzelm@20336
   281
        val paramTs = map #2 params
wenzelm@20336
   282
        and inc = maxidx+1
wenzelm@20336
   283
        fun liftvar (Var ((a,j), T)) =
wenzelm@20336
   284
              Var((a, j+inc), paramTs ---> Logic.incr_tvar inc T)
wenzelm@20336
   285
          | liftvar t = raise TERM("Variable expected", [t]);
wenzelm@20336
   286
        fun liftterm t = list_abs_free
wenzelm@20336
   287
              (params, Logic.incr_indexes(paramTs,inc) t)
wenzelm@20336
   288
        fun liftpair (cv,ct) =
wenzelm@20336
   289
              (cterm_fun liftvar cv, cterm_fun liftterm ct)
wenzelm@20336
   290
        val lifttvar = pairself (ctyp_of thy o Logic.incr_tvar inc);
wenzelm@20336
   291
        val rule = Drule.instantiate
wenzelm@20336
   292
              (map lifttvar envT', map liftpair cenv)
wenzelm@20336
   293
              (Thm.lift_rule (Thm.cprem_of st i) thm)
wenzelm@20336
   294
      in
wenzelm@20336
   295
        if i > nprems_of st then no_tac st
wenzelm@20336
   296
        else st |>
wenzelm@20336
   297
          compose_tac (bires_flag, rule, nprems_of thm) i
wenzelm@20336
   298
      end
wenzelm@20336
   299
           handle TERM (msg,_)   => (warning msg; no_tac st)
wenzelm@20336
   300
                | THM  (msg,_,_) => (warning msg; no_tac st);
wenzelm@20336
   301
  in tac end;
wenzelm@20336
   302
wenzelm@20336
   303
local
wenzelm@20336
   304
wenzelm@20336
   305
fun gen_inst _ tac _ (quant, ([], thms)) =
wenzelm@20336
   306
      Method.METHOD (fn facts => quant (Method.insert_tac facts THEN' tac thms))
wenzelm@20336
   307
  | gen_inst inst_tac _ ctxt (quant, (insts, [thm])) =
wenzelm@20336
   308
      Method.METHOD (fn facts =>
wenzelm@20336
   309
        quant (Method.insert_tac facts THEN' inst_tac ctxt insts thm))
wenzelm@20336
   310
  | gen_inst _ _ _ _ = error "Cannot have instantiations with multiple rules";
wenzelm@20336
   311
wenzelm@20336
   312
in
wenzelm@20336
   313
wenzelm@20336
   314
val res_inst_meth = gen_inst (bires_inst_tac false) Tactic.resolve_tac;
wenzelm@20336
   315
wenzelm@20336
   316
val eres_inst_meth = gen_inst (bires_inst_tac true) Tactic.eresolve_tac;
wenzelm@20336
   317
wenzelm@20336
   318
val cut_inst_meth =
wenzelm@20336
   319
  gen_inst
wenzelm@20336
   320
    (fn ctxt => fn insts => bires_inst_tac false ctxt insts o Tactic.make_elim_preserve)
wenzelm@20336
   321
    Tactic.cut_rules_tac;
wenzelm@20336
   322
wenzelm@20336
   323
val dres_inst_meth =
wenzelm@20336
   324
  gen_inst
wenzelm@20336
   325
    (fn ctxt => fn insts => bires_inst_tac true ctxt insts o Tactic.make_elim_preserve)
wenzelm@20336
   326
    Tactic.dresolve_tac;
wenzelm@20336
   327
wenzelm@20336
   328
val forw_inst_meth =
wenzelm@20336
   329
  gen_inst
wenzelm@20336
   330
    (fn ctxt => fn insts => fn rule =>
wenzelm@20336
   331
       bires_inst_tac false ctxt insts (Tactic.make_elim_preserve rule) THEN'
wenzelm@20336
   332
       assume_tac)
wenzelm@20336
   333
    Tactic.forward_tac;
wenzelm@20336
   334
wenzelm@20336
   335
fun subgoal_tac ctxt sprop =
wenzelm@20336
   336
  DETERM o bires_inst_tac false ctxt [(("psi", 0), sprop)] cut_rl;
wenzelm@20336
   337
wenzelm@20336
   338
fun subgoals_tac ctxt sprops = EVERY' (map (subgoal_tac ctxt) sprops);
wenzelm@20336
   339
wenzelm@20336
   340
fun thin_tac ctxt s =
wenzelm@20336
   341
  bires_inst_tac true ctxt [(("V", 0), s)] thin_rl;
wenzelm@20336
   342
wenzelm@20336
   343
wenzelm@20336
   344
(* method syntax *)
wenzelm@20336
   345
wenzelm@20336
   346
val insts =
wenzelm@20336
   347
  Scan.optional
wenzelm@20336
   348
    (Args.enum1 "and" (Scan.lift (Args.name -- (Args.$$$ "=" |-- Args.!!! Args.name))) --|
wenzelm@20336
   349
      Scan.lift (Args.$$$ "in")) [] -- Attrib.thms;
wenzelm@20336
   350
wenzelm@20336
   351
fun inst_args f src ctxt =
wenzelm@20336
   352
  f ctxt (#2 (Method.syntax (Args.goal_spec HEADGOAL -- insts) src ctxt));
wenzelm@20336
   353
wenzelm@20336
   354
val insts_var =
wenzelm@20336
   355
  Scan.optional
wenzelm@20336
   356
    (Args.enum1 "and" (Scan.lift (Args.var -- (Args.$$$ "=" |-- Args.!!! Args.name))) --|
wenzelm@20336
   357
      Scan.lift (Args.$$$ "in")) [] -- Attrib.thms;
wenzelm@20336
   358
wenzelm@20336
   359
fun inst_args_var f src ctxt =
wenzelm@20336
   360
  f ctxt (#2 (Method.syntax (Args.goal_spec HEADGOAL -- insts_var) src ctxt));
wenzelm@20336
   361
wenzelm@20336
   362
wenzelm@20336
   363
(* setup *)
wenzelm@20336
   364
wenzelm@20336
   365
val _ = Context.add_setup (Method.add_methods
wenzelm@20336
   366
 [("rule_tac", inst_args_var res_inst_meth,
wenzelm@20336
   367
    "apply rule (dynamic instantiation)"),
wenzelm@20336
   368
  ("erule_tac", inst_args_var eres_inst_meth,
wenzelm@20336
   369
    "apply rule in elimination manner (dynamic instantiation)"),
wenzelm@20336
   370
  ("drule_tac", inst_args_var dres_inst_meth,
wenzelm@20336
   371
    "apply rule in destruct manner (dynamic instantiation)"),
wenzelm@20336
   372
  ("frule_tac", inst_args_var forw_inst_meth,
wenzelm@20336
   373
    "apply rule in forward manner (dynamic instantiation)"),
wenzelm@20336
   374
  ("cut_tac", inst_args_var cut_inst_meth,
wenzelm@20336
   375
    "cut rule (dynamic instantiation)"),
wenzelm@20336
   376
  ("subgoal_tac", Method.goal_args_ctxt (Scan.repeat1 Args.name) subgoals_tac,
wenzelm@20336
   377
    "insert subgoal (dynamic instantiation)"),
wenzelm@20336
   378
  ("thin_tac", Method.goal_args_ctxt Args.name thin_tac,
wenzelm@20336
   379
    "remove premise (dynamic instantiation)")]);
wenzelm@20336
   380
wenzelm@20336
   381
end;
wenzelm@20336
   382
wenzelm@20336
   383
end;