mirror of
https://github.com/Z3Prover/z3
synced 2025-06-22 05:43:39 +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):
|
def assert_exprs(self, *args):
|
||||||
"""Assert constraints as background axioms for the optimize solver."""
|
"""Assert constraints as background axioms for the optimize solver."""
|
||||||
args = _get_args(args)
|
args = _get_args(args)
|
||||||
|
s = BoolSort(self.ctx)
|
||||||
for arg in args:
|
for arg in args:
|
||||||
if isinstance(arg, Goal) or isinstance(arg, AstVector):
|
if isinstance(arg, Goal) or isinstance(arg, AstVector):
|
||||||
for f in arg:
|
for f in arg:
|
||||||
Z3_optimize_assert(self.ctx.ref(), self.optimize, f.as_ast())
|
Z3_optimize_assert(self.ctx.ref(), self.optimize, f.as_ast())
|
||||||
else:
|
else:
|
||||||
|
arg = s.cast(arg)
|
||||||
Z3_optimize_assert(self.ctx.ref(), self.optimize, arg.as_ast())
|
Z3_optimize_assert(self.ctx.ref(), self.optimize, arg.as_ast())
|
||||||
|
|
||||||
def add(self, *args):
|
def add(self, *args):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue