src/HOL/datatype.ML
changeset 3111 00fb015d27aa
parent 3105 1a5bfa2ab1d1
child 3197 16b840e02899
equal deleted inserted replaced
3110:dfc1d659f968 3111:00fb015d27aa
   839  let val sign = sign_of thy
   839  let val sign = sign_of thy
   840      fun const s = Const(s, the(Sign.const_type sign s))
   840      fun const s = Const(s, the(Sign.const_type sign s))
   841      val case_rewrites = map (fn c => get_fact thy (ty^"_case_"^c)) cl
   841      val case_rewrites = map (fn c => get_fact thy (ty^"_case_"^c)) cl
   842      val {nchotomy,case_cong} = case_thms sign case_rewrites itac
   842      val {nchotomy,case_cong} = case_thms sign case_rewrites itac
   843      fun induct_tac a i =
   843      fun induct_tac a i =
   844            COND (Datatype.occs_in_prems a i)
   844            STATE(fn st =>
   845              (warning "Induction variable occurs also among premises!";
   845              (if Datatype.occs_in_prems a i st
   846               all_tac) all_tac
   846               then warning "Induction variable occurs also among premises!"
   847            THEN itac a i
   847               else ();
       
   848               itac a i))
   848  in
   849  in
   849   (ty, {constructors = map(fn s => const s handle _ => const("op "^s)) cl,
   850   (ty, {constructors = map(fn s => const s handle _ => const("op "^s)) cl,
   850         case_const = const (ty^"_case"),
   851         case_const = const (ty^"_case"),
   851         case_rewrites = map mk_rw case_rewrites,
   852         case_rewrites = map mk_rw case_rewrites,
   852         induct_tac = induct_tac,
   853         induct_tac = induct_tac,