src/Pure/axclass.ML
changeset 81512 c1aa8a61ee65
parent 81507 08574da77b4a
equal deleted inserted replaced
81511:8cbc8bc6f382 81512:c1aa8a61ee65
   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