# Solver Notes

## Formula Notes

The target family is a register-allocation graph-coloring encoding.  The
formulas seen in the train split have:

- `n * k` variables partitioned by the positive domain clauses.  Each domain
  clause has exactly `k` positive literals and means "this object receives one
  of the k registers/colors".
- All other clauses are binary negative clauses.  A complete high-level
  interference edge between two objects appears as the `k` clauses
  `~x[u,c] OR ~x[v,c]`, one per register/color.
- Train parameters observed: `k` in 11..15 and 16..63 high-level objects.
  Every train instance contains a clique of size `k + 1`, proving that `k`
  registers are insufficient.

The solver does not use DIMACS comments, names, hashes, or file order beyond
the actual clause/variable structure.

## Techniques Used

- Parse the sanitized CNF and conservatively detect the domain-plus-negative
  binary register-allocation shape.
- Recover the high-level interference graph by grouping binary nogoods that
  forbid the same color on two objects.
- Search the recovered graph for a clique of size `k + 1`.
- Emit a VeriPB proof using only RUP steps.  The proof recursively derives Hall
  clauses for prefixes of the clique: for any color subset `C`, `|C| + 1`
  clique vertices cannot all use only colors from `C`.  The full-color Hall
  clause is the empty contradiction.

## Remaining Things To Try

- Replace some recursive Hall RUP clauses with shorter cutting-planes
  derivations if prover time becomes the bottleneck on larger `k`.
- Improve clique search with bitset branch-and-bound if hidden instances have
  many more high-level objects and sparse interference graphs.
- Add support for partial register domains or non-uniform color encodings if a
  later split includes them.

## Known Limitations

- The solver intentionally returns `UNKNOWN` unless variables are exactly
  partitioned by uniform positive domain clauses and every non-domain clause is
  a same-color negative binary nogood.
- It proves UNSAT only through a recovered `(k + 1)` clique.  Other unsat graph
  coloring reasons are not currently handled.
- The recursive Hall proof is polynomial in the observed `k` but grows roughly
  as `k * 2^k`; the observed `k=15` proof verified locally in 387 seconds and
  was about 113 MB.

## Changelog

- Initial scaffold: placeholder UNKNOWN solver.
- Added structural CNF parser, register-allocation detector, high-level graph
  recovery, clique search, recursive Hall VeriPB proof generation, and solver
  metadata.
- Locally verified all 16 train instances with `veripb --cnf`; every generated
  proof checked successfully.
