159 (case operation lthy b of |
159 (case operation lthy b of |
160 SOME (c, (v, checked)) => |
160 SOME (c, (v, checked)) => |
161 if mx <> NoSyn |
161 if mx <> NoSyn |
162 then error ("Illegal mixfix syntax for overloaded constant " ^ quote c) |
162 then error ("Illegal mixfix syntax for overloaded constant " ^ quote c) |
163 else lthy |> define_overloaded (c, U) (v, checked) (b_def, rhs) |
163 else lthy |> define_overloaded (c, U) (v, checked) (b_def, rhs) |
164 | NONE => lthy |> Generic_Target.theory_foundation (((b, U), mx), (b_def, rhs)) params); |
164 | NONE => lthy |> Generic_Target.theory_target_foundation (((b, U), mx), (b_def, rhs)) params); |
165 |
165 |
166 fun pretty lthy = |
166 fun pretty lthy = |
167 let |
167 let |
168 val overloading = get_overloading lthy; |
168 val overloading = get_overloading lthy; |
169 fun pr_operation ((c, ty), (v, _)) = |
169 fun pr_operation ((c, ty), (v, _)) = |
199 |> fold (fn ((_, ty), (v, _)) => Variable.declare_names (Free (v, ty))) overloading |
199 |> fold (fn ((_, ty), (v, _)) => Variable.declare_names (Free (v, ty))) overloading |
200 |> activate_improvable_syntax |
200 |> activate_improvable_syntax |
201 |> synchronize_syntax |
201 |> synchronize_syntax |
202 |> Local_Theory.init (Sign.naming_of thy) |
202 |> Local_Theory.init (Sign.naming_of thy) |
203 {define = Generic_Target.define foundation, |
203 {define = Generic_Target.define foundation, |
204 notes = Generic_Target.notes Generic_Target.theory_notes, |
204 notes = Generic_Target.notes Generic_Target.theory_target_notes, |
205 abbrev = Generic_Target.abbrev Generic_Target.theory_abbrev, |
205 abbrev = Generic_Target.abbrev Generic_Target.theory_target_abbrev, |
206 declaration = K Generic_Target.theory_declaration, |
206 declaration = K Generic_Target.theory_declaration, |
207 subscription = Generic_Target.theory_registration, |
207 subscription = Generic_Target.theory_registration, |
208 pretty = pretty, |
208 pretty = pretty, |
209 exit = conclude #> Local_Theory.target_of #> Sign.change_end_local} |
209 exit = conclude #> Local_Theory.target_of #> Sign.change_end_local} |
210 end; |
210 end; |