Sometimes, evaluating a boolean expression in a model doesn't return a concrete boolean value even when the expression clearly has a concrete value. I've been able to reduce this to cases involving array expressions such as this test case:
from z3 import *
x = K(IntSort(), 0)
s = Solver()
s.check()
m = s.model()
print m.evaluate(x == Store(x, 0, 1), model_completion=True)
I would expect this to print False
, but instead it prints K(Int, 0) == Store(K(Int, 0), 0, 1)
. Other examples produce similar results. Replacing the first line with x = Array('x', IntSort(), IntSort())
gives the same result (though that's up to the default interpretation). Interestingly, replacing the first line with x = Store(K(IntSort(), 0), 0, 1)
causes the example to print True
.
Is there a way to force Z3 to evaluate such expressions to concrete values?