# Solver Notes

## Formula Notes

- The family is the Stedman/Erin Triples SAT encoding described by Andrew
  Johnson: variables are calls first, then six-type variables, then LFSR
  sequence variables and sometimes cardinality-network auxiliaries.
- Direct encodings use one-hot type variables: Stedman has 6 type variables per
  six and Erin has 3. Binary/log encodings use 3 bits for Stedman and 2 bits for
  Erin. The `sted12a` instance uses a 3-bit twisted-ring encoding.
- Transition clauses are support clauses. From them the solver can reconstruct
  edges `(six, type, call) -> (next six, next type)` without comments or names.
- The visible training split has 29 files. The current solver returns verified
  SAT models for nearly all visible instances after adding the Sted1 template,
  with the remaining local misses concentrated in incompatible Sted1 variants.
  Broker submissions improved from 13/36 to 23/36 before the Sted1 template was
  promoted.

## Techniques Used

- Structural detector over candidate graph sizes and type encodings.
- Clause-based transition-table recovery for direct, binary/log, and
  twisted-ring type encodings.
- Graph-level call templates for recovered Sted1 (`N=840, T=6`), Sted2
  (`N=420, T=6`), Sted3 (`N=280, T=6`), Sted4 (`N=210, T=6`), Sted5
  (`N=168, T=6`), Sted6 (`N=140, T=6`), and Erin2 (`N=420, T=3`) transition
  systems.
- Bounded direct DFS over recovered transition graphs (`N<=840`), respecting
  unit-implied call and type restrictions and returning `UNKNOWN` if the node
  budget is exhausted.
- Full assignment construction followed by unit propagation through the original
  CNF, including LFSR sequence and auxiliary variables.
- Independent final clause check before printing `s SATISFIABLE`; unsupported
  or mismatching structures return `UNKNOWN`.

## Remaining Things To Try

- Add a real high-level search for Sted1/Sted2/Sted3/Sted4 and Erin2 instead of
  only using Sted5/Sted6 templates.
- Recover or generate graph-level templates for the other satisfiable quotient
  graphs.
- Develop a VeriPB proof strategy for small structurally UNSAT graphs such as
  parity-impossible Sted/Erin variants.
- Replace the simple repeated-scan propagation with watched propagation if more
  auxiliary-heavy templates are added.

## Known Limitations

- No UNSAT claims are made.
- The solver intentionally returns `UNKNOWN` for detected graphs whose Sted5 or
  Sted6 templates do not satisfy the full CNF.
- Current search remains intentionally bounded, so it does not solve the larger
  Sted1/Sted2 and Erin2 instances even though their transition tables are
  decoded.

## Changelog

- Replaced the scaffold with a C++20 structural decoder and checked SAT model
  generator.
- Added `tools/sted_hl.py`, a Python notebook/prototype for profiling formulas,
  testing transition recovery, and validating high-level cycles.
- Added Sted5 and Sted6 call templates and verified them locally on all visible
  train instances of those graph sizes.
- Added a bounded small-graph DFS fallback; it solved local `sted3_0x1e3-147`
  and `sted4_0x1e3-124` with checked models.
- Promoted the recovered Sted3 cycle to a reusable template; it also verifies
  on local `sted3_0x0_n201-239`.
- Promoted the recovered Sted4 binary/log cycle to a reusable `N=210` template.
- Promoted recovered Sted2 and Erin2 `N=420` cycles to reusable templates; they
  verify locally on direct and binary/log variants, including Sted2 `_n219`.
- Corrected the twisted-ring state code mapping; local `sted12a_0x1e1-67`
  now solves by bounded DFS and full model checking.
- Raised the bounded DFS graph-size limit to include Sted1 binary/log formulas;
  local `sted1_0x1e3-100` and `sted1_0x1e3-393` now solve.
- Promoted the recovered 438-bob Sted1 cycle to a reusable template; it verifies
  locally on binary/log, direct, and `_n438` Sted1 formulas.
- Updated metadata and build notes for broker submission.
