src/Pure/axclass.ML
changeset 54931 88cf06038e37
parent 54742 7a86358a3c0b
child 55385 169e12bbf9a3
equal deleted inserted replaced
54930:f2ec28292479 54931:88cf06038e37
     9 sig
     9 sig
    10   type info = {def: thm, intro: thm, axioms: thm list, params: (string * typ) list}
    10   type info = {def: thm, intro: thm, axioms: thm list, params: (string * typ) list}
    11   val get_info: theory -> class -> info
    11   val get_info: theory -> class -> info
    12   val class_of_param: theory -> string -> class option
    12   val class_of_param: theory -> string -> class option
    13   val instance_name: string * class -> string
    13   val instance_name: string * class -> string
    14   val thynames_of_arity: theory -> class * string -> string list
    14   val thynames_of_arity: theory -> string * class -> string list
    15   val param_of_inst: theory -> string * string -> string
    15   val param_of_inst: theory -> string * string -> string
    16   val inst_of_param: theory -> string -> (string * string) option
    16   val inst_of_param: theory -> string -> (string * string) option
    17   val unoverload: theory -> thm -> thm
    17   val unoverload: theory -> thm -> thm
    18   val overload: theory -> thm -> thm
    18   val overload: theory -> thm -> thm
    19   val unoverload_conv: theory -> conv
    19   val unoverload_conv: theory -> conv
   214   (case AList.lookup (op =) (Symtab.lookup_list (proven_arities_of thy) a) (c, Ss) of
   214   (case AList.lookup (op =) (Symtab.lookup_list (proven_arities_of thy) a) (c, Ss) of
   215     SOME (thm, _) => Thm.transfer thy thm
   215     SOME (thm, _) => Thm.transfer thy thm
   216   | NONE => error ("Unproven type arity " ^
   216   | NONE => error ("Unproven type arity " ^
   217       Syntax.string_of_arity (Proof_Context.init_global thy) (a, Ss, [c])));
   217       Syntax.string_of_arity (Proof_Context.init_global thy) (a, Ss, [c])));
   218 
   218 
   219 fun thynames_of_arity thy (c, a) =
   219 fun thynames_of_arity thy (a, c) =
   220   Symtab.lookup_list (proven_arities_of thy) a
   220   Symtab.lookup_list (proven_arities_of thy) a
   221   |> map_filter (fn ((c', _), (_, name)) => if c = c' then SOME name else NONE)
   221   |> map_filter (fn ((c', _), (_, name)) => if c = c' then SOME name else NONE)
   222   |> rev;
   222   |> rev;
   223 
   223 
   224 fun insert_arity_completions thy t ((c, Ss), ((th, thy_name))) (finished, arities) =
   224 fun insert_arity_completions thy t ((c, Ss), ((th, thy_name))) (finished, arities) =