A graded truth value: a degree strictly between false and true.
The degree is never exactly 0.0 or 1.0 — the _Truth.of factory guarantees this invariant by collapsing to _Bool in those cases, so _Truth and _Bool together carry the full [0, 1] interval without overlapping. Construction through of is the only public route; pattern matching _Truth(d) remains available.
In three-valued (Kleene) logic the only reachable degree is 0.5, the named constant _Truth.Unknown, which prints and parses as unknown. The [0, 1] carrier is already in place for the fuzzy tier; degrees other than 0.5 print as plain numbers and do not round-trip through the parser yet (there is no grammar literal for them).
Like _Number, a _Truth never rounds in eval; rounding is a display concern handled by toString / display(p).
Value parameters
d
the truth degree, guaranteed to lie strictly inside (0, 1) by _Truth.of
Renders this truth value at precision decimal places for REPL display.
Renders this truth value at precision decimal places for REPL display.
Both spellings are grammar literals, so the rendering round-trips: unknown parses back to _Truth.Unknown and truth(d) to the same degree. Without the truth(...) form a fuzzy degree would print as a bare number and re-parse as a plain _Number, silently losing its truth-valued nature across a :save/:load.
Value parameters
precision
number of decimal places to show
Attributes
Returns
"unknown" when the rounded degree is 0.5, "truth(d)" otherwise