Replies: 1 comment
-
|
Here's an updated table that combines Z3, CVC5, and our Singular encoding. It's interesting to note how Singular's successes are quite complementary to the Z3 results.
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Here's a small experiment @yizhou7 and I recently tried. We took a number of simple lemmas from Dafny's standard library related to modulus operations, and we encoded them directly into SMT (using Z3's Python API).
Here's a rough summary of the properties involved (see the attached Python script for more details):
x == d * (x / d) + (x % d)x < m ==> x % m == xm % m == 0 && (x % m) % m == x % m && 0 <= x % m < mx % m <= x0 < x && x % m == 0 ==> x >= m(x * m) % m == 0(b + m) % m == b % m && (b - m) % m == b % m(b + m * a) % m == b % m && ...x % d - y % d == (x - y) % d((x % m) + y) % m == (x + y) % m(x - (y % m)) % m == (x - y) % mx % d == (x * (1 - d)) % dx * (y % m) % m == (x * y) % mWith Z3, we experimented with three preludes:
(set-logic NIA), so that Z3 only thinks about non-linear arithmeticSince CVC5 doesn't support any of the Verus standard SMT options, for CVC5, we experimented with:
(set-logic NIA), so that CVC5 only thinks about non-linear arithmetic(set-logic ALL), so that CVC5 can think about any theory it prefers.Here are the results for Z3. Note that there's one case that Arith 2 solves and Arith 6 fails on (
ModMultiplesBasic),and vice versa for
ModSubtraction.Here are the results for CVC5. Note that it's able to get
MultipleVanishin both modes,MultiplesVanishin NIA mode, andModNegNegin both.A related observation is that the SMT-COMP non-linear arithmetic files appear to have no queries that depend non-trivially on modulo operations, so what we're seeing here may be symptomatic of that absence.
@yizhou7 is working on trying these lemmas in our Singular mode. We expect all of the properties that don't involve inequalities to be trivial for it to solve, but stay tuned for more details.
Beta Was this translation helpful? Give feedback.
All reactions