Skip to main content

Module render

Module render 

Source
Expand description

Solution rendering: the v1 wire contract, byte-compatible.

JSON is hand-rolled (no serde in the runtime — binary size) but must match serde_json’s output for the value shapes v1 produced: object keys in sorted order (serde_json’s default BTreeMap), the same string escaping, and {"functor":...,"args":[...]} sorting to {"args":...,"functor":...} exactly as v1 emitted it.

Structs§

RenderedSolution
One captured solution: bindings sorted by variable name (v1 rule), rendered immediately (terms are undone by backtracking afterwards).

Functions§

capture_solution
Capture the current solution from the machine’s query variables.
format_term
v1’s format_term rendering: plain functional notation (no infix), atoms unquoted, vars _<idx>, lists [a, b|T]. This is the byte contract for error messages (“Runtime error: error(…)”).
json_escape
serde_json-compatible string escaping.
term_to_json
term_to_string