src/HOL/Tools/datatype_package.ML
changeset 25888 48cc198b9ac5
parent 25677 8b2ddc6e7be1
child 26093 51e8d37b4e7b
equal deleted inserted replaced
25887:5dcc3c257922 25888:48cc198b9ac5
   723 
   723 
   724     fun err t = error ("Ill-formed predicate in induction rule: " ^
   724     fun err t = error ("Ill-formed predicate in induction rule: " ^
   725       Sign.string_of_term thy1 t);
   725       Sign.string_of_term thy1 t);
   726 
   726 
   727     fun get_typ (t as _ $ Var (_, Type (tname, Ts))) =
   727     fun get_typ (t as _ $ Var (_, Type (tname, Ts))) =
   728           ((tname, map dest_TFree Ts) handle TERM _ => err t)
   728           ((tname, map (fst o dest_TFree) Ts) handle TERM _ => err t)
   729       | get_typ t = err t;
   729       | get_typ t = err t;
   730 
   730 
   731     val dtnames = map get_typ (HOLogic.dest_conj (HOLogic.dest_Trueprop (Thm.concl_of induction')));
   731     val dtnames = map get_typ (HOLogic.dest_conj (HOLogic.dest_Trueprop (Thm.concl_of induction')));
   732     val new_type_names = getOpt (alt_names, map fst dtnames);
   732     val new_type_names = getOpt (alt_names, map fst dtnames);
   733 
   733