Expand description
TLC’s value printing.
to_tlc_string ports the toString methods of tlc2.value.impl (tlaplus
94d0c50), including which lazy sets TLC expands when printing:
SUBSET Swhen|S| < 7;[S -> T],[a : S]andS \X Twhen they have fewer than 2000 elements (TLCGlobals.enumBound);- filters and maps always;
- intervals never (
1..3, or{}when empty).
print_value adds TLC’s pretty-printer (ppr, a port of tlc2.pprint), as
Print, PrintT, error messages and counterexample states use it.
Constants§
- WIDTH
- TLC’s default width (
tlc2.value.Values.width, 80).
Functions§
- escape_
string StringValue.PrintVersion: escapes",\, tab, newline, form feed and carriage return.- format_
state - A state as TLC prints it in a counterexample (
TLCStateMut.toString): one/\ x = valueline per variable, orx = valuewhen there is a single variable. Each value is pretty-printed on its own, at width 80. - ppr
Values.ppr(String): pretty-prints a value’stoStringform at widthWIDTH.- ppr_
width PrettyPrint.mypp(value, width): returnsvalueunchanged when it does not parse.- print_
error_ value - Fallible
Values.ppr(v.toString())for an argument diagnostic. - print_
value - What
Print/PrintTprint for a value:Values.ppr(v.toStringUnchecked()). - to_
tlc_ string Value.toStringUnchecked(): the single-line form, with errors raised while deciding how to print a lazy set propagated (as inPrintandToString).- to_
tlc_ string_ lenient Value.toString(): liketo_tlc_string, but errors raised while deciding whether to expand a lazy set are swallowed (the set is printed in its lazy form), as TLC does when building error messages. Never fails; an unprintable value prints as a placeholder naming its kind.