src/Pure/sign.ML
changeset 26631 d6b6c74a8bcf
parent 26268 80aaf4d034be
child 26637 0bfccafc52eb
equal deleted inserted replaced
26630:3074b3de4f4f 26631:d6b6c74a8bcf
   659         val (c, mx) = Syntax.const_mixfix raw_c raw_mx;
   659         val (c, mx) = Syntax.const_mixfix raw_c raw_mx;
   660         val full_c = full_name thy c;
   660         val full_c = full_name thy c;
   661         val c' = if authentic then Syntax.constN ^ full_c else c;
   661         val c' = if authentic then Syntax.constN ^ full_c else c;
   662         val T = (prepT raw_T handle TYPE (msg, _, _) => error msg) handle ERROR msg =>
   662         val T = (prepT raw_T handle TYPE (msg, _, _) => error msg) handle ERROR msg =>
   663           cat_error msg ("in declaration of constant " ^ quote c);
   663           cat_error msg ("in declaration of constant " ^ quote c);
   664         val T' = Compress.typ thy (Logic.varifyT T);
   664         val T' = Logic.varifyT T;
   665       in ((c, T'), (c', T', mx), Const (full_c, T)) end;
   665       in ((c, T'), (c', T', mx), Const (full_c, T)) end;
   666     val args = map prep raw_args;
   666     val args = map prep raw_args;
   667   in
   667   in
   668     thy
   668     thy
   669     |> map_consts (fold (Consts.declare authentic (naming_of thy) tags o #1) args)
   669     |> map_consts (fold (Consts.declare authentic (naming_of thy) tags o #1) args)
   684 (* abbreviations *)
   684 (* abbreviations *)
   685 
   685 
   686 fun add_abbrev mode tags (c, raw_t) thy =
   686 fun add_abbrev mode tags (c, raw_t) thy =
   687   let
   687   let
   688     val pp = pp thy;
   688     val pp = pp thy;
   689     val prep_tm = Compress.term thy o no_frees pp o Term.no_dummy_patterns o cert_term_abbrev thy;
   689     val prep_tm = no_frees pp o Term.no_dummy_patterns o cert_term_abbrev thy;
   690     val t = (prep_tm raw_t handle TYPE (msg, _, _) => error msg | TERM (msg, _) => error msg)
   690     val t = (prep_tm raw_t handle TYPE (msg, _, _) => error msg | TERM (msg, _) => error msg)
   691       handle ERROR msg => cat_error msg ("in constant abbreviation " ^ quote c);
   691       handle ERROR msg => cat_error msg ("in constant abbreviation " ^ quote c);
   692     val (res, consts') = consts_of thy
   692     val (res, consts') = consts_of thy
   693       |> Consts.abbreviate pp (tsig_of thy) (naming_of thy) mode tags (c, t);
   693       |> Consts.abbreviate pp (tsig_of thy) (naming_of thy) mode tags (c, t);
   694   in (res, thy |> map_consts (K consts')) end;
   694   in (res, thy |> map_consts (K consts')) end;