# Solver Notes

## Formula Notes

- Visible train files are Philips-family multiplier-miter CNFs with
  3641/3642 variables and 4456 clauses.
- Clause sizes are only binary and ternary: 2059 binary clauses and 2397
  ternary clauses.
- Structural recovery finds 1029 signed AND gates of the form
  `out <-> a & b`, 342 three-variable parity/XOR constraints, and one
  remaining binary miter/assertion clause.
- The 20 true multiplier input variables are recognizable without comments or
  numbering: they are not signed-AND outputs and each appears as an AND input
  at least 20 times. Shuffled train instances preserve this structural signal,
  including polarity shuffles.
- Assigning those 20 inputs and running ordinary CNF unit propagation always
  reaches a conflict. This gives a direct tree-like RUP proof of UNSAT.

## Techniques Used

- DIMACS parser ignores comments and operates only on clauses.
- Conservative detector checks the exact Philips clause profile and signed AND
  template count before committing to UNSAT; unsupported formulas return
  `UNKNOWN`.
- Proof search branches only on the 20 detected multiplier inputs. For each
  conflicting input cube, it emits a RUP clause blocking that cube.
- After both branches under a partial cube are proved, the solver emits the
  parent blocking clause as another RUP step. It deletes child proof clauses by
  ID after each resolution step to keep the verifier frontier small.
- The solver never calls an external SAT/PB/SMT solver. Watched propagation is
  implemented locally and is used to confirm every emitted leaf cube conflicts
  before printing UNSAT.

## Local Measurements

- Original visible instance:
  - solver: 15.96s
  - proof: 1,047,616 leaf cubes, 2,095,231 RUP clauses, 308 MB with deletions
  - `veripb --cnf`: verified UNSAT in 279.18s
- Shuffled visible instance:
  - solver: 24.99s
  - proof: 1,048,064 leaf cubes, 2,096,127 RUP clauses, 357 MB with deletions
  - `veripb --cnf`: verified UNSAT in 279.88s

## Known Limitations

- The proof is intentionally simple but large. VeriPB checking is the dominant
  wall time locally, although the solver generation time is well below the
  baseline SAT-solver times.
- The detector is specialized to the Philips multiplier-miter profile. It will
  return `UNKNOWN` for formulas that do not have the expected clause counts,
  signed AND count, and 20 structural input variables.
- A more compact future proof should exploit multiplier arithmetic or XOR/AND
  congruence directly instead of enumerating all 20 multiplier inputs.

## Changelog

- Initial scaffold: placeholder UNKNOWN solver.
- Added C++ DIMACS parser, watched-literal CDCL, 1-UIP learning, restarts,
  model verification, and VeriPB RUP proof logging.
- Added structural AND-gate detection and duplicate-output equivalence lemmas.
- Added optional BCP probing controlled by `SOLVER_PROBE_ROUNDS`.
- Added lazy learned-clause deletion, improving local conflict throughput.
- Added bounded-resolution RUP preprocessing. It improved local throughput to
  about 5.5M conflicts in 585s on the visible original instance, but still
  ended as `UNKNOWN`.
- Broker job `eval_20260506T223721Z_771fc8ec` for the previous candidate
  returned 4/4 `unknown` at roughly the 585s internal cutoff.
- Replaced the CDCL candidate with a Philips-specific 20-input truth-table RUP
  proof generator using structural input detection and proof-clause deletion.
- Updated metadata and this README with local proof-generation and VeriPB
  verification measurements.
