mirror of
https://github.com/Z3Prover/z3
synced 2025-04-10 19:27:06 +00:00
have add_soft accept an interable of Booleans.
This commit is contained in:
parent
7d60d8462d
commit
2646e0a1c0
|
@ -7490,6 +7490,11 @@ class Optimize(Z3PPObject):
|
|||
if id is None:
|
||||
id = ""
|
||||
id = to_symbol(id, self.ctx)
|
||||
if isinstance(arg, iterable):
|
||||
for a in arg:
|
||||
v = Z3_optimize_assert_soft(self.ctx.ref(), self.optimize, a.as_ast(), weight, id)
|
||||
yield OptimizeObjective(self, v, False)
|
||||
return
|
||||
v = Z3_optimize_assert_soft(self.ctx.ref(), self.optimize, arg.as_ast(), weight, id)
|
||||
return OptimizeObjective(self, v, False)
|
||||
|
||||
|
|
Loading…
Reference in a new issue