src/HOL/Tools/induct_method.ML
changeset 10728 13cb6d29f7ff
parent 10542 92cd56dfc17e
child 10803 bdc3aa1c193b
equal deleted inserted replaced
10727:2ccafccb81c0 10728:13cb6d29f7ff
     8 
     8 
     9 signature INDUCT_METHOD =
     9 signature INDUCT_METHOD =
    10 sig
    10 sig
    11   val vars_of: term -> term list
    11   val vars_of: term -> term list
    12   val concls_of: thm -> term list
    12   val concls_of: thm -> term list
       
    13   val rewrite_cterm: thm list -> cterm -> cterm
    13   val simp_case_tac: bool -> simpset -> int -> tactic
    14   val simp_case_tac: bool -> simpset -> int -> tactic
    14   val setup: (theory -> theory) list
    15   val setup: (theory -> theory) list
    15 end;
    16 end;
    16 
    17 
    17 structure InductMethod: INDUCT_METHOD =
    18 structure InductMethod: INDUCT_METHOD =
    69       | prep_var (_, None) = None;
    70       | prep_var (_, None) = None;
    70   in
    71   in
    71     align "Rule has fewer variables than instantiations given" (vars_of tm) ts
    72     align "Rule has fewer variables than instantiations given" (vars_of tm) ts
    72     |> mapfilter prep_var
    73     |> mapfilter prep_var
    73   end;
    74   end;
       
    75 
       
    76 fun rewrite_cterm rews =
       
    77   #2 o Thm.dest_comb o #prop o Thm.crep_thm o Simplifier.full_rewrite (HOL_basic_ss addsimps rews);
    74 
    78 
    75 
    79 
    76 (* simplifying cases rules *)
    80 (* simplifying cases rules *)
    77 
    81 
    78 local
    82 local
   197   <x:A> induct ...     - set induction
   201   <x:A> induct ...     - set induction
   198   ...   induct ... R   - explicit rule
   202   ...   induct ... R   - explicit rule
   199 *)
   203 *)
   200 
   204 
   201 local
   205 local
   202 
       
   203 fun rewrite_cterm rews =
       
   204   #2 o Thm.dest_comb o #prop o Thm.crep_thm o Simplifier.full_rewrite (HOL_basic_ss addsimps rews);
       
   205 
   206 
   206 fun drop_Trueprop ct =
   207 fun drop_Trueprop ct =
   207   let
   208   let
   208     fun drop (Abs (x, T, t)) = Abs (x, T, drop t)
   209     fun drop (Abs (x, T, t)) = Abs (x, T, drop t)
   209       | drop t = HOLogic.dest_Trueprop t;
   210       | drop t = HOLogic.dest_Trueprop t;