src/Provers/induct_method.ML
author wenzelm
Tue Jun 14 21:56:57 2005 +0200 (2005-06-14)
changeset 16391 65c8070844ea
parent 15794 5de27a5fc5ed
child 17961 6ebd59acf58a
permissions -rw-r--r--
export cases_tac, induct_tac;
wenzelm@11670
     1
(*  Title:      Provers/induct_method.ML
wenzelm@11670
     2
    ID:         $Id$
wenzelm@11670
     3
    Author:     Markus Wenzel, TU Muenchen
wenzelm@11670
     4
wenzelm@11735
     5
Proof by cases and induction on sets and types.
wenzelm@11670
     6
*)
wenzelm@11670
     7
wenzelm@11670
     8
signature INDUCT_METHOD_DATA =
wenzelm@11670
     9
sig
wenzelm@11670
    10
  val dest_concls: term -> term list
wenzelm@11670
    11
  val cases_default: thm
wenzelm@11996
    12
  val local_impI: thm
wenzelm@11670
    13
  val conjI: thm
wenzelm@11670
    14
  val atomize: thm list
wenzelm@11670
    15
  val rulify1: thm list
wenzelm@11670
    16
  val rulify2: thm list
wenzelm@12240
    17
  val localize: thm list
wenzelm@11670
    18
end;
wenzelm@11670
    19
wenzelm@11670
    20
signature INDUCT_METHOD =
wenzelm@11670
    21
sig
wenzelm@16391
    22
  val cases_tac: Proof.context -> bool -> term option list list -> thm option ->
wenzelm@16391
    23
    thm list -> int -> RuleCases.tactic
wenzelm@16391
    24
  val induct_tac: Proof.context -> bool -> term option list list ->
wenzelm@16391
    25
    thm option -> thm list -> int -> RuleCases.tactic
wenzelm@11670
    26
  val setup: (theory -> theory) list
wenzelm@11670
    27
end;
wenzelm@11670
    28
wenzelm@11670
    29
functor InductMethodFun(Data: INDUCT_METHOD_DATA): INDUCT_METHOD =
wenzelm@11670
    30
struct
wenzelm@11670
    31
wenzelm@11670
    32
wenzelm@11670
    33
(** misc utils **)
wenzelm@11670
    34
wenzelm@11670
    35
(* align lists *)
wenzelm@11670
    36
wenzelm@11670
    37
fun align_left msg xs ys =
wenzelm@11670
    38
  let val m = length xs and n = length ys
wenzelm@11735
    39
  in if m < n then raise ERROR_MESSAGE msg else (Library.take (n, xs) ~~ ys) end;
wenzelm@11670
    40
wenzelm@11670
    41
fun align_right msg xs ys =
wenzelm@11670
    42
  let val m = length xs and n = length ys
wenzelm@11735
    43
  in if m < n then raise ERROR_MESSAGE msg else (Library.drop (m - n, xs) ~~ ys) end;
wenzelm@11670
    44
wenzelm@11670
    45
wenzelm@11735
    46
(* prep_inst *)
wenzelm@11670
    47
wenzelm@11735
    48
fun prep_inst align cert tune (tm, ts) =
wenzelm@11670
    49
  let
skalberg@15531
    50
    fun prep_var (x, SOME t) =
wenzelm@11670
    51
          let
wenzelm@11670
    52
            val cx = cert x;
wenzelm@11670
    53
            val {T = xT, sign, ...} = Thm.rep_cterm cx;
wenzelm@12799
    54
            val ct = cert (tune t);
wenzelm@11670
    55
          in
