equal
deleted
inserted
replaced
155 fun define_abs_type gen_code quot_thm lthy = |
155 fun define_abs_type gen_code quot_thm lthy = |
156 if gen_code andalso Lifting_Def.can_generate_code_cert quot_thm then |
156 if gen_code andalso Lifting_Def.can_generate_code_cert quot_thm then |
157 let |
157 let |
158 val abs_type_thm = quot_thm RS @{thm Quotient_abs_rep} |
158 val abs_type_thm = quot_thm RS @{thm Quotient_abs_rep} |
159 val add_abstype_attribute = |
159 val add_abstype_attribute = |
160 Thm.declaration_attribute (fn thm => Context.mapping (Code.add_abstype thm) I) |
160 Thm.declaration_attribute (fn thm => Context.mapping (Code.add_abstype_default thm) I) |
161 val add_abstype_attrib = Attrib.internal (K add_abstype_attribute) |
161 val add_abstype_attrib = Attrib.internal (K add_abstype_attribute) |
162 in |
162 in |
163 lthy |
163 lthy |
164 |> (snd oo Local_Theory.note) ((Binding.empty, [add_abstype_attrib]), [abs_type_thm]) |
164 |> (snd oo Local_Theory.note) ((Binding.empty, [add_abstype_attrib]), [abs_type_thm]) |
165 end |
165 end |