53 val show_tags = Config.get ctxt show_tags; |
53 val show_tags = Config.get ctxt show_tags; |
54 val show_hyps = Config.get ctxt show_hyps; |
54 val show_hyps = Config.get ctxt show_hyps; |
55 |
55 |
56 val th = Thm.strip_shyps raw_th; |
56 val th = Thm.strip_shyps raw_th; |
57 val {hyps, tpairs, prop, ...} = Thm.rep_thm th; |
57 val {hyps, tpairs, prop, ...} = Thm.rep_thm th; |
58 val xshyps = Thm.extra_shyps th; |
58 val hyps' = if show_hyps then hyps else Thm.undeclared_hyps (Context.Proof ctxt) th; |
|
59 val extra_shyps = Thm.extra_shyps th; |
59 val tags = Thm.get_tags th; |
60 val tags = Thm.get_tags th; |
60 |
61 |
61 val q = if quote then Pretty.quote else I; |
62 val q = if quote then Pretty.quote else I; |
62 val prt_term = q o Syntax.pretty_term ctxt; |
63 val prt_term = q o Syntax.pretty_term ctxt; |
63 |
64 |
64 val asms = map Thm.term_of (Assumption.all_assms_of ctxt); |
65 |
65 val hyps' = if show_hyps then hyps else subtract (op aconv) asms hyps; |
66 val hlen = length extra_shyps + length hyps' + length tpairs; |
66 |
|
67 val hlen = length xshyps + length hyps' + length tpairs; |
|
68 val hsymbs = |
67 val hsymbs = |
69 if hlen = 0 then [] |
68 if hlen = 0 then [] |
70 else if show_hyps orelse show_hyps' then |
69 else if show_hyps orelse show_hyps' then |
71 [Pretty.brk 2, Pretty.list "[" "]" |
70 [Pretty.brk 2, Pretty.list "[" "]" |
72 (map (q o Goal_Display.pretty_flexpair ctxt) tpairs @ map prt_term hyps' @ |
71 (map (q o Goal_Display.pretty_flexpair ctxt) tpairs @ map prt_term hyps' @ |
73 map (Syntax.pretty_sort ctxt) xshyps)] |
72 map (Syntax.pretty_sort ctxt) extra_shyps)] |
74 else [Pretty.brk 2, Pretty.str ("[" ^ replicate_string hlen "." ^ "]")]; |
73 else [Pretty.brk 2, Pretty.str ("[" ^ replicate_string hlen "." ^ "]")]; |
75 val tsymbs = |
74 val tsymbs = |
76 if null tags orelse not show_tags then [] |
75 if null tags orelse not show_tags then [] |
77 else [Pretty.brk 1, pretty_tags tags]; |
76 else [Pretty.brk 1, pretty_tags tags]; |
78 in Pretty.block (prt_term prop :: (hsymbs @ tsymbs)) end; |
77 in Pretty.block (prt_term prop :: (hsymbs @ tsymbs)) end; |