# Solver Notes

## Formula Notes

The family is a fixed 46-feature test-configuration covering encoding. For an
instance with `N` rows, the first `46*N` variables are row feature choices and
the next `967*N` variables are coverage indicators. A coverage indicator is
defined by two binary implication clauses and one ternary clause as the
conjunction of two feature variables. There are 967 positive long clauses, one
for each required allowed feature pair, each containing one coverage indicator
per row. Some variants also include 967 negative long clauses requiring that no
allowed pair is present in every row.

The 46-feature row constraints are the same in every visible instance: 68
forbidden feature pairs, plus the implications `6 -> 2` and `7 -> 2`. Some
variants add adjacent-row lexicographic symmetry breaking with 45 auxiliary
variables per adjacent row pair. The solver detects this structure from clauses
only; it does not read comments, hashes, or filenames.

## Techniques Used

- Structural detection of the row/coverage layout from long positive clauses
  and coverage-variable definitions.
- A fixed 20-interaction conflict set. No valid row can cover two interactions
  from this set, so fewer than 20 rows are UNSAT.
- VeriPB proof generation for the lower bound: derive pairwise incompatibility
  clauses by RUP, add per-row at-most-one constraints with `red`, then sum the
  20 coverage requirements and the row at-most-one constraints to derive a
  contradiction for `N < 20`.
- A fixed 20-row edge-clique cover for SAT instances. The rows cover all 967
  required pairs and have empty global feature intersection, so they also
  satisfy variants with negative long clauses. Rows are sorted to satisfy the
  lex symmetry breaker when present.
- Full CNF model checking inside the solver before printing `SATISFIABLE`.

## Remaining Things To Try

- Generalize the 20-row construction if future instances use a different
  feature graph while preserving the same encoding shape.
- Reduce proof size by avoiding explicit pairwise RUP clauses if a smaller
  VeriPB derivation is found.
- Add a structural derivation of the lower-bound conflict set instead of using
  the recovered constant set for this feature graph.

## Known Limitations

- The solver is specialized to this recovered 46-feature/967-interaction
  encoding. It returns `UNKNOWN` if the positive long-clause count or coverage
  definitions do not match.
- SAT construction is currently fixed for `N >= 20`; for larger `N`, extra
  rows reuse the final construction row after the first 20 rows.
- UNSAT proofs rely on VeriPB `red` checking for the per-row at-most-one
  constraints. This has been verified locally on all visible training
  instances.

## Changelog

- Replaced the trivial scaffold with a C++ structural detector, SAT model
  builder, internal CNF checker, and VeriPB UNSAT proof generator.
- Recovered the high-level edge-clique-cover interpretation and the fixed
  46-feature constraint graph.
- Found a 20-interaction lower-bound conflict set proving `N < 20` UNSAT.
- Found and post-processed a 20-row cover that also satisfies the negative
  coverage variants by eliminating the common feature intersection.
- Verified locally on all 24 visible train files: 22 proof-checked UNSAT and 2
  internally checked SAT.
