equal
deleted
inserted
replaced
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); |