3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-24 17:45:32 +00:00
This commit is contained in:
Jakob Rath 2023-02-20 16:28:31 +01:00
parent 1dea87a07a
commit 33a38ba96f

View file

@ -1618,22 +1618,17 @@ namespace polysat {
rational max = A >= 0 ? x_max * A + B : x_min * A + B;
rational min = A >= 0 ? x_min * A + B : x_max * A + B;
VERIFY(min <= max);
if (max - min >= M)
if (max - min >= M) {
IF_VERBOSE(10, verbose_stream() << "adjust_bound: abort because max - min >= M\n");
return false;
}
// k0 = min k. val + kM >= 0
// = min k. k >= -val/M
// = ceil(-val/M) = -floor(val/M)
rational offset = rational::zero();
#if 0
if (max >= M)
offset = -M * floor(max / M);
else if (max < 0)
offset = M * floor((-max + M - 1) / M);
#else
if (max < 0 || max >= M)
offset = -M * floor(max / M);
#endif
d += offset;
// If min + offset < 0, then [min,max] contains a multiple of M.