src/HOL/Tools/Lifting/lifting_def_code_dt.ML
changeset 80634 a90ab1ea6458
parent 78095 bc42c074e58f
child 80636 4041e7c8059d
equal deleted inserted replaced
80633:276b07a1b5f5 80634:a90ab1ea6458
   351       |> Local_Theory.end_nested
   351       |> Local_Theory.end_nested
   352 
   352 
   353     (* in order to make the qty qty_isom isomorphism executable we have to define discriminators 
   353     (* in order to make the qty qty_isom isomorphism executable we have to define discriminators 
   354       and selectors for qty_isom *)
   354       and selectors for qty_isom *)
   355     val (rty_name, typs) = dest_Type rty
   355     val (rty_name, typs) = dest_Type rty
   356     val (_, qty_typs) = dest_Type qty
   356     val qty_typs = dest_Type_args qty
   357     val fp = BNF_FP_Def_Sugar.fp_sugar_of lthy3 rty_name
   357     val fp = BNF_FP_Def_Sugar.fp_sugar_of lthy3 rty_name
   358     val fp = if is_some fp then the fp
   358     val fp = if is_some fp then the fp
   359       else error ("code_dt: " ^ quote rty_name ^ " is not a datatype.")
   359       else error ("code_dt: " ^ quote rty_name ^ " is not a datatype.")
   360     val ctr_sugar = fp |> #fp_ctr_sugar |> #ctr_sugar
   360     val ctr_sugar = fp |> #fp_ctr_sugar |> #ctr_sugar
   361     val ctrs = map (Ctr_Sugar.mk_ctr typs) (#ctrs ctr_sugar);
   361     val ctrs = map (Ctr_Sugar.mk_ctr typs) (#ctrs ctr_sugar);