Skip to main content

Module explain

Module explain 

Source
Expand description

Stable textual explain output for a (hypergraph, eligibility, variable order) triple.

The format is deterministic and intended for snapshot tests in PR 1, debugging in PR 2+, and a CLI subcommand later. The format is not a stable API for downstream tools yet — keep consumers inside the workspace.

Format:

rule head=<predicate>
  vertices: [<v0> <v1> ...]
  hyperedges:
    <predicate>(<arg0>, <arg1>, ...)
    ...
  filters: <comparison_count>
  eligibility: <Eligible | Ineligible>
    <boundary> ...
  variable-order(<name>): [<v0> <v1> ...]

where each <arg> is either ?<varname> for a variable position or _ for a constant / anonymous wildcard. Vertices and the variable-order line use names rather than VertexIds so the output is stable across construction-order changes that don’t change the source rule.

Functions§

explain
Render a stable textual explanation of hg plus its eligibility verdict and a variable order computed via vo. Pure: no IO, no hidden state.