# Solver Notes

## Formula Notes

- Family is `grandtour-puzzle`, matching the SAT Competition GrandTourobs
  benchmarks: Hamiltonian-cycle instances encoded via ASSAT Clark completion.
- Two related encodings appear:
  - `p50`/`p60c343` style: arc variables are paired with complement variables.
    Positive all-arc clauses are row constraints. Complement support clauses
    reveal column conflict cliques. These instances have a Hall deficiency.
  - `p60c23x/p60c24x` style: row constraints are reachability requirements.
    Unit node variables plus AND/OR gate clauses RUP-imply at-least-one arc
    rows. Complement support clauses again reveal columns.
- The SAT-Competition-transformed `gto_p60c238-sc2018` visible instance has
  polarity/renumbering changes that break the current conservative detector, so
  it is intentionally left `UNKNOWN`.

## Techniques Used

- Parse DIMACS and recover `arc <-> not(complement)` pairs from the binary
  mutual-exclusion clauses and one-negative support clauses.
- Build row/column incidence over recovered arcs. Rows are either original
  positive clauses (`p50` style) or RUP-derived reachability rows (`p60` style).
- Run Hopcroft-Karp. If no matching covers all rows, use the alternating-search
  Hall witness `U,N(U)` as a compact UNSAT certificate.
- Emit VeriPB:
  - row constraints by original IDs or `rup`;
  - pairwise column conflicts by `rup`;
  - column at-most-one constraints by recursive cutting-planes derivations over
    clique subsets;
  - final `pol` sum of Hall rows and column capacities to contradiction.

## Remaining Things To Try

- Support the `*-sc2018` transformed polarity/renumbering variant by lifting the
  detector from variables to signed literals.
- Add SAT model reconstruction for satisfiable variants, if they appear in
  future splits.
- Reduce proof size for the largest `p50` columns with a more direct AMO
  cutting-planes derivation.

## Known Limitations

- Only proves Hall-deficiency UNSAT for the recovered row/column structure.
  Non-Hall Hamiltonian obstructions return `UNKNOWN`.
- Does not claim SAT.
- Rejects rows unless their mapping is structurally exact; this is deliberate to
  avoid invalid proofs.

## Changelog

- Replaced scaffold with a C++ proof-producing specialized solver.
- Added `tools/profile.py` for CNF statistics and unit-propagation profiling.
- Implemented type-B (`p50`/`p60c343`) row recovery from original positive
  clauses.
- Implemented type-A (`p60c23x/p60c24x`) reachability-row recovery and RUP row
  proof logging.
- Added Hall-witness extraction, recursive AMO cutting-planes proof generation,
  and VeriPB proof output.
- Updated `meta.json` for broker submission.
