z3 - z3py expression simplification -
i trying simplify expression using z3py unable find documentation on different tactics do. best resource have found stack overflow question lists tactics name.
is able link me detailed documentation on tactics available? on line python tutorials not sufficient.
or can recommend better way accomplish this.
an example of problems expression such as:
x < 5, x < 4, x < 3, x = 1
simplify down x = 1
.
using tactic unit-subsume-simplify
appears works example.
but when try more complicated example such x > 1, x < 5, x != 3, x != 4
x > 1, x < 5, x ≠ 3, x ≠ 4
result. when x = 2
.
what best approach achieve type of simplification using z3py?
thanks matt
possible solution:
x = int('x') s = solver() s.add(x < 5, x < 4, x < 3, x == 1) print s.check() m = s.model() print m s1 = solver() s1.add(x > 1, x < 5, x != 3, x != 4) print s1.check() m1 = s1.model() print m1
output:
sat [x = 1] sat [x = 2]
run solution online here
Comments
Post a Comment