746 fun add_def (s, (vs, ((t, u), (prf, _)))) thy = |
746 fun add_def (s, (vs, ((t, u), (prf, _)))) thy = |
747 (case Sign.const_type (sign_of thy) (extr_name s vs) of |
747 (case Sign.const_type (sign_of thy) (extr_name s vs) of |
748 NONE => |
748 NONE => |
749 let |
749 let |
750 val corr_prop = Reconstruct.prop_of prf; |
750 val corr_prop = Reconstruct.prop_of prf; |
751 val ft = fst (Type.freeze_thaw t); |
751 val ft = Type.freeze t; |
752 val fu = fst (Type.freeze_thaw u); |
752 val fu = Type.freeze u; |
753 val thy' = if t = nullt then thy else thy |> |
753 val thy' = if t = nullt then thy else thy |> |
754 Theory.add_consts_i [(extr_name s vs, fastype_of ft, NoSyn)] |> |
754 Theory.add_consts_i [(extr_name s vs, fastype_of ft, NoSyn)] |> |
755 fst o PureThy.add_defs_i false [((extr_name s vs ^ "_def", |
755 fst o PureThy.add_defs_i false [((extr_name s vs ^ "_def", |
756 Logic.mk_equals (head_of (strip_abs_body fu), ft)), [])]; |
756 Logic.mk_equals (head_of (strip_abs_body fu), ft)), [])]; |
757 in |
757 in |