src/HOL/Tools/recfun_codegen.ML
changeset 31957 a9742afd403e
parent 31156 90fed3d4430f
child 31958 2133f596c520
equal deleted inserted replaced
31956:c3844c4d0c2c 31957:a9742afd403e
    27   | add_thm (SOME module_name) thm thy =
    27   | add_thm (SOME module_name) thm thy =
    28       let
    28       let
    29         val (thm', _) = Code.mk_eqn thy (K false) (thm, true)
    29         val (thm', _) = Code.mk_eqn thy (K false) (thm, true)
    30       in
    30       in
    31         thy
    31         thy
    32         |> ModuleData.map (Symtab.update (Code.const_eqn thy thm', module_name))
    32         |> ModuleData.map (Symtab.update (fst (Code.const_typ_eqn thy thm'), module_name))
    33         |> Code.add_eqn thm'
    33         |> Code.add_eqn thm'
    34       end;
    34       end;
    35 
    35 
    36 fun meta_eq_to_obj_eq thy thm =
    36 fun meta_eq_to_obj_eq thy thm =
    37   let
    37   let
    42   end;
    42   end;
    43 
    43 
    44 fun expand_eta thy [] = []
    44 fun expand_eta thy [] = []
    45   | expand_eta thy (thms as thm :: _) =
    45   | expand_eta thy (thms as thm :: _) =
    46       let
    46       let
    47         val (_, ty) = Code.const_typ_eqn thm;
    47         val (_, ty) = Code.const_typ_eqn thy thm;
    48       in if null (Term.add_tvarsT ty []) orelse (null o fst o strip_type) ty
    48       in if null (Term.add_tvarsT ty []) orelse (null o fst o strip_type) ty
    49         then thms
    49         then thms
    50         else map (Code.expand_eta thy 1) thms
    50         else map (Code.expand_eta thy 1) thms
    51       end;
    51       end;
    52 
    52