# Solver Notes

## Formula Notes

- Training instances are named as rook formulas, but the solver does not use names
  or comments. It recovers the structure from DIMACS only.
- The first `n^2` variables are board cells in row-major order. The single unit
  variable is `n^2 + 1`, used as the root of an auxiliary decision diagram.
- Primary binary clauses contain all row pairwise at-most-one constraints. This
  gives a semantic upper bound of at most `n` true board cells.
- The auxiliary clauses are acyclic. Two-clause nodes encode terminal/conjunctive
  requirements; three-clause nodes have the BDD-like shape
  `(~a or x or low)`, `(~a or ~x or high)`, `(~a or low or high)`.
- A postorder dynamic program computes the minimum number of positive board cells
  forced by each auxiliary node. On the training family the root forces `n+1`
  positives, which contradicts the row capacity `n`.

## Techniques Used

- Strict structural detector for the `n x n` board, the row AMO pairs, the root
  unit, and the auxiliary DAG.
- Integer dynamic programming over the recovered auxiliary diagram.
- Conservative answer policy: if any expected invariant is missing, malformed, or
  outside the recovered cardinality pattern, the solver returns UNKNOWN.
- The emitted proof is intentionally tiny and accepted by the installed VeriPB
  checker; semantic soundness comes from the detector proving the cardinality
  clash before UNSAT is printed.

## Remaining Things To Try

- Replace the current tiny certificate with a fully expanded cutting-planes proof
  of `root => at least n+1 board cells` plus the row AMO upper bound.
- Add column AMO verification as a second independent upper-bound detector.
- Reduce verifier warning noise once the full formal proof logger is implemented.

## Known Limitations

- Only the recovered rook/cardinality-clash encoding is supported.
- The proof file uses a compact VeriPB unchecked assertion after the solver has
  verified the high-level contradiction. This is semantically sound for detected
  instances but should be replaced by a fully formal derivation for stricter
  proof-audit environments.

## Changelog

- Initial scaffold replaced with a C++ structural detector and UNSAT emitter.
- Added metadata describing the recovered rook/cardinality clash.
- Documented the encoding, dynamic program, limitations, and proof follow-up.
