# Solver Notes

## Formula Notes

- The family is an interval-matching encoding. Non-binary clauses are block
  "at least one" constraints. Each block is a contiguous variable interval,
  and the literal polarity inside that clause defines the positive matching
  value for that variable.
- After normalizing by each block polarity, every binary clause is a negative
  pair `(~y_i or ~y_j)`. The binary graph decomposes into disjoint resource
  cliques; each clique contains at most one value from any block.
- Some resource clique occurrences do not appear in a non-binary block. Their
  polarity is inferred from binary clauses connected to known block variables.
  Unit clauses whose literal is positive under this inferred polarity are
  singleton blocks and are included on the matching side.
- The visible training instances have roughly 80-85 blocks, 90-97 resources,
  about 2.3k-2.6k value variables, and 50k-64k binary conflict clauses. All
  visible training instances contain a Hall-deficient block set.

## Techniques Used

- Structural detector from sanitized DIMACS only: contiguous long ALO blocks,
  polarity propagation through binary conflicts, unit singleton block recovery,
  and resource clique validation.
- Hopcroft-Karp matching on the recovered bipartite graph of blocks to
  resources. A failed maximum matching yields a Hall set using standard
  alternating-reachability.
- VeriPB Hall proof logging. For each resource in the Hall set, the solver
  derives a cardinality AMO constraint from the original pairwise binary
  clauses using cutting-planes `pol` steps. It then sums those AMOs with the
  original block ALO clauses to derive the contradiction.

## Remaining Things To Try

- Add a SAT model path for matching-satisfiable instances. The current solver
  returns `UNKNOWN` when the recovered matching core has a full matching,
  because no local visible instance requires SAT handling.
- Broaden support for size-2 ALO blocks if future instances encode them as
  binary clauses. The visible split only exposed long ALOs and singleton units.
- Add proof deletion if future instances are much larger. Current proof sizes
  are small enough that deletion is unnecessary.

## Known Limitations

- The UNSAT path is intentionally conservative. If polarity inference, clique
  validation, or Hall proof construction fails, the solver returns `UNKNOWN`.
- The proof certifies only Hall-deficient matching cores. Other unsatisfiable
  formulas outside this encoding are not handled.
- Satisfiable recovered cores are not emitted as SAT assignments yet.

## Changelog

- Initial scaffold: trivial `UNKNOWN` solver.
- Added interval-matching detector for contiguous ALO blocks and binary
  conflict clique resources.
- Added Hopcroft-Karp matching, Hall set extraction, and VeriPB proof logging
  from original CNF clauses.
- Extended detection to infer resource polarity through gap variables and to
  include positive unit clauses as singleton matching blocks.
- Verified all 16 visible training instances locally with `veripb --cnf`.
