added pretty_tthms, print_tthms;
authorwenzelm
Tue, 17 Nov 1998 14:04:32 +0100
changeset 5901 a8e1ca1b2ec6
parent 5900 258021e27980
child 5902 c39b23d752b6
added pretty_tthms, print_tthms; tuned apply(s);
src/Pure/attribute.ML
--- a/src/Pure/attribute.ML	Tue Nov 17 10:29:28 1998 +0100
+++ b/src/Pure/attribute.ML	Tue Nov 17 14:04:32 1998 +0100
@@ -26,7 +26,9 @@
   val apply: ('a * tthm) * 'a attribute list -> ('a * tthm)
   val applys: ('a * tthm list) * 'a attribute list -> ('a * tthm list)
   val pretty_tthm: tthm -> Pretty.T
+  val pretty_tthms: tthm list -> Pretty.T
   val print_tthm: tthm -> unit
+  val print_tthms: tthm list -> unit
   val tag: tag -> 'a attribute
   val untag: tag -> 'a attribute
   val lemma: tag
@@ -62,15 +64,8 @@
 
 (* apply attributes *)
 
-fun apply (x_th, []) = x_th
-  | apply (x_th, f :: fs) = apply (f x_th, fs);
-
-fun applys ((x, []), _) = (x, [])
-  | applys ((x, th :: ths), atts) =
-      let
-        val (x', th') = apply ((x, th), atts);
-        val (x'', ths') = applys ((x', ths), atts);
-      in (x'', th' :: ths') end;
+fun apply (x_th, atts) = Library.apply atts x_th;
+fun applys (x_ths, atts) = foldl_map (Library.apply atts) x_ths;
 
 
 (* display tagged theorems *)
@@ -82,7 +77,11 @@
   | pretty_tthm (thm, tags) = Pretty.block
       [Pretty.quote (Display.pretty_thm thm), Pretty.brk 1, pretty_tags tags];
 
+fun pretty_tthms [th] = pretty_tthm th
+  | pretty_tthms ths = Pretty.block (Pretty.fbreaks (map pretty_tthm ths));
+
 val print_tthm = Pretty.writeln o pretty_tthm;
+val print_tthms = Pretty.writeln o pretty_tthms;
 
 
 (* basic attributes *)