src/Pure/sign.ML
changeset 19462 26d5f3bcc933
parent 19427 f086002893ad
child 19482 9f11af8f7ef9
equal deleted inserted replaced
19461:d3bc9c1ff241 19462:26d5f3bcc933
   150   val string_of_classrel: theory -> class list -> string
   150   val string_of_classrel: theory -> class list -> string
   151   val string_of_arity: theory -> arity -> string
   151   val string_of_arity: theory -> arity -> string
   152   val pprint_term: theory -> term -> pprint_args -> unit
   152   val pprint_term: theory -> term -> pprint_args -> unit
   153   val pprint_typ: theory -> typ -> pprint_args -> unit
   153   val pprint_typ: theory -> typ -> pprint_args -> unit
   154   val pp: theory -> Pretty.pp
   154   val pp: theory -> Pretty.pp
       
   155   val arity_number: theory -> string -> int
       
   156   val arity_sorts: theory -> string -> sort -> sort list
   155   val certify_class: theory -> class -> class
   157   val certify_class: theory -> class -> class
   156   val certify_sort: theory -> sort -> sort
   158   val certify_sort: theory -> sort -> sort
   157   val certify_typ: theory -> typ -> typ
   159   val certify_typ: theory -> typ -> typ
   158   val certify_typ_syntax: theory -> typ -> typ
   160   val certify_typ_syntax: theory -> typ -> typ
   159   val certify_typ_abbrev: theory -> typ -> typ
   161   val certify_typ_abbrev: theory -> typ -> typ
   410 
   412 
   411 (** certify entities **)    (*exception TYPE*)
   413 (** certify entities **)    (*exception TYPE*)
   412 
   414 
   413 (* certify wrt. type signature *)
   415 (* certify wrt. type signature *)
   414 
   416 
       
   417 val arity_number = Type.arity_number o tsig_of;
       
   418 fun arity_sorts thy = Type.arity_sorts (pp thy) (tsig_of thy);
       
   419 
   415 fun certify cert = cert o tsig_of o Context.check_thy;
   420 fun certify cert = cert o tsig_of o Context.check_thy;
   416 
   421 
   417 val certify_class      = certify Type.cert_class;
   422 val certify_class      = certify Type.cert_class;
   418 val certify_sort       = certify Type.cert_sort;
   423 val certify_sort       = certify Type.cert_sort;
   419 val certify_typ        = certify Type.cert_typ;
   424 val certify_typ        = certify Type.cert_typ;
   559 
   564 
   560 
   565 
   561 (* type and constant names *)
   566 (* type and constant names *)
   562 
   567 
   563 fun read_tyname thy raw_c =
   568 fun read_tyname thy raw_c =
   564   let val c = intern_type thy raw_c in
   569   let val c = intern_type thy raw_c
   565     (case Symtab.lookup (#2 (#types (Type.rep_tsig (tsig_of thy)))) c of
   570   in Type (c, replicate (arity_number thy c) dummyT) end;
   566       SOME (Type.LogicalType n, _) => Type (c, replicate n dummyT)
       
   567     | _ => error ("Undeclared type constructor: " ^ quote c))
       
   568   end;
       
   569 
   571 
   570 val read_const = Consts.read_const o consts_of;
   572 val read_const = Consts.read_const o consts_of;
   571 
   573 
   572 
   574 
   573 
   575