Commit 7bbd90b
* refactor: internalize reduction structs and gadgets in rules module
Remove public re-exports of ~30 ReductionXToY structs, 6 gadget
functions, BoolVar, LogicGadget, and JSON serialization types
(EdgeJson, NodeJson, ReductionGraphJson) from rules/mod.rs. Users
interact with reductions via the ReduceTo trait or ReductionGraph,
never referencing these structs by name.
Also remove unused ReductionColoringToILP type alias and suppress
dead_code warnings on LogicGadget fields only read in tests.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* refactor: internalize unitdiskmapping implementation details
Change internal type re-exports (CopyLine, MappingGrid, CellState,
Pattern, etc.) from pub to pub(crate) in unitdiskmapping/mod.rs.
Change alpha_tensor and pathdecomposition modules to pub(crate).
Add #[cfg(test)] guards on re-exports only needed by unit tests.
Add #[doc(hidden)] _internal module for the export_mapping_stages
example which needs these types.
Keep ksg, triangular modules and GridKind/MappingResult as pub.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* refactor: internalize polynomial/truth_table, delete unused graph_types module
- Change polynomial and truth_table modules from pub to pub(crate)
since they are only used internally via crate:: imports.
- Delete graph_types.rs and its unit test file (zero internal imports,
confirmed by codebase audit; actual graph types live in topology/).
- Remove truth_table integration tests from tests/suites/reductions.rs
(equivalent coverage exists in src/unit_tests/truth_table.rs).
- Remove doc example from TruthTable since the module is now internal.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* feat: add is_valid_solution methods to graph problem types
Add public is_valid_solution(&self, config: &[usize]) -> bool methods to
all graph problem types, delegating to existing private validation helpers.
Also add cut_size method to MaxCut for computing partition cut sizes.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* feat: add is_valid_solution methods to set and specialized problems
Add public is_valid_solution methods to MaximumSetPacking,
MinimumSetCovering, BicliqueCover, CircuitSAT, and Factoring.
Each delegates to existing validation logic. PaintShop already
has count_switches and BMF is skipped per design.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* refactor: internalize validation free functions, keep as problem methods
Change standalone validation free functions (is_independent_set,
is_vertex_cover, is_clique, etc.) from pub to pub(crate) with #[cfg(test)]
for test-only functions. Functions still used in non-test code
(is_valid_coloring, is_hamiltonian_cycle, cut_size) remain pub(crate)
without #[cfg(test)].
- Change 17 validation functions from pub to pub(crate)
- Add #[cfg(test)] to 14 functions only used in tests
- Remove validation function re-exports from graph/set/specialized mod.rs
- Make submodules pub(crate) for crate-internal test access
- Update graph_models.rs imports to use full module paths
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* refactor: internalize config_to_bits and bits_to_config
Change these utility functions from pub to pub(crate) with #[cfg(test)]
since they are only used in unit tests. This reduces the public API
surface of the config module.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* refactor: slim down prelude to essential items
Remove from prelude: config utilities, registry types, variant types,
ILP/optimization internals, NumericSize, and WeightElement. These items
remain accessible via their full module paths.
Add explicit imports to 16 examples, 2 integration test files that
previously relied on the broader prelude:
- ILP type: 13 examples + 1 test file
- K3/K2 variant types: 7 examples + 2 test files
- LinearConstraint/ObjectiveSense: 1 example + 1 test file
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: restore PlanarGraph and BipartiteGraph VariantParam tests
These tests were dropped when graph_types.rs was deleted but had no
equivalent coverage elsewhere. Added them to variant.rs where similar
graph type VariantParam tests already exist.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* test: add is_valid_solution and cut_size method tests
Cover all 15 new public methods with both valid and invalid cases:
- 14 is_valid_solution tests across all problem types
- 1 cut_size method test for MaxCut
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent eb92e0a commit 7bbd90b
17 files changed
Lines changed: 188 additions & 3 deletions
File tree
- src/unit_tests
- models
- graph
- satisfiability
- set
- specialized
- tests/suites
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
178 | 178 | | |
179 | 179 | | |
180 | 180 | | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
163 | 163 | | |
164 | 164 | | |
165 | 165 | | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
269 | 269 | | |
270 | 270 | | |
271 | 271 | | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
158 | 158 | | |
159 | 159 | | |
160 | 160 | | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
222 | 222 | | |
223 | 223 | | |
224 | 224 | | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
194 | 194 | | |
195 | 195 | | |
196 | 196 | | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
0 commit comments