skalberg@15531
    56
            if Sign.typ_instance sign (#T (Thm.rep_cterm ct), xT) then SOME (cx, ct)
wenzelm@11735
    57
            else raise ERROR_MESSAGE (Pretty.string_of (Pretty.block
wenzelm@11735
    58
             [Pretty.str "Ill-typed instantiation:", Pretty.fbrk,
wenzelm@11735
    59
              Display.pretty_cterm ct, Pretty.str " ::", Pretty.brk 1,
wenzelm@11735
    60
              Display.pretty_ctyp (#T (Thm.crep_cterm ct))]))
wenzelm@11670
    61
          end
skalberg@15531
    62
      | prep_var (_, NONE) = NONE;
wenzelm@11735
    63
    val xs = InductAttrib.vars_of tm;
wenzelm@11670
    64
  in
wenzelm@11735
    65
    align "Rule has fewer variables than instantiations given" xs ts
skalberg@15570
    66
    |> List.mapPartial prep_var
wenzelm@11670
    67
  end;
wenzelm@11670
    68
wenzelm@11670
    69
wenzelm@11670
    70
wenzelm@11670
    71
(** cases method **)
wenzelm@11670
    72
wenzelm@11670
    73
(*
wenzelm@11735
    74
  rule selection scheme:
wenzelm@11735
    75
          cases         - classical case split
wenzelm@11735
    76
    <x:A> cases ...     - set cases
wenzelm@11735
    77
          cases t       - type cases
wenzelm@11735
    78
    ...   cases ... R   - explicit rule
wenzelm@11670
    79
*)
wenzelm@11670
    80
wenzelm@11670
    81
local
wenzelm@11670
    82
wenzelm@11790
    83
fun resolveq_cases_tac make ruleq i st =
wenzelm@11790
    84
  ruleq |> Seq.map (fn (rule, (cases, facts)) =>
wenzelm@11790
    85
    (Method.insert_tac facts THEN' Tactic.rtac rule) i st
wenzelm@12799
    86
    |> Seq.map (rpair (make (Thm.sign_of_thm rule, Thm.prop_of rule) cases)))
wenzelm@11790
    87
  |> Seq.flat;
wenzelm@11790
    88
skalberg@15531
    89
fun find_casesT ctxt ((SOME t :: _) :: _) = InductAttrib.find_casesT ctxt (fastype_of t)
wenzelm@11735
    90
  | find_casesT _ _ = [];
wenzelm@11735
    91
wenzelm@11735
    92
fun find_casesS ctxt (fact :: _) = InductAttrib.find_casesS ctxt fact
wenzelm@11735
    93
  | find_casesS _ _ = [];
wenzelm@11735
    94
wenzelm@16391
    95
in
wenzelm@16391
    96
wenzelm@16391
    97
fun cases_tac ctxt is_open insts opt_rule facts =
wenzelm@11670
    98
  let
wenzelm@11670
    99
    val sg = ProofContext.sign_of ctxt;
wenzelm@11670
   100
    val cert = Thm.cterm_of sg;
wenzelm@11670
   101
wenzelm@11735
   102
    fun inst_rule r =
wenzelm@11735
   103
      if null insts then RuleCases.add r
wenzelm@11735
   104
      else (align_left "Rule has fewer premises than arguments given" (Thm.prems_of r) insts
skalberg@15570
   105
        |> (List.concat o map (prep_inst align_left cert I))
wenzelm@11735
   106
        |> Drule.cterm_instantiate) r |> rpair (RuleCases.get r);
wenzelm@11670
   107
wenzelm@11735
   108
    val ruleq =
wenzelm@12852
   109
      (case opt_rule of
skalberg@15531
   110
        NONE =>
wenzelm@12852
   111
          let val rules = find_casesS ctxt facts @ find_casesT ctxt insts @ [Data.cases_default] in
wenzelm@12053
   112
            Method.trace ctxt rules;
wenzelm@11735
   113
            Seq.flat (Seq.map (Seq.try inst_rule) (Seq.of_list rules))
wenzelm@11670
   114
          end
skalberg@15531
   115
      | SOME r => Seq.single (inst_rule r));
wenzelm@11670
   116
skalberg@15570
   117
    fun prep_rule (th, (cases, n)) = Seq.map (apsnd (rpair (Library.drop (n, facts))) o rpair cases)
skalberg@15570
   118
      (Method.multi_resolves (Library.take (n, facts)) [th]);
skalberg@15531
   119
  in resolveq_cases_tac (RuleCases.make is_open NONE) (Seq.flat (Seq.map prep_rule ruleq)) end;
wenzelm@11670
   120
wenzelm@16391
   121
val cases_meth = Method.METHOD_CASES o ((Seq.DETERM o HEADGOAL) oo
wenzelm@16391
   122
  (fn (ctxt, (is_open, (insts, opt_rule))) => cases_tac ctxt is_open insts opt_rule));
wenzelm@11670
   123
wenzelm@11670
   124
end;
wenzelm@11670
   125
wenzelm@11670
   126
wenzelm@11670
   127
wenzelm@11670
   128
(** induct method **)
wenzelm@11670
   129
wenzelm@11670
   130
(*
wenzelm@11735
   131
  rule selection scheme:
wenzelm@11735
   132
    <x:A> induct ...     - set induction
wenzelm@11735
   133
          induct x       - type induction
wenzelm@11735
   134
    ...   induct ... R   - explicit rule
wenzelm@11670
   135
*)
wenzelm@11670
   136
wenzelm@11670
   137
local
wenzelm@11670
   138
wenzelm@11790
   139
wenzelm@11790
   140
(* atomize and rulify *)
wenzelm@11790
   141
wenzelm@12799
   142
fun atomize_term sg =
berghofe@13197
   143
  ObjectLogic.drop_judgment sg o MetaSimplifier.rewrite_term sg Data.atomize [];
wenzelm@12799
   144
wenzelm@12799
   145
fun rulified_term thm =
wenzelm@12799
   146
  let val sg = Thm.sign_of_thm thm in
wenzelm@12799
   147
    Thm.prop_of thm
berghofe@13197
   148
    |> MetaSimplifier.rewrite_term sg Data.rulify1 []
berghofe@13197
   149
    |> MetaSimplifier.rewrite_term sg Data.rulify2 []
wenzelm@12799
   150
    |> pair sg
wenzelm@12799
   151
  end;
wenzelm@11756
   152
wenzelm@11670
   153
val atomize_tac = Tactic.rewrite_goal_tac Data.atomize;
wenzelm@11670
   154
wenzelm@11670
   155
val rulify_tac =
wenzelm@11670
   156
  Tactic.rewrite_goal_tac Data.rulify1 THEN'
wenzelm@11670
   157
  Tactic.rewrite_goal_tac Data.rulify2 THEN'
wenzelm@11670
   158
  Tactic.norm_hhf_tac;
wenzelm@11670
   159
wenzelm@12799
   160
val localize = Tactic.norm_hhf_rule o Tactic.simplify false Data.localize;
wenzelm@12162
   161
wenzelm@11670
   162
wenzelm@11996
   163
(* imp_intr --- limited to atomic prems *)
wenzelm@11996
   164
wenzelm@11996
   165
fun imp_intr i raw_th =
wenzelm@11996
   166
  let
wenzelm@11996
   167
    val th = Thm.permute_prems (i - 1) 1 raw_th;
wenzelm@11996
   168
    val cprems = Drule.cprems_of th;
skalberg@15570
   169
    val As = Library.take (length cprems - 1, cprems);
wenzelm@11996
   170
    val C = Thm.cterm_of (Thm.sign_of_thm th) (Var (("C", #maxidx (Thm.rep_thm th) + 1), propT));
wenzelm@11996
   171
    val dummy_st = Drule.mk_triv_goal (Drule.list_implies (As, C));
wenzelm@11996
   172
  in th COMP Thm.lift_rule (dummy_st, 1) Data.local_impI end;
wenzelm@11996
   173
wenzelm@11996
   174
wenzelm@11790
   175
(* join multi-rules *)
wenzelm@11790
   176
wenzelm@11735
   177
val eq_prems = curry (Term.aconvs o pairself Thm.prems_of);
wenzelm@11670
   178
wenzelm@11735
   179
fun join_rules [] = []
wenzelm@11735
   180
  | join_rules [th] = [th]
wenzelm@11735
   181
  | join_rules (rules as r :: rs) =
wenzelm@11735
   182
      if not (forall (eq_prems r) rs) then []
wenzelm@11735
   183
      else
wenzelm@11735
   184
        let
wenzelm@11735
   185
          val th :: ths = map Drule.freeze_all rules;
wenzelm@11735
   186
          val cprems = Drule.cprems_of th;
wenzelm@11735
   187
          val asms = map Thm.assume cprems;
wenzelm@11735
   188
        in
wenzelm@11735
   189
          [foldr1 (fn (x, x') => [x, x'] MRS Data.conjI)
wenzelm@11735
   190
            (map (fn x => Drule.implies_elim_list x asms) (th :: ths))
wenzelm@11735
   191
          |> Drule.implies_intr_list cprems
wenzelm@12305
   192
          |> Drule.standard'
wenzelm@13425
   193
          |> RuleCases.save r]
wenzelm@11735
   194
        end;
wenzelm@11670
   195
wenzelm@11790
   196
wenzelm@11790
   197
(* divinate rule instantiation (cannot handle pending goal parameters) *)
wenzelm@11790
   198
berghofe@15794
   199
fun dest_env sign (env as Envir.Envir {iTs, ...}) =
wenzelm@11790
   200
  let
berghofe@15794
   201
    val pairs = Envir.alist_of env;
berghofe@15794
   202
    val ts = map (Thm.cterm_of sign o Envir.norm_term env o #2 o #2) pairs;
wenzelm@11790
   203
    val xs = map2 (Thm.cterm_of sign o Var) (map #1 pairs, map (#T o Thm.rep_cterm) ts);
berghofe@15794
   204
    val cert = Thm.ctyp_of sign;
berghofe@15794
   205
  in (map (fn (ixn, (S, T)) => (cert (TVar (ixn, S)), cert T)) (Vartab.dest iTs), xs ~~ ts) end;
wenzelm@11790
   206
wenzelm@11790
   207
fun divinate_inst rule i st =
wenzelm@11790
   208
  let
wenzelm@11790
   209
    val {sign, maxidx, ...} = Thm.rep_thm st;
wenzelm@11790
   210
    val goal = List.nth (Thm.prems_of st, i - 1);  (*exception Subscript*)
wenzelm@11790
   211
    val params = rev (rename_wrt_term goal (Logic.strip_params goal));  (*as they are printed :-*)
wenzelm@11790
   212
  in
wenzelm@11790
   213
    if not (null params) then
wenzelm@11790
   214
      (warning ("Cannot determine rule instantiation due to pending parameter(s): " ^
wenzelm@11790
   215
        commas (map (Sign.string_of_term sign o Syntax.mark_boundT) params));
wenzelm@11790
   216
      Seq.single rule)
wenzelm@11790
   217
    else
wenzelm@11790
   218
      let
wenzelm@11790
   219
        val rule' = Thm.incr_indexes (maxidx + 1) rule;
wenzelm@11790
   220
        val concl = Logic.strip_assums_concl goal;
wenzelm@11790
   221
      in
wenzelm@11790
   222
        Unify.smash_unifiers (sign, Envir.empty (#maxidx (Thm.rep_thm rule')),
wenzelm@11790
   223
          [(Thm.concl_of rule', concl)])
wenzelm@12162
   224
        |> Seq.map (fn env => Drule.instantiate (dest_env sign env) rule')
wenzelm@11790
   225
      end
wenzelm@11790
   226
  end handle Subscript => Seq.empty;
wenzelm@11790
   227
wenzelm@11790
   228
wenzelm@11790
   229
(* compose tactics with cases *)
wenzelm@11790
   230
wenzelm@11996
   231
fun internalize k th = if k > 0 then internalize (k - 1) (imp_intr k th) else th;
wenzelm@11996
   232
nipkow@13597
   233
fun resolveq_cases_tac' make is_open ruleq i st =
wenzelm@11996
   234
  ruleq |> Seq.map (fn (rule, (cases, k, more_facts)) => st
wenzelm@11996
   235
    |> (Method.insert_tac more_facts THEN' atomize_tac) i
wenzelm@11996
   236
    |> Seq.map (fn st' => divinate_inst (internalize k rule) i st' |> Seq.map (fn rule' =>
wenzelm@12799
   237
          st' |> Tactic.rtac rule' i
skalberg@15531
   238
          |> Seq.map (rpair (make is_open (SOME (Thm.prop_of rule')) (rulified_term rule') cases)))
wenzelm@12799
   239
      |> Seq.flat)
wenzelm@11790
   240
    |> Seq.flat)
nipkow@14404
   241
  |> Seq.flat;
wenzelm@11790
   242
wenzelm@11790
   243
infix 1 THEN_ALL_NEW_CASES;
wenzelm@11790
   244
wenzelm@11790
   245
fun (tac1 THEN_ALL_NEW_CASES tac2) i st =
wenzelm@11790
   246
  st |> Seq.THEN (tac1 i, (fn (st', cases) =>
wenzelm@11790
   247
    Seq.map (rpair cases) (Seq.INTERVAL tac2 i (i + nprems_of st' - nprems_of st) st')));
wenzelm@11790
   248
wenzelm@11790
   249
wenzelm@11790
   250
(* find rules *)
wenzelm@11790
   251
nipkow@15235
   252
(* rename all outermost !!-bound vars of type T in all premises of thm to x,
nipkow@15235
   253
   possibly indexed to avoid clashes *)
skalberg@15531
   254
fun rename [[SOME(Free(x,Type(T,_)))]] thm =
nipkow@15235
   255
  let
nipkow@15235
   256
    fun index i [] = []
nipkow@15235
   257
      | index i (y::ys) = if x=y then x^string_of_int i :: index (i+1) ys
nipkow@15235
   258
                          else y :: index i ys;
nipkow@15235
   259
    fun rename_params [] = []
nipkow@15235
   260
      | rename_params ((y,Type(U,_))::ys) =
nipkow@15235
   261
          (if U=T then x else y)::rename_params ys
nipkow@15235
   262
      | rename_params ((y,_)::ys) = y::rename_params ys;
nipkow@15235
   263
    fun rename_asm (A:term):term = 
nipkow@15235
   264
      let val xs = rename_params (Logic.strip_params A)
skalberg@15570
   265
          val xs' = case List.filter (equal x) xs of
nipkow@15235
   266
                      [] => xs | [_] => xs | _ => index 1 xs
nipkow@15235
   267
      in Logic.list_rename_params (xs',A) end;
nipkow@15235
   268
    fun rename_prop (p:term) =
nipkow@15235
   269
      let val (As,C) = Logic.strip_horn p
nipkow@15235
   270
      in Logic.list_implies(map rename_asm As, C) end;
nipkow@15235
   271
    val cp' = cterm_fun rename_prop (cprop_of thm);
nipkow@15235
   272
    val thm' = equal_elim (reflexive cp') thm
nipkow@15235
   273
  in Thm.put_name_tags (Thm.get_name_tags thm) thm' end
nipkow@15235
   274
  | rename _ thm = thm;
nipkow@15235
   275
wenzelm@11735
   276
fun find_inductT ctxt insts =
skalberg@15574
   277
  foldr multiply [[]] (insts |> List.mapPartial (fn [] => NONE | ts => List.last ts)
skalberg@15574
   278
    |> map (InductAttrib.find_inductT ctxt o fastype_of))
skalberg@15570
   279
  |> map join_rules |> List.concat |> map (rename insts);
wenzelm@11670
   280
wenzelm@11735
   281
fun find_inductS ctxt (fact :: _) = InductAttrib.find_inductS ctxt fact
wenzelm@11735
   282
  | find_inductS _ _ = [];
wenzelm@11735
   283
wenzelm@16391
   284
in
wenzelm@11790
   285
wenzelm@11790
   286
(* main tactic *)
wenzelm@11790
   287
wenzelm@16391
   288
fun induct_tac ctxt is_open insts opt_rule facts =
wenzelm@11670
   289
  let
wenzelm@11670
   290
    val sg = ProofContext.sign_of ctxt;
wenzelm@11670
   291
    val cert = Thm.cterm_of sg;
wenzelm@11670
   292
wenzelm@13105
   293
    fun rule_versions r = Seq.cons (r, Seq.filter (not o curry Thm.eq_thm r)
skalberg@15531
   294
        (Seq.make (fn () => SOME (localize r, Seq.empty))))
wenzelm@12168
   295
      |> Seq.map (rpair (RuleCases.get r));
wenzelm@12168
   296
wenzelm@12168
   297
    val inst_rule = apfst (fn r =>
wenzelm@12168
   298
      if null insts then r
wenzelm@11735
   299
      else (align_right "Rule has fewer conclusions than arguments given"
wenzelm@11735
   300
          (Data.dest_concls (Thm.concl_of r)) insts
skalberg@15570
   301
        |> (List.concat o map (prep_inst align_right cert (atomize_term sg)))
wenzelm@12168
   302
        |> Drule.cterm_instantiate) r);
wenzelm@11670
   303
wenzelm@11735
   304
    val ruleq =
wenzelm@11735
   305
      (case opt_rule of
skalberg@15531
   306
        NONE =>
wenzelm@11735
   307
          let val rules = find_inductS ctxt facts @ find_inductT ctxt insts in
wenzelm@12168
   308
            conditional (null rules) (fn () => error "Unable to figure out induct rule");
wenzelm@12053
   309
            Method.trace ctxt rules;
wenzelm@12168
   310
            rules |> Seq.THEN (Seq.of_list, Seq.THEN (rule_versions, Seq.try inst_rule))
wenzelm@11735
   311
          end
skalberg@15531
   312
      | SOME r => r |> Seq.THEN (rule_versions, Seq.single o inst_rule));
wenzelm@11670
   313
wenzelm@11735
   314
    fun prep_rule (th, (cases, n)) =
skalberg@15570
   315
      Seq.map (rpair (cases, n - length facts, Library.drop (n, facts)))
skalberg@15570
   316
        (Method.multi_resolves (Library.take (n, facts)) [th]);
nipkow@13597
   317
    val tac = resolveq_cases_tac' RuleCases.make is_open (Seq.flat (Seq.map prep_rule ruleq));
wenzelm@11670
   318
  in tac THEN_ALL_NEW_CASES rulify_tac end;
wenzelm@11670
   319
wenzelm@16391
   320
val induct_meth = Method.RAW_METHOD_CASES o ((Seq.DETERM o HEADGOAL) oo
wenzelm@16391
   321
  (fn (ctxt, (is_open, (insts, opt_rule))) => induct_tac ctxt is_open insts opt_rule));
wenzelm@11670
   322
wenzelm@11670
   323
end;
wenzelm@11670
   324
wenzelm@11670
   325
wenzelm@11670
   326
wenzelm@11670
   327
(** concrete syntax **)
wenzelm@11670
   328
wenzelm@11670
   329
val openN = "open";
wenzelm@11670
   330
val ruleN = "rule";
wenzelm@11670
   331
val ofN = "of";
wenzelm@11670
   332
wenzelm@11670
   333
local
wenzelm@11670
   334
wenzelm@15703
   335
fun named_rule k arg get =
wenzelm@15703
   336
  Scan.lift (Args.$$$ k -- Args.colon) |-- arg :-- (fn name => Scan.peek (fn ctxt =>
wenzelm@15703
   337
    (case get ctxt name of SOME x => Scan.succeed x
wenzelm@15703
   338
    | NONE => error ("No rule for " ^ k ^ " " ^ quote name)))) >> #2;
wenzelm@11670
   339
wenzelm@11670
   340
fun rule get_type get_set =
wenzelm@15703
   341
  named_rule InductAttrib.typeN Args.local_tyname get_type ||
wenzelm@15703
   342
  named_rule InductAttrib.setN Args.local_const get_set ||
wenzelm@11670
   343
  Scan.lift (Args.$$$ ruleN -- Args.colon) |-- Attrib.local_thm;
wenzelm@11670
   344
wenzelm@11670
   345
val cases_rule = rule InductAttrib.lookup_casesT InductAttrib.lookup_casesS;
wenzelm@11670
   346
val induct_rule = rule InductAttrib.lookup_inductT InductAttrib.lookup_inductS;
wenzelm@11670
   347
wenzelm@11670
   348
val kind_inst =
wenzelm@11670
   349
  (Args.$$$ InductAttrib.typeN || Args.$$$ InductAttrib.setN || Args.$$$ ruleN || Args.$$$ ofN)
wenzelm@11670
   350
    -- Args.colon;
wenzelm@11670
   351
val term = Scan.unless (Scan.lift kind_inst) Args.local_term;
wenzelm@11670
   352
val term_dummy = Scan.unless (Scan.lift kind_inst)
skalberg@15531
   353
  (Scan.lift (Args.$$$ "_") >> K NONE || Args.local_term >> SOME);
wenzelm@11670
   354
wenzelm@13425
   355
val instss = Args.and_list (Scan.repeat term_dummy);
wenzelm@11670
   356
wenzelm@11670
   357
in
wenzelm@11670
   358
wenzelm@11735
   359
val cases_args = Method.syntax (Args.mode openN -- (instss -- Scan.option cases_rule));
wenzelm@11735
   360
val induct_args = Method.syntax (Args.mode openN -- (instss -- Scan.option induct_rule));
wenzelm@11670
   361
wenzelm@11670
   362
end;
wenzelm@11670
   363
wenzelm@11670
   364
wenzelm@11670
   365
wenzelm@11670
   366
(** theory setup **)
wenzelm@11670
   367
wenzelm@11670
   368
val setup =
wenzelm@11670
   369
  [Method.add_methods
wenzelm@11670
   370
    [(InductAttrib.casesN, cases_meth oo cases_args, "case analysis on types or sets"),
wenzelm@11670
   371
     (InductAttrib.inductN, induct_meth oo induct_args, "induction on types or sets")]];
wenzelm@11670
   372
wenzelm@11670
   373
end;
wenzelm@15708
   374