Commit 5be5149
* 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>
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent ddc9f85 commit 5be5149
54 files changed
Lines changed: 244 additions & 295 deletions
File tree
- examples
- src
- models
- graph
- satisfiability
- set
- specialized
- rules
- unitdiskmapping
- unit_tests
- tests/suites
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | | - | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
13 | 16 | | |
14 | 17 | | |
15 | 18 | | |
| |||
102 | 105 | | |
103 | 106 | | |
104 | 107 | | |
105 | | - | |
| 108 | + | |
106 | 109 | | |
107 | 110 | | |
108 | 111 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| 24 | + | |
23 | 25 | | |
24 | 26 | | |
25 | 27 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
0 commit comments