equal
deleted
inserted
replaced
496 val ([t'], _) = Variable.import_terms true [t] ctxt; |
496 val ([t'], _) = Variable.import_terms true [t] ctxt; |
497 in pretty_term ctxt t' end; |
497 in pretty_term ctxt t' end; |
498 |
498 |
499 fun pretty_abbrev ctxt s = |
499 fun pretty_abbrev ctxt s = |
500 let |
500 let |
501 val t = Syntax.parse_term ctxt s |> singleton (Proof_Context.standard_infer_types ctxt); |
501 val t = Syntax.read_term (Proof_Context.set_mode Proof_Context.mode_abbrev ctxt) s; |
502 fun err () = error ("Abbreviated constant expected: " ^ Syntax.string_of_term ctxt t); |
502 fun err () = error ("Abbreviated constant expected: " ^ Syntax.string_of_term ctxt t); |
503 val (head, args) = Term.strip_comb t; |
503 val (head, args) = Term.strip_comb t; |
504 val (c, T) = Term.dest_Const head handle TERM _ => err (); |
504 val (c, T) = Term.dest_Const head handle TERM _ => err (); |
505 val (U, u) = Consts.the_abbreviation (Proof_Context.consts_of ctxt) c |
505 val (U, u) = Consts.the_abbreviation (Proof_Context.consts_of ctxt) c |
506 handle TYPE _ => err (); |
506 handle TYPE _ => err (); |