Reputation: 30418
With the z3/python web interface, if I ask:
x = Real ('x')
solve(x * x == 2, show=True)
I nicely get:
Problem:
[x·x = 2]
Solution:
[x = -1.4142135623?]
I thought the following smt-lib2 script would have the same solution:
(set-option :produce-models true)
(declare-fun s0 () Real)
(assert (= 2.0 (* s0 s0)))
(check-sat)
Alas, I get unknown
with z3 (v3.2).
I suspect the problem is with the non-linear term (* s0 s0)
, which the python interface somehow doesn't suffer from. Is there a way to code the same in smt-lib2 to get a model?
Upvotes: 1
Views: 896
Reputation: 41290
Try your example with Z3 web interface, I get a result of sat
.
Z3 web interface and Z3Py are based on Z3 v4.0, so I think the problem is fixed in the upcoming release.
Upvotes: 1