# Solver Notes

## Formula Notes

- The target is the `subsumptiontest` family. Training formulas are high-width
  CNFs with no auxiliary-looking low-width encoding: most clauses have width
  8, 9, 10, or 11 and polarities are almost exactly balanced.
- A robust structural invariant is recovered without comments or filenames:
  assigning each variable to the polarity that satisfies its majority literal
  occurrences leaves exactly `nvars` clauses falsified on every training
  instance. These majority-falsified clauses are used as the main high-level
  signal.
- SAT instances are very close to the majority assignment and are solved
  quickly by flipping variables in falsified clauses. UNSAT instances become
  easy for CDCL when decisions use the opposite of the majority phase, while
  variable activity is seeded by occurrence in the majority-falsified clauses.

## Techniques Used

- DIMACS parsing and independent model checking before printing SAT.
- Specialized high-width WalkSAT-style local search seeded from the majority
  assignment. It maintains satisfied-literal counts and flips a variable from a
  currently falsified clause with low break count.
- A from-scratch watched-literal CDCL fallback. It uses 1-UIP learning, VSIDS
  activity, structural activity seeding from the majority-falsified clauses,
  and opposite-majority branching. Learned clauses and the final contradiction
  are emitted as VeriPB `rup` proof steps.
- Local-search time is width-aware: short budgets for width 8/9, moderate for
  width 10, and longer for width 11, matching observed SAT difficulty while
  avoiding wasted time on UNSAT cases.

## Remaining Things To Try

- Add learned-clause minimization to reduce proof size further.
- Replace the CDCL fallback with a direct high-level proof if the exact
  subsumption/diversity generator is recovered.
- Tune local-search budgets on any larger hidden split if SAT width-10 or
  width-11 instances need more time.

## Known Limitations

- The UNSAT proof is still a CDCL/RUP proof, not a compact analytic proof of
  the recovered high-level object.
- The detector is conservative but family-specific: formulas without the
  majority-falsified-clause structure may still run through CDCL rather than
  immediately returning UNKNOWN.
- No existing SAT, SMT, PB, MIP, or CP-SAT solver is bundled or invoked.

## Changelog

- Initial scaffold replaced with a C++ solver.
- Added DIMACS parsing, model verification, and SAT model printing.
- Added majority-assignment structure recovery and local search for SAT cases.
- Added watched-literal CDCL with VeriPB RUP proof emission for UNSAT cases.
- Added structural activity seeding from majority-falsified clauses.
- Changed CDCL decision phase to branch opposite the majority assignment,
  reducing UNSAT conflicts dramatically on training instances.
- Added width-aware local-search budgets.
- Updated metadata and build notes before broker submission.
