# Solver Notes

## Formula Notes

- The family is a CBMC-style bit-blasted SATcoin/Bitcoin-genesis mining
  circuit. Comments are not used. The solver detects the structure from two
  repeated 32-bit equality-comparator gates near the front of the CNF.
- The repeated comparator gates expose the 32 nonce variables. In the smaller
  141429-variable layout these are variables 41..72; in the 134781-variable
  layout they are later in the file. The constants around the first two
  equality gates match nonce interval endpoints around the genesis nonce.
- With all nonce bits assigned, unit propagation through the circuit derives a
  contradiction for the inspected training instances. A flat proof with one
  full blocking clause per nonce is valid in principle but too slow for VeriPB.

## Techniques Used

- Conservative structural detector for repeated 32-bit equality gates.
- Direct interval proof generation over the recovered nonce bits. The solver
  uses the two comparator constants as inclusive interval endpoints, emits RUP
  blocking clauses for nonce leaves in that interval, emits range-pruned prefix
  clauses outside it, and emits internal tree nodes to derive the parent clause
  after both children are refuted. The final root clause is the empty
  contradiction.
- Soundness guard: unsupported structures and over-budget proof trees return
  UNKNOWN instead of claiming UNSAT.

## Remaining Things To Try

- Add conflict analysis for fixed-nonce contradictions. Current leaves are
  mostly full 32-literal clauses, making VeriPB re-run SHA-like propagation for
  each nonce. First-UIP clauses over nonce decisions should compress many
  adjacent nonces.
- Recover more of the high-level SHA structure and log local gate-value proofs
  or PB arithmetic certificates instead of repeated whole-circuit RUP checks.
- Explore VeriPB `red`/implicational proof rules for a compact interval
  exclusion argument.

## Known Limitations

- The current proof is valid only if VeriPB can check the emitted RUP tree in
  time. Direct generation reduced solver time for the 5920-range local instance
  from about 382 seconds to under a second, but proof checking remains the main
  bottleneck.
- This is not a general SAT solver and should only claim UNSAT for formulas
  matching the detected SATcoin nonce-comparator structure.

## Changelog

- Replaced scaffold with C++ structural detector and nonce-only DPLL/RUP proof
  logger.
- Added `/workspace/solver/tools/profile.py` for CNF family profiling.
- Fixed an unsound/incomplete watched-propagation prototype by switching to
  occurrence-list unit propagation matching the Python reference behavior.
- Replaced BCP-driven proof tree construction with direct interval proof
  generation from recovered comparator constants, eliminating solver-side
  timeouts for proof emission.
