43 val str_list: string -> string -> string list -> T |
43 val str_list: string -> string -> string list -> T |
44 val big_list: string -> T list -> T |
44 val big_list: string -> T list -> T |
45 val chunks: T list -> T |
45 val chunks: T list -> T |
46 val indent: int -> T -> T |
46 val indent: int -> T -> T |
47 val string_of: T -> string |
47 val string_of: T -> string |
|
48 val output: T -> string |
48 val writeln: T -> unit |
49 val writeln: T -> unit |
49 val writelns: T list -> unit |
50 val writelns: T list -> unit |
50 val str_of: T -> string |
51 val str_of: T -> string |
51 val pprint: T -> pprint_args -> unit |
52 val pprint: T -> pprint_args -> unit |
52 val setdepth: int -> unit |
53 val setdepth: int -> unit |
53 val setmargin: int -> unit |
54 val setmargin: int -> unit |
54 val setmp_margin: int -> ('a -> 'b) -> 'a -> 'b |
55 val setmp_margin: int -> ('a -> 'b) -> 'a -> 'b |
55 type pp |
56 type pp |
56 val pp: (term -> T) * (typ -> T) * (sort -> T) * (class list -> T) * (arity -> T) -> pp |
57 val pp: (term -> T) * (typ -> T) * (sort -> T) * (class list -> T) * (arity -> T) -> pp |
57 val pp_undef: pp |
|
58 val term: pp -> term -> T |
58 val term: pp -> term -> T |
59 val typ: pp -> typ -> T |
59 val typ: pp -> typ -> T |
60 val sort: pp -> sort -> T |
60 val sort: pp -> sort -> T |
61 val classrel: pp -> class list -> T |
61 val classrel: pp -> class list -> T |
62 val arity: pp -> arity -> T |
62 val arity: pp -> arity -> T |
238 else str "..." |
238 else str "..." |
239 | pruning dp e = e; |
239 | pruning dp e = e; |
240 |
240 |
241 fun prune dp e = if dp > 0 then pruning dp e else e; |
241 fun prune dp e = if dp > 0 then pruning dp e else e; |
242 |
242 |
243 fun string_of e = |
243 fun output e = |
244 Buffer.content (#tx (format ([prune (! depth) e], (Buffer.empty, 0), 0) empty)) |
244 Buffer.content (#tx (format ([prune (! depth) e], (Buffer.empty, 0), 0) empty)); |
245 |> Output.raw; |
245 |
246 |
246 val string_of = Output.raw o output; |
247 val writeln = writeln o string_of; |
247 val writeln = writeln o string_of; |
248 fun writelns [] = () | writelns es = writeln (chunks es); |
248 fun writelns [] = () | writelns es = writeln (chunks es); |
249 |
249 |
250 |
250 |
251 (*Create a single flat string: no line breaking*) |
251 (*Create a single flat string: no line breaking*) |
291 val string_of_typ = string_of oo typ; |
291 val string_of_typ = string_of oo typ; |
292 val string_of_sort = string_of oo sort; |
292 val string_of_sort = string_of oo sort; |
293 val string_of_classrel = string_of oo classrel; |
293 val string_of_classrel = string_of oo classrel; |
294 val string_of_arity = string_of oo arity; |
294 val string_of_arity = string_of oo arity; |
295 |
295 |
296 fun undef kind _ = str ("*** UNABLE TO PRINT " ^ kind ^ " ***"); |
|
297 val pp_undef = |
|
298 pp (undef "term", undef "typ", undef "sort", undef "classrel", undef "arity"); |
|
299 |
|
300 end; |
296 end; |