src/HOL/Tools/Datatype/datatype_codegen.ML
changeset 51685 385ef6706252
parent 51551 88d1d19fb74f
child 51717 9e7d1c139569
equal deleted inserted replaced
51671:0d142a78fb7c 51685:385ef6706252
    17 (* liberal addition of code data for datatypes *)
    17 (* liberal addition of code data for datatypes *)
    18 
    18 
    19 fun mk_constr_consts thy vs tyco cos =
    19 fun mk_constr_consts thy vs tyco cos =
    20   let
    20   let
    21     val cs = map (fn (c, tys) => (c, tys ---> Type (tyco, map TFree vs))) cos;
    21     val cs = map (fn (c, tys) => (c, tys ---> Type (tyco, map TFree vs))) cos;
    22     val cs' = map (fn c_ty as (_, ty) => (AxClass.unoverload_const thy c_ty, ty)) cs;
    22     val cs' = map (fn c_ty as (_, ty) => (Axclass.unoverload_const thy c_ty, ty)) cs;
    23   in
    23   in
    24     if is_some (try (Code.constrset_of_consts thy) cs')
    24     if is_some (try (Code.constrset_of_consts thy) cs')
    25     then SOME cs
    25     then SOME cs
    26     else NONE
    26     else NONE
    27   end;
    27   end;
    52     thms
    52     thms
    53     |> Conjunction.intr_balanced
    53     |> Conjunction.intr_balanced
    54     |> Raw_Simplifier.rewrite_rule [Thm.symmetric (Thm.assume asm)]
    54     |> Raw_Simplifier.rewrite_rule [Thm.symmetric (Thm.assume asm)]
    55     |> Thm.implies_intr asm
    55     |> Thm.implies_intr asm
    56     |> Thm.generalize ([], params) 0
    56     |> Thm.generalize ([], params) 0
    57     |> AxClass.unoverload thy
    57     |> Axclass.unoverload thy
    58     |> Thm.varifyT_global
    58     |> Thm.varifyT_global
    59   end;
    59   end;
    60 
    60 
    61 
    61 
    62 (* equality *)
    62 (* equality *)