Given that x,y,z = Ints('x y z') and a string like s='x + y + 2*z = 5', is there a quick way to convert s into a z3 expression ? If it’s not possible then it seems I have to do lots of string operations to do the conversion.
Given that x,y,z = Ints(‘x y z’) and a string like s=’x + y
Share
You can use the Python
evalfunction. Here is an example:This script displays
[y = 0, z = 0, x = 5]on my machine.Unfortunately, we can’t execute this script at http://rise4fun.com/z3py. The rise4fun website rejects Python scripts containing
eval(for security reasons).