Skip to content

Add integer GCD, divisibility, and n-ary product constraints - #240

Open
zayenz wants to merge 45 commits into
mainfrom
feature/gcd
Open

zayenz wants to merge 45 commits into
mainfrom
feature/gcd

Conversation

@zayenz

@zayenz zayenz commented Sep 8, 2026 •

Copy link
Copy Markdown
Member

Add integer GCD, reified divisibility, exact n-ary products, and products with fixed or variable moduli. Reification supports equivalence and both implication modes. GCD is nonnegative, zero divides zero, and modular products use Euclidean residues.

Propagation uses bounds, signs, congruences, and algebraic rewrites without tuple enumeration. Public API comments describe the propagation limits and modulus semantics. Small products reuse existing equality and multiplication propagators where appropriate.

The existing arithmetic suite passes in Release and audited Debug with UBSan. Installed-package checks cover the public overloads.

zayenz 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
@zayenz
zayenz marked this pull request as ready for review September 22, 2026 10:11
Bound GCD coprimality probes, tighten divisor bounds, and fold modular coefficients. Group repeated exact-product views and compute modular cofactors with linear prefix/suffix passes. Preserve subscription bookkeeping during factor compaction.

Add regressions through the native arithmetic test framework and document propagation limits. All 663 arithmetic tests pass three iterations with fixprob=1 in Release and Debug/audit with ASan and UBSan.

@zayenz zayenz left a comment •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Corrected the gcd_abs_status() comment. The function checks interior domain membership as well as bounds.
  • Reused multiple_bounds() across GCD, divisibility, and modular-product propagation. This removes duplicate rounding and bound updates; the divisibility caller normalizes the sign.

@zayenz zayenz left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No actionable findings in GCD, divisibility, or product propagation. All 663 registered arithmetic tests passed locally, and all 14 CI checks pass at 87e8d23b0e.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant