# Solver Notes

## Formula Notes

The visible training files are Green-Tao style two-color CNFs over an ordered list of primes with the small primes that cannot participate in the target progressions stripped by the generator. Clauses are monotone: all-positive clauses require at least one variable in the true color, and all-negative clauses require at least one variable in the false color. This is equivalent to avoiding monochromatic arithmetic progressions of one length in each color. Examples seen locally include positive 3-AP clauses paired with negative 5- or 6-AP clauses, and balanced positive/negative 4-AP clauses.

The solver does not use DIMACS comments or filenames. It detects the recoverable structure from the sanitized clauses: every clause must be monotone, variables in each clause must be strictly increasing, and both polarities must be present.

## Techniques Used

- Sparse false-color transversal seed construction for asymmetric formulas where the positive clauses have shorter length than the negative clauses. This is aimed at `(3,k)` and `(4,5)` style instances, where a good model is a small hitting set for the longer all-negative APs while avoiding all-positive APs in the false color.
- Focused stochastic repair on the recovered monotone hypergraph coloring problem, with dynamic clause weights for persistent violated progressions.
- ProbSAT-style break-only moves are mixed into asymmetric repair starts; this substantially improves the visible `GreenTao_2-3-5_527` time and gets the visible `GreenTao_2-3-6_2071` instance closer to a model than the inherited min-delta search.
- Incremental clause true-literal counts and variable occurrence lists for fast flip scoring.
- A small bounded flip search is attempted only after the stochastic repair reaches four or fewer violated clauses, to avoid slowing the main search on broad plateaus.
- Medium asymmetric formulas can fall back to a small from-scratch CDCL SAT search using the best local-search assignment as phase guidance. This fallback never claims UNSAT; it only returns SAT after model checking.
- Conservative SAT output: a candidate model is checked against every original CNF clause before printing `SATISFIABLE`.
- No UNSAT claims yet; unsupported or unresolved instances return `UNKNOWN`.

## Local Results In This Run

- `GreenTao_2-3-5_527`: SAT in about 0.8 seconds after adding sparse seeds plus ProbSAT-style moves.
- `GreenTao_2-4-4_511`: SAT in about 108 seconds with the weighted repair loop.
- `GreenTao_2-3-5_528`: returns `UNKNOWN`; best local short run reached one violated clause, but no UNSAT proof is emitted.
- `GreenTao_2-3-6_2071`: still returns `UNKNOWN` at the 570 second internal cutoff. The best default run with the ProbSAT mix reached two violated negative clauses; min-delta-only reached four.
- Generated `GreenTao_2-4-5_4232` from the recovered prime-AP rule for local testing. The current default reached 14 violated clauses in a full local run but did not solve it.
- Broker submission `eval_20260509T191554Z_5342faf9` from the pre-CDCL version solved 1/10 counted train instances (`2-3-5_527`) with no invalids. The mounted `2-4-4_511` SAT instance is not part of the counted broker train set.

## Remaining Things To Try

- Recover prime/AP parameters directly and add structured greedy construction or local search seeded by known finite-field/modular colorings.
- Design a stronger alternating repair for near-solutions of `(3,k)`: adding a false variable to cover an uncovered long AP creates all-false short AP conflicts, and resolving those can uncover other long APs. The current bounded flip DFS does not find these longer exchange chains.
- Add bounded complete search for the small boundary instances if a compact VeriPB proof strategy is found.
- Build a VeriPB proof path for known UNSAT boundaries such as `GreenTao_2-3-5_528`; the current solver cannot count those instances.
- Tune restart probabilities and noise separately for `(3,k)`, `(4,k)`, `(4,5)`, and `(5,5)` families.

## Known Limitations

- This version cannot prove UNSAT, so above-threshold formulas are intentionally reported as `UNKNOWN`.
- Stochastic search may fail to find larger SAT colorings before the 570 second internal cutoff. `GreenTao_2-3-6_2071` remains unsolved locally despite reaching two violated clauses.
- The detector is deliberately narrow and only accepts monotone Green-Tao-like CNFs.

## Changelog

- Initial scaffold replaced with a C++ monotone Green-Tao local search solver.
- Added dynamic clause weights to help the repair loop escape one-clause and two-clause plateaus.
- Added `tools/profile.py` for family statistics and encoding inspection.
- Updated notes to describe the recovered encoding and current solver behavior.
- Retuned asymmetric starts toward sparse false-color models instead of balanced random assignments.
- Added greedy sparse-transversal seeds for formulas with shorter positive AP clauses than negative AP clauses.
- Added a ProbSAT-style break heuristic mix for asymmetric formulas; this reduced the visible `2-3-5_527` runtime to under a second locally.
- Added a conservative bounded flip finisher for near-models with at most four violated clauses.
- Added local debug environment hooks for seed offset, shorter time limits, and best-model dumps; default evaluation behavior remains deterministic without these variables.
- Submitted `eval_20260509T191554Z_5342faf9`; result was `sat: 1`, `unknown: 9`, no invalid statuses. This improved visible local behavior but did not beat the 2/10 virtual best.
- Added a from-scratch CDCL SAT fallback for medium asymmetric instances. Local 570-second tests did not solve `2-3-6_2071` or generated `2-4-5_4232`, but the fallback is conservative because it emits only checked SAT models and never emits UNSAT.
