Say for a python expression, e.g.
float(x + 1 * 2) * 2 == 2
how would I convert this to a z3 expression? Using the obvious ToReal(x + 1 * 2)
does not work.
On a side note, i've used z3.ToReal
and I can't get even simple example to sat, but ToInt
is working as expected. E.g.
from z3 import *
a = Int("a")
b = Real("b")
s = Solver()
s.add(ToReal(a) == 1.1)
s.check()
>>> unsat
s.reset()
s.add(ToInt(b) + 1.1 == 2)
s.check()
>>> sat