mirror of
https://github.com/Z3Prover/z3
synced 2025-04-23 17:15:31 +00:00
parent
ecb5c45d6f
commit
dc932a93e2
1 changed files with 2 additions and 0 deletions
|
@ -7241,11 +7241,13 @@ class Optimize(Z3PPObject):
|
|||
def assert_exprs(self, *args):
|
||||
"""Assert constraints as background axioms for the optimize solver."""
|
||||
args = _get_args(args)
|
||||
s = BoolSort(self.ctx)
|
||||
for arg in args:
|
||||
if isinstance(arg, Goal) or isinstance(arg, AstVector):
|
||||
for f in arg:
|
||||
Z3_optimize_assert(self.ctx.ref(), self.optimize, f.as_ast())
|
||||
else:
|
||||
arg = s.cast(arg)
|
||||
Z3_optimize_assert(self.ctx.ref(), self.optimize, arg.as_ast())
|
||||
|
||||
def add(self, *args):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue