Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #684 +/- ##
========================================
Coverage 97.04% 97.05%
========================================
Files 284 286 +2
Lines 38037 38174 +137
========================================
+ Hits 36914 37050 +136
- Misses 1123 1124 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Implemented Summary:
Verification:
|
There was a problem hiding this comment.
Pull request overview
This PR adds a new CosineProductIntegration model implementing the Cosine Product Integration decision problem (Garey & Johnson A7 AN14). The problem asks whether ∫₀²π ∏ᵢcos(aᵢθ)dθ ≠ 0, which is equivalent to checking whether a balanced sign assignment exists for the given integer coefficients. The implementation uses a pseudo-polynomial DP approach for the has_balanced_sign_assignment helper and brute-force sign enumeration for the core evaluate method.
Changes:
- Added
CosineProductIntegrationmodel with schema, Problem/SatisfactionProblem trait implementations, signed-sum evaluation, DP-based balanced-sum check, and declare_variants complexity annotation - Added CLI
pred createsupport with--coefficientsflag and comprehensive unit tests - Added mathematical documentation in the paper and a canonical example in the example DB
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/models/misc/cosine_product_integration.rs | Core model: struct, schema, signed_sum, has_balanced_sign_assignment DP, Problem/SatisfactionProblem impls, variants, example spec |
| src/unit_tests/models/misc/cosine_product_integration.rs | Tests covering creation, signed sum, evaluate, solver, empty/zero/negative cases, serialization |
| src/models/misc/mod.rs | Register new module, re-export, add to canonical example specs |
| src/models/mod.rs | Re-export CosineProductIntegration |
| src/lib.rs | Add to prelude |
| problemreductions-cli/src/commands/create.rs | CLI create handler for CosineProductIntegration, import, flag check, format hint cleanup |
| problemreductions-cli/src/cli.rs | Add --coefficients flag, help text, and example |
| docs/paper/reductions.typ | Mathematical definition and explanation in the paper |
| src/example_db/fixtures/examples.json | Canonical example instance and updated existing example solutions |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Review Pipeline Report
Remaining issues for final review
🤖 Generated by review-pipeline |
Summary
CosineProductIntegrationFixes #548