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?