src/HOL/Library/Countable.thy
changeset 65411 3c628937899d
parent 63040 eb4ddd18d635
child 66453 cc19f7ca2ed6
equal deleted inserted replaced
65394:faeccede9534 65411:3c628937899d
   174         val typedef_thm = #type_definition (snd typedef_info)
   174         val typedef_thm = #type_definition (snd typedef_info)
   175         val pred_name =
   175         val pred_name =
   176           (case HOLogic.dest_Trueprop (Thm.concl_of typedef_thm) of
   176           (case HOLogic.dest_Trueprop (Thm.concl_of typedef_thm) of
   177             (_ $ _ $ _ $ (_ $ Const (n, _))) => n
   177             (_ $ _ $ _ $ (_ $ Const (n, _))) => n
   178           | _ => raise Match)
   178           | _ => raise Match)
   179         val induct_info = Inductive.the_inductive ctxt pred_name
   179         val induct_info = Inductive.the_inductive_global ctxt pred_name
   180         val pred_names = #names (fst induct_info)
   180         val pred_names = #names (fst induct_info)
   181         val induct_thms = #inducts (snd induct_info)
   181         val induct_thms = #inducts (snd induct_info)
   182         val alist = pred_names ~~ induct_thms
   182         val alist = pred_names ~~ induct_thms
   183         val induct_thm = the (AList.lookup (op =) alist pred_name)
   183         val induct_thm = the (AList.lookup (op =) alist pred_name)
   184         val vars = rev (Term.add_vars (Thm.prop_of induct_thm) [])
   184         val vars = rev (Term.add_vars (Thm.prop_of induct_thm) [])