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§
- Rendered
Solution - 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_termrendering: 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