You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add variant-level aliases; introduce 2SAT and 3SAT (#1054)
* Add variant-level aliases; introduce 2SAT and 3SAT
Variant-level aliases attach to a specific reduction-graph node rather
than a canonical problem name, so shorthand like `3SAT` can resolve to
`KSatisfiability<K3>` directly instead of going through the problem's
default variant (which is `KN`, not what `3SAT` means in the literature).
- `VariantEntry` gains an `aliases: &'static [&'static str]` field.
- `declare_variants!` accepts optional `aliases ["X", ...]` trailing each
entry and emits the field.
- `registry::find_variant_by_alias()` returns both the entry and its
variant map.
- CLI `parse_problem_spec` and `resolve_alias` try variant-level aliases
before problem-level ones, injecting the alias's variant tokens into
the spec; problem-level resolution is unchanged for `MIS`, `SAT`, etc.
- Adds `2SAT` on `KSatisfiability<K2>` and `3SAT` on `KSatisfiability<K3>`.
- `pred list` now shows variant-level aliases on their own rows.
- `MAX2SAT` remains a problem-level alias on `Maximum2Satisfiability`
(standalone problem, no variants).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: address variant alias review follow-ups
* fix: cover all error branches of validate_variant_aliases for codecov
Refactor validation into a testable `validate_aliases_inner` that accepts
mock data, so every conflict branch (empty alias, canonical-name collision,
problem-alias collision, duplicate variant alias, multi-conflict) is
exercised without depending on inventory state. Also test `variant_label`
with both empty and non-empty variant dimensions.
Patch coverage: 15 uncovered lines → ~2 (the inventory integration test
panic branch, which is inherently unreachable on a healthy codebase).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
0 commit comments