equal
deleted
inserted
replaced
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 |