68 fun applys (x_ths, atts) = foldl_map (Library.apply atts) x_ths; |
69 fun applys (x_ths, atts) = foldl_map (Library.apply atts) x_ths; |
69 |
70 |
70 |
71 |
71 (* display tagged theorems *) |
72 (* display tagged theorems *) |
72 |
73 |
|
74 val show_tags = ref false; |
|
75 |
73 fun pretty_tag (name, args) = Pretty.strs (name :: args); |
76 fun pretty_tag (name, args) = Pretty.strs (name :: args); |
74 val pretty_tags = Pretty.list "[" "]" o map pretty_tag; |
77 val pretty_tags = Pretty.list "[" "]" o map pretty_tag; |
75 |
78 |
76 fun pretty_tthm (thm, []) = Pretty.quote (Display.pretty_thm thm) |
79 fun pretty_tthm (thm, tags) = |
77 | pretty_tthm (thm, tags) = Pretty.block |
80 if null tags orelse not (! show_tags) then Pretty.quote (Display.pretty_thm thm) |
78 [Pretty.quote (Display.pretty_thm thm), Pretty.brk 1, pretty_tags tags]; |
81 else Pretty.block [Pretty.quote (Display.pretty_thm thm), Pretty.brk 1, pretty_tags tags]; |
79 |
82 |
80 fun pretty_tthms [th] = pretty_tthm th |
83 fun pretty_tthms [th] = pretty_tthm th |
81 | pretty_tthms ths = Pretty.block (Pretty.fbreaks (map pretty_tthm ths)); |
84 | pretty_tthms ths = Pretty.block (Pretty.fbreaks (map pretty_tthm ths)); |
82 |
85 |
83 val print_tthm = Pretty.writeln o pretty_tthm; |
86 val print_tthm = Pretty.writeln o pretty_tthm; |