3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-03-07 13:54:53 +00:00
z3/src
Lev Nachmanson cfd087293c Add rewrite rule: (mod (- a b) m) = 0 ==> (mod a m) = (mod b m)
The identity (a - b) mod m = 0 ⟺ a mod m = b mod m is a basic
number theory fact. Without this rewrite, z3 could not solve formulas
like (mod (- x y) m) = 0 ∧ (mod x m) ≠ (mod y m) with symbolic m,
timing out instead of returning unsat.

The rewrite is added to mk_eq_mod in the arith rewriter, matching
the pattern (= (mod (+ a (* -1 b)) m) 0) in both argument orders.

Fixes #1618.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-28 12:00:24 -10:00
..
ackermannization Fix off-by-one vulnerabilities: use range-based for on goals; cache loop bound 2026-02-19 22:37:22 +00:00
api Add missing API functions to Go, OCaml, and TypeScript bindings 2026-02-27 02:55:37 +00:00
ast Add rewrite rule: (mod (- a b) m) = 0 ==> (mod a m) = (mod b m) 2026-02-28 12:00:24 -10:00
cmd_context Remove redundant default constructors when they're the only constructor (#8461) 2026-02-18 20:58:01 -08:00
math Update src/math/simplex/model_based_opt.h 2026-02-27 17:29:37 -10:00
model Remove redundant default constructors when they're the only constructor (#8461) 2026-02-18 20:58:01 -08:00
muz Eliminate unnecessary copies with std::move for ref-counted types (#8591) 2026-02-18 21:02:24 -08:00
nlsat remove an unnecessary template from levelwise 2026-02-25 07:03:23 -10:00
opt Refactor optimization and model to use C++17 structured bindings for pairs (#8426) 2026-02-18 20:57:59 -08:00
params update params 2026-02-19 19:06:06 -08:00
parsers Revert "Refactor find_psort_decl() to return std::optional<psort_decl*> (#8339)" 2026-02-18 20:57:56 -08:00
qe Fix true positive critical bugs from static analysis discussion #8764 2026-02-25 00:41:59 +00:00
sat Fix assertion violation in q_mbi diagnostic output 2026-02-28 11:15:28 -10:00
shell Standardize for-loop increments to prefix form (++i) (#8199) 2026-02-18 20:57:29 -08:00
smt fix #7677: treat FC_CONTINUE from check_nla as FEASIBLE in maximize 2026-02-27 12:29:14 -10:00
solver Remove copies (#8583) 2026-02-18 21:02:22 -08:00
tactic Merge pull request #8779 from Z3Prover/copilot/convert-bv1-blast-to-simplifier 2026-02-26 15:52:18 -08:00
test Merge pull request #8789 from Z3Prover/succ_int_mult 2026-02-27 09:45:26 -10:00
util Fix true positive critical bugs from static analysis discussion #8764 2026-02-25 00:41:59 +00:00
CMakeLists.txt git bindings v1.0 2026-02-18 21:02:25 -08:00