Expand description
Shared human-readable rendering for Nibli.
ONE place that turns the engine’s internal representations into English for the two surfaces humans read to verify the engine:
render_logic_buffer— the Transparency Triad back-translation: compiles aLogicBuffer(the FOL IR) into structure-exposing English.humanize_fact/render_proof/render_proof_text— readable proof traces, sharing the same fact humanizer and term rendering.
Rendering is pure: it reads LogicBuffer/ProofTrace and never mutates a
verdict or a proof’s tree shape. Unknown predicates fall back to a generic
relation(args) / gloss-based frame — never invented English.
Structs§
- Domain
Gloss - A domain-term overlay for one curated example. The tables are tiny (a handful of entries each), so a linear scan is fine.
- Rendered
Node - A rendered proof node: everything the text and component renderers need, computed once. Children are rendered recursively.
Enums§
- Register
- Controls how structure-exposing the rendered English is.
Statics§
- DRUG_
INTERACTIONS_ OVERLAY - Drug-interaction case study (
drug-interactions.nibli, book Ch 20). - GDPR_
OVERLAY - GDPR compliance case study (
gdpr.nibli, book Ch 19). - UTOPIA_
OVERLAY - Utopia constitutional provocation (
utopia.nibli).
Functions§
- collapse_
proof - Collapse a verbose proof trace into a macro-logical DAG (a
RenderedNodetree). Render-only; the trace is unchanged. - collapse_
proof_ with - As
collapse_proof, rendering under a domain-glossoverlay(None= the dictionary-fallback default). - css_
class - CSS class for color-coding in the UI proof tree.
- fact_
to_ english - Translate one humanized/raw fact string to an English clause via the place
frames.
Nonewhen it cannot be rendered (caller falls back to functional). - humanize_
fact - Humanize a single flat fact-display string into readable notation.
- icon
- Unicode icon for a proof rule type.
- label
- Human-readable label describing the proof step (UI component form).
- render_
collapsed_ text - The collapsed macro-logical-DAG proof of a whole trace as indented text (the
REPL / server / book view): the closed-world NAF caveat (when the verdict
rests on it), then the collapsed tree. With
include_detail = falsethe role-level clusters are omitted (the clean macro view). One call every text surface shares — nibli-host, nibli-server, nibli-wasm. - render_
collapsed_ text_ with - As
render_collapsed_text, rendering under a domain-glossoverlay(None= the dictionary-fallback default). - render_
logic_ buffer - Render a compiled
LogicBufferas readable English. - render_
logic_ tree - Render a compiled
LogicBufferas an indented, one-node-per-line structural tree with functional term notation — the[Logic]half of:debug. - render_
node_ text - Render any
RenderedNodetree as indented text (the building block ofrender_collapsed_text). Withinclude_detail = false,proof-role-detailclusters are skipped (the clean macro view); withtrue, they render too. - render_
proof - Build the structured rendered proof tree from a wire proof trace.
- render_
proof_ text - Render the proof tree as indented text (REPL/CLI), with the NAF note header.
- render_
proof_ text_ indented - As
render_proof_text, with a base indentation (nibli-host indents by one). - summarize_
proof - Build a one-block plain-English “why” explanation of the trace, or
Noneif there is nothing summarizable (callers then print nothing extra). - summarize_
proof_ with - As
summarize_proof, but renders under a domain-glossoverlay(curated examples read in real domain terms;None= the dictionary-fallback default). - trace_
display - Compact textual rendering used in CLI proof traces (
… -> TRUE).