Fix #422: [Model] TwoDimensionalConsecutiveSets#673
Open
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #673 +/- ##
==========================================
+ Coverage 97.04% 97.06% +0.01%
==========================================
Files 284 286 +2
Lines 38037 38234 +197
==========================================
+ Hits 36914 37110 +196
- Misses 1123 1124 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
Author
Implementation SummaryChanges
Deviations from Plan
Open Questions
|
There was a problem hiding this comment.
Pull request overview
Adds a new satisfiability model, TwoDimensionalConsecutiveSets (Garey & Johnson A4 SR19), and integrates it across the library, CLI, example DB, and documentation so it appears in the registry/graph and can be created from the CLI.
Changes:
- Implement
TwoDimensionalConsecutiveSetsmodel + variant declaration + example-db spec. - Add unit tests (creation, evaluation, brute-force satisfiability, serialization, invalid-input panics) and trait-consistency coverage.
- Integrate into CLI (
pred create), example fixtures, docs JSON exports, and paper references/definition.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/models/set/two_dimensional_consecutive_sets.rs | New model implementation, schema registration, variants, example-db hook, tests module include |
| src/models/set/mod.rs | Expose the new set model and include example-db specs |
| src/models/mod.rs | Re-export TwoDimensionalConsecutiveSets at the crate models level |
| src/unit_tests/models/set/two_dimensional_consecutive_sets.rs | New unit tests for the model |
| src/unit_tests/trait_consistency.rs | Add trait-consistency check for the new model |
| src/example_db/fixtures/examples.json | Add canonical example instance + satisfying assignments |
| problemreductions-cli/src/commands/create.rs | Add CLI example string + pred create support for the new model |
| problemreductions-cli/src/cli.rs | Document flags and add usage example in CLI help text |
| docs/src/reductions/reduction_graph.json | Add variant node for the new model in the rendered reduction graph |
| docs/src/reductions/problem_schemas.json | Add schema entry for the new model in docs |
| docs/paper/references.bib | Add Lipski 1977 reference |
| docs/paper/reductions.typ | Add paper definition/example block for the new problem |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| for subset in &self.subsets { | ||
| if subset.is_empty() { | ||
| continue; | ||
| } |
Comment on lines
+952
to
+957
| let universe = args.universe.ok_or_else(|| { | ||
| anyhow::anyhow!( | ||
| "TwoDimensionalConsecutiveSets requires --universe and --sets\n\n\ | ||
| Usage: pred create TwoDimensionalConsecutiveSets --universe 6 --sets \"0,1,2;3,4,5;1,3;2,4;0,5\"" | ||
| ) | ||
| })?; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add TwoDimensionalConsecutiveSets model — a satisfaction problem from Garey & Johnson (A4 SR19). Given an alphabet and collection of subsets, determines whether the alphabet can be partitioned into ordered groups satisfying intersection and consecutiveness constraints.
Fixes #422