Open amchiclet opened 4 years ago
A QF_LRA formula at commit f370d8d9b4f
(set-logic QF_LRA)
(declare-const r0 Real)
(declare-const r1 Real)
(assert (< r0 0.0 r1 0.955441))
(maximize r1)
(check-sat)
(get-objectives)
./z3 smt.arith.solver=6 xx.smt2
sat
(objectives
(r1 (/ 955441.0 2000000.0))
)
./z3 smt.arith.solver=2 xx.smt2
sat
(objectives
(r1 (+ (/ 955441.0 1000000.0) (* (- 2.0) epsilon)))
)
Seems a bug in smt.arith.solver=6. Because when I add
(assert (> r1 (/ 955441.0 2000000.0)))
to the formula, z3 returns sat
.
For smtlib2 instance by @amchiclet , both smt.arith.solver=6 and smt.arith.solver=2 can return 189 (at commit f370d8d) Perhaps the version in rise4fun is different from 4.8.8.0.
Thanks, I know what the bug is (a regression), but don't have a fix right now
This is fixed
ba5c9c3883, the results of arith.solver=2 and =6 seem different
(set-logic QF_LIA)
(declare-const i2 Int)
(declare-const i4 Int)
(assert (<= (+ (div 214 214) i2) (* i4 61 61)))
(assert (<= (* i4 61 61) (- 76 i2 483 (- 76 214 483) 483) 483))
(minimize (* i4 61 61))
(minimize (+ 61 i2 76))
(minimize 214)
(check-sat)
(get-objectives)
z3 smt.arith.solver=6 xx.smt2
sat
(objectives
((* i4 61 61) 0)
((+ 61 i2 76) (interval (- 615) (- 132)))
(214 214)
)
z3 smt.arith.solver=6 xx.smt2
sat
(objectives
((* i4 61 61) 0)
((+ 61 i2 76) (- 615))
(214 214)
)
I have version 4.12.2.0 and i have the exact same behavior as described by @amchiclet for the same scenario. Is this an expected behaviour? Thanks.
Z3 version 4.8.8.0 Python version 3.8.2
Here's the code to reproduce the bug.
The code returns 189, when it should be 290.
Changing the constraint
x>=189
tox>=190
gives me 290.Calling
opt.maximize(x)
twice gives me 290.Removing any constraint except the first two, gives me 290.
The rise4fun web interface returns 290 with this code.
Possibly a bug in the Python port.