You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Dear amazing Z3 devs / community. I am seeing some behavior I don't understand from a simple optimization when I have two objectives and the first has a symmetry broken by the second objective. Here is a minimal repro:
import z3
v1 = z3.Bool("1exist")
v2 = z3.Bool("2exist")
s2 = z3.Int("2start")
#constraint is v1 xor v2
constraints = [z3.Xor(v1, v2)]
#first objective is optimal if either v1 or v2 is true
obj1 = z3.If(v1, 60, 0) + z3.If(v2, 60, 0)
#second objective is optimal if v2 is true and s2 is 0
obj2 = z3.If(v2, z3.If(s2 == 0, 10, 0), 0)
solver = z3.Optimize()
z3.set_param(verbose=1)
solver.assert_exprs(constraints)
objectives = [obj1, obj2]
objs = [solver.maximize(ob) for ob in objectives]
result=solver.check()
print(f"result: {result}, model: {solver.model()}")
bounds = [(ob.lower(),ob.upper()) for ob in objs]
print(f"bounds {bounds}")
Dear amazing Z3 devs / community. I am seeing some behavior I don't understand from a simple optimization when I have two objectives and the first has a symmetry broken by the second objective. Here is a minimal repro:
this yields:
This is not the global optimum of the (lexicographically ordered) objective, which would be
model: [1exist = False, 2exist = True, 2start = 0]
.Is this the correct behavior due to subtleties I'm missing? A bug? Thanks for your help!
The text was updated successfully, but these errors were encountered: