src/Pure/Isar/proof_context.ML
changeset 20008 8d9d770e1f06
parent 19916 3bbb9cc5d4f1
child 20012 b62836400a33
equal deleted inserted replaced
20007:8f9e6255108e 20008:8d9d770e1f06
   878 
   878 
   879 fun add_abbrevs prmode = fold (fn ((raw_c, raw_mx), raw_t) => fn ctxt =>
   879 fun add_abbrevs prmode = fold (fn ((raw_c, raw_mx), raw_t) => fn ctxt =>
   880   let
   880   let
   881     val ([(c, _, mx)], _) = cert_vars [(raw_c, NONE, raw_mx)] ctxt;
   881     val ([(c, _, mx)], _) = cert_vars [(raw_c, NONE, raw_mx)] ctxt;
   882     val c' = Syntax.constN ^ full_name ctxt c;
   882     val c' = Syntax.constN ^ full_name ctxt c;
   883     val [t] = Variable.polymorphic ctxt [cert_term (ctxt |> expand_abbrevs false) raw_t];
   883     val t0 = cert_term (ctxt |> expand_abbrevs false) raw_t;
       
   884     val [t] = Variable.exportT_terms (Variable.declare_term t0 ctxt) ctxt [t0];
   884     val T = Term.fastype_of t;
   885     val T = Term.fastype_of t;
   885     val _ =
   886     val _ =
   886       if null (Variable.hidden_polymorphism t T) then ()
   887       if null (Variable.hidden_polymorphism t T) then ()
   887       else error ("Extra type variables on rhs of abbreviation: " ^ quote c);
   888       else error ("Extra type variables on rhs of abbreviation: " ^ quote c);
   888   in
   889   in