3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-29 11:55:51 +00:00

Fix bug in realclosure::compare function

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
Leonardo de Moura 2013-01-06 21:50:36 -08:00
parent 3e19df0441
commit 3c1f1a3b65
3 changed files with 15 additions and 3 deletions

View file

@ -2500,10 +2500,10 @@ namespace realclosure {
else if (is_nz_rational(a) && is_nz_rational(b))
return qm().lt(to_mpq(a), to_mpq(b)) ? -1 : 1;
else {
// TODO: try to refine interval before switching to sub/expensive approach
if (bqm().lt(interval(a).upper(), interval(b).lower()))
// TODO: try to refine interval before switching to sub+sign approach
if (bqim().before(interval(a), interval(b)))
return -1;
else if (bqm().lt(interval(b).upper(), interval(a).lower()))
else if (bqim().before(interval(b), interval(a)))
return 1;
else {
value_ref diff(*this);