# Solver Notes

## Formula Notes

- Visible train instance: `p cnf 511 2039`.
- Clause sizes are almost entirely ternary: 1963 ternary clauses and 76 binary clauses.
- Ternary clauses group by the same three absolute variables. Most groups have the classic four-clause encoding of a parity equation over three variables. The false assignments of the clauses all have the same parity, so the allowed assignments satisfy one linear equation over GF(2).
- Some groups have three ternary clauses plus a binary clause on two of the variables. These still expose the same parity equation; the binary clause removes one otherwise allowed parity assignment.
- The visible instance yields 510 parity equations with rank 510 over 511 variables, leaving one free variable. Enumerating that free variable and checking the original CNF finds a SAT model.

## Techniques Used

- Comment-free structural detection: the solver reads only DIMACS clauses and ignores comments and filenames.
- Ternary absolute-variable grouping to recover XOR/parity constraints.
- Sparse GF(2) Gaussian elimination using bit rows.
- Small affine-space enumeration, followed by an independent check of every original CNF clause before printing `SATISFIABLE`.
- SAT-only output. The solver does not claim `UNSATISFIABLE`; unsupported, inconsistent, or too-high-dimensional cases return `UNKNOWN`.

## Remaining Things To Try

- Add a dedicated solver for the residual binary clauses in the recovered affine space if hidden instances have more than 24 free variables.
- Investigate VeriPB proof generation for inconsistent parity systems, if any target instances are truly UNSAT.
- Profile broker results for the hidden 1023-variable training case mentioned in the baseline JSON.

## Known Limitations

- The detector intentionally supports only the binary-tree-parity shape: ternary groups whose forbidden assignments all share one parity.
- The SAT search enumerates at most 24 free GF(2) variables. Larger affine spaces return `UNKNOWN` rather than risking long runtimes.
- No UNSAT proof path is implemented, so inconsistent systems are reported as `UNKNOWN`.

## Changelog

- Initial scaffold: placeholder C++ solver returned `UNKNOWN`.
- 2026-05-07: Replaced the placeholder with a structural parity decoder. Added GF(2) elimination, bounded free-variable enumeration, full CNF model verification, and SAT output.
- 2026-05-07: Updated metadata and notes to document the recovered XOR/tree-parity structure and solver limits.
