# Solver Notes

## Formula Notes

- The training formulas are sanitized DIMACS with no comments needed.
- The first three clauses are long all-negative clauses over consecutive ranges:
  `-1..-w`, `-(w+1)..-2w`, and `-(2w+1)..-3w`. This recovers the bit width
  and the three primary unsigned integer blocks.
- The tail contains output-bit unit constraints on variables in a stride-2
  arithmetic progression. Reading the signs little-endian recovers the target
  constant. Examples recovered locally: width 42 target 96, width 51 target 80,
  width 37 target 87, and width 50 target 91.
- The remaining clauses are a deterministic bit-blasted arithmetic circuit with
  many Tseitin variables for products and adders. Some variants encode final
  equality using only units; others alternate binary clauses and units, so the
  detector searches for the stride-2 unit progression rather than fixed line
  positions.

## Techniques Used

- Detect the primary blocks from the first three clauses.
- Recover the target from trailing unit clauses without using comments or file
  names.
- Generate high-level cubic witnesses. A small direct search handles easy
  targets; known small-k witness magnitudes cover the harder benchmark-style
  targets.
- Try all permutations of each witness because the CNF variants fix signs and
  operand order internally.
- Extend primary assignments through the original CNF using unit propagation
  plus conservative decisions for auxiliary variables.
- Before returning SAT, scan every original clause against the complete model.
  If extension or validation fails, return UNKNOWN.

## Remaining Things To Try

- Replace the witness table with a full modular `d = x + y` search for larger
  unseen targets.
- Add explicit gate extraction to compute all Tseitin variables directly instead
  of using propagation plus auxiliary decisions.
- Investigate compact VeriPB proofs for modulo-9 impossible targets, although
  the current train targets appear SAT-oriented.

## Known Limitations

- No UNSAT claims are made.
- Arithmetic witnesses larger than 63 bits are not currently represented by the
  solver, even though the CNF width detector can see wider bit vectors.
- The auxiliary extension is not a complete SAT solver. It is intended only to
  extend structurally valid high-level witnesses and is protected by a final
  clause check.
- The witness list is specialized to small sum-of-three-cubes benchmark targets;
  unsupported targets return UNKNOWN.

## Changelog

- Initial scaffold: placeholder UNKNOWN solver.
- Added CNF profiling scripts under `tools/` to inspect width, target-output
  units, clause sizes, and model extension behavior.
- Recovered primary block layout and target extraction from formula structure.
- Implemented C++ SAT modeler with arithmetic witnesses, unit propagation,
  auxiliary assignment, and full model validation.
- Updated metadata and documentation for broker submission.
