equal
deleted
inserted
replaced
446 fun pretty_abbrev ctxt t = |
446 fun pretty_abbrev ctxt t = |
447 let |
447 let |
448 fun err () = error ("Abbreviated constant expected: " ^ Syntax.string_of_term ctxt t); |
448 fun err () = error ("Abbreviated constant expected: " ^ Syntax.string_of_term ctxt t); |
449 val (head, args) = Term.strip_comb t; |
449 val (head, args) = Term.strip_comb t; |
450 val (c, T) = Term.dest_Const head handle TERM _ => err (); |
450 val (c, T) = Term.dest_Const head handle TERM _ => err (); |
451 val (U, (u, _)) = Consts.the_abbreviation (ProofContext.consts_of ctxt) c |
451 val (U, u) = Consts.the_abbreviation (ProofContext.consts_of ctxt) c |
452 handle TYPE _ => err (); |
452 handle TYPE _ => err (); |
453 val t' = Term.betapplys (Envir.expand_atom T (U, u), args); |
453 val t' = Term.betapplys (Envir.expand_atom T (U, u), args); |
454 in pretty_term_abbrev ctxt (Logic.mk_equals (t, t')) end; |
454 in pretty_term_abbrev ctxt (Logic.mk_equals (t, t')) end; |
455 |
455 |
456 fun pretty_thm ctxt = pretty_term ctxt o Thm.full_prop_of; |
456 fun pretty_thm ctxt = pretty_term ctxt o Thm.full_prop_of; |