I'm getting unexpected results with some script using Python API of Z3. I think that I'm misunderstanding some process or simply using some command wrong. For example, suppose I have the following script:
from z3 import *
x = Int('x')
def g(x):
if x == 0:
return 1
elif x > 0:
return x**(x+1)
s = Solver()
s.add(g(x) > x)
print s.check()
if s.check()== sat:
m = s.model()
m.evaluate(x, model_completion=True)
print m
This will return the following output:
sat
[x = 0]
That it's OK, but if I substitute s.add(g(x) > x)
by s.add(x > 1, g(x) > x)
, this returns unsat
. I was expecting something like:
sat
[x = 2]
Can anybody help me to understand what's going on?