# Solver Notes

## Formula Notes

The training formulas are mutilated chessboard domino-placement encodings.
Variables represent possible domino placements. Positive clauses are
at-least-one incident-domino constraints for board cells, and binary negative
clauses enforce at-most-one constraints.

There are two observed encodings:

- Plain `mchess_*`/`mutcb*`: all remaining cells have positive clauses. The
  cell graph recovered from variable incidence is bipartite, and the two color
  classes differ by one or two cells after removing same-colored corners.
- `mixed-*-blocked`: only the larger color class has positive demand clauses.
  The smaller side's at-most-one constraints are encoded as a mix of direct
  pairwise AMO cliques and Sinz sequential AMO clauses with auxiliary variables.
  Extra trailing negative clauses can be ignored for the Hall contradiction.

The solver does not use comments, filenames, hashes, or memorized answers.

## Techniques Used

The solver parses the CNF and conservatively recognizes the matching structure.
For plain formulas it builds the graph whose nodes are positive cell clauses and
whose edges are shared variables, then bipartitions that graph and selects the
larger color class as the demand side. For mixed formulas it takes the initial
positive-clause prefix as the demand side and decodes the following pairwise or
Sinz AMO blocks until every demand variable is covered exactly once.

For UNSAT proofs, each right-side group is turned into a cardinality constraint
`sum ~x >= degree - 1`. Pair clauses are emitted as RUP constraints; degree-3
and degree-4 AMOs are derived by cutting planes and division. The final proof
sums all larger-side demand clauses with all smaller-side AMO cardinalities.
Every edge variable appears once positively and once negatively, so the left
side reduces to a constant that is too small for the right-hand side.

## Remaining Things To Try

- Generalize AMO cardinality derivation beyond degree 4 if future instances use
  non-grid matching graphs.
- Add support for satisfiable matching instances by reconstructing and printing
  a model from a direct matching algorithm.
- Reduce mixed proof size by deriving some AMO cardinalities directly from the
  Sinz encoding instead of first logging all pairwise clauses.

## Known Limitations

- The solver intentionally returns `UNKNOWN` for structures that are not the
  recovered mutilated-board matching family.
- It only emits UNSAT proofs. SAT model construction is not implemented because
  all observed training and baseline instances in this family are UNSAT.
- AMO groups larger than four variables are unsupported.

## Local Verification

On 2026-05-08, the solver was run on all 18 files in `/data/train`. Every
instance returned exit code 20 and `veripb --cnf formula.cnf out.pbp` verified
the proof. Solver runtime was about 0.03 to 0.04 seconds per instance locally;
VeriPB checking was below one second on the sampled training split.

## Changelog

- Initial scaffold: placeholder UNKNOWN solver.
- 2026-05-08: Added structural profiler under `tools/parse_groups.py`.
- 2026-05-08: Replaced the placeholder with a clause-based Hall-counting
  proof generator for plain and mixed mutilated-chessboard encodings.
- 2026-05-08: Updated metadata and documentation for broker submission.
