equal
deleted
inserted
replaced
278 val arity as (t, Ss, c) = Logic.dest_arity prop handle TERM _ => err (); |
278 val arity as (t, Ss, c) = Logic.dest_arity prop handle TERM _ => err (); |
279 |
279 |
280 val binding = |
280 val binding = |
281 Binding.concealed (Binding.name (prefix arity_prefix (Logic.name_arity arity))); |
281 Binding.concealed (Binding.name (prefix arity_prefix (Logic.name_arity arity))); |
282 |
282 |
283 val args = Name.invent_types_global Ss; |
283 val args = map TFree (Name.invent_types_global Ss); |
284 val missing_params = |
284 val missing_params = |
285 Sign.complete_sort thy [c] |
285 Sign.complete_sort thy [c] |
286 |> maps (these o Option.map #params o try (get_info thy)) |
286 |> maps (these o Option.map #params o try (get_info thy)) |
287 |> filter_out (fn (const, _) => can (get_inst_param thy) (const, t)) |
287 |> filter_out (fn (const, _) => can (get_inst_param thy) (const, t)) |
288 |> (map o apsnd o map_atyps) (K (Type (t, map TFree args))); |
288 |> (map o apsnd o map_atyps) (K (Type (t, args))); |
289 in |
289 in |
290 thy |
290 thy |
291 |> Global_Theory.store_thm (binding, th) |
291 |> Global_Theory.store_thm (binding, th) |
292 |-> Thm.add_arity |
292 |-> Thm.add_arity |
293 |> fold (#2 oo declare_overloaded) missing_params |
293 |> fold (#2 oo declare_overloaded) missing_params |