Add integer GCD, divisibility, and n-ary product constraints - #240
Draft
zayenz wants to merge 30 commits into
Draft
Add integer GCD, divisibility, and n-ary product constraints#240zayenz wants to merge 30 commits into
zayenz wants to merge 30 commits into
Conversation
added 30 commits
August 12, 2026 10:21
Zdev-Change-Id: Z23e8ed204a2bc1ed69de169d26b3e327f2aa57728385b2abebae37b6df77b362
Zdev-Change-Id: Zc6a9a755441bc60bfbaa9f28638c9e80038509752e6de401cce089c8c70b1a01
Zdev-Change-Id: Z80743f0b0c047b65076611f28d9fffc994e0fa5302fe3aca0132eb0bb479b06c
Zdev-Change-Id: Zb9abdc3f43ea2d3f0e8841d8777d60cf54652d1b10d37d8ae2e45bbc9ba56242
Zdev-Change-Id: Z8b715e43b5f76417885046356ccbf2977d56af615849fca09606fa66134384fd
Zdev-Change-Id: Zf0e584ca47fe274025cb88164a652e1d50742bd9bb9f23714881ae5026f218a1
Zdev-Change-Id: Z173281beec8d8c90d2cee6d137e40c90e7670c7e0f1660e1fc8bbbb3f2dc1c46
Zdev-Change-Id: Z4e982ffb9b706ba0158a82807fcf9de5bf1be32e41238c704e32451054d53743
Zdev-Change-Id: Zf5f690820adf5b0c9bb6738861c2e96a68dc91647e0295935dc589bd35079a16
Zdev-Change-Id: Z1413d81cb9a8151dc29dfd102a58b9ad5ba4817840c63b4723cbd699b6700919
Zdev-Change-Id: Z6be39616f11def89cb85d64bbb8d2fe06bef1d1e81a13746fff2eda9c3ae03fe
Zdev-Change-Id: Za127c189c6c2a9ffc8b003a76cf072708ba0e107d9cf5557d48ba73a712c32bc
Zdev-Change-Id: Zeae09906bc1aa34439646b3b0d81635225d236cbba0e645a84d570635f022a3d
Zdev-Change-Id: Z0a96802fefc135e7804e2354bf001ee704b921ca3c73374a22028e3e6de0ed9b
Zdev-Change-Id: Z6697471e381aaf89269dffc32cf564d9ce1b5f3b6083b2f7c128f70450637b3a
Zdev-Change-Id: Z63eefb11cc8b2d71f771200fd976f892416171ec432ea1e3edcdadddc501910f
Zdev-Change-Id: Z577863e37baab23e1d34fbb66cf6d17c1a1caba746ac1aa2fb7582138a82594a
# Conflicts: # changelog.in
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.
Adds integer GCD, reified divisibility, exact n-ary products, and fixed/variable-modulus products. All reified forms support equivalence and both implication modes. GCD is nonnegative, zero divides zero, and modular products use Euclidean residues.
Propagation uses bounds, signs, powers, congruence, and algebraic rewrites without tuple enumeration. The public documentation states the propagation limits and fixed/variable modulus semantics. Includes the 6.5.0 release note and a modeling example.
Readiness review fixes include sparse-domain fixpoint rescheduling, avoiding repeated space allocations for result aliases, and cheap reified identities. Tests cover signed limits, overflowing exact products with known modular residues, activation, cloning, and variable-to-fixed modulus rewrites. They are registered in Gecode's normal testing framework, with no family-specific CI or make check additions.
Validation: all 591 integer arithmetic tests pass locally in Release and Debug with runtime auditing and UBSan (halt on error). A separately configured installed-package consumer compiled and executed all nine overloads. The sanitizer run also exposed and fixed two existing arithmetic test-oracle overflows. Integrated current main; supported-platform CI is running on the final revision.
A small reproducible scaling sample records the tradeoff between n-ary propagation cost and improved search for repeated factors and result aliases. No speculative caching or broad performance rewrite is included.
See
docs/gcd-pr-readiness.mdfor the review and follow-up evidence.