Z3
Loading...
Searching...
No Matches
OptimizeObjective Class Reference

Optimize. More...

Public Member Functions

 __init__ (self, opt, value, is_max)
 lower (self)
 upper (self)
 lower_values (self)
 upper_values (self)
 value (self)
 __str__ (self)

Protected Attributes

 _opt = opt
 _value = value
 _is_max = is_max

Detailed Description

Optimize.

Definition at line 8540 of file z3py.py.

Constructor & Destructor Documentation

◆ __init__()

__init__ ( self,
opt,
value,
is_max )

Definition at line 8541 of file z3py.py.

8541 def __init__(self, opt, value, is_max):
8542 self._opt = opt
8543 self._value = value
8544 self._is_max = is_max
8545

Member Function Documentation

◆ __str__()

__str__ ( self)

Definition at line 8568 of file z3py.py.

8568 def __str__(self):
8569 return "%s:%s" % (self._value, self._is_max)
8570
8571

◆ lower()

lower ( self)

Definition at line 8546 of file z3py.py.

8546 def lower(self):
8547 opt = self._opt
8548 return _to_expr_ref(Z3_optimize_get_lower(opt.ctx.ref(), opt.optimize, self._value), opt.ctx)
8549
Z3_ast Z3_API Z3_optimize_get_lower(Z3_context c, Z3_optimize o, unsigned idx)
Retrieve lower bound value or approximation for the i'th optimization objective.

◆ lower_values()

lower_values ( self)

Definition at line 8554 of file z3py.py.

8554 def lower_values(self):
8555 opt = self._opt
8556 return AstVector(Z3_optimize_get_lower_as_vector(opt.ctx.ref(), opt.optimize, self._value), opt.ctx)
8557
Z3_ast_vector Z3_API Z3_optimize_get_lower_as_vector(Z3_context c, Z3_optimize o, unsigned idx)
Retrieve lower bound value or approximation for the i'th optimization objective. The returned vector ...

◆ upper()

upper ( self)

Definition at line 8550 of file z3py.py.

8550 def upper(self):
8551 opt = self._opt
8552 return _to_expr_ref(Z3_optimize_get_upper(opt.ctx.ref(), opt.optimize, self._value), opt.ctx)
8553
Z3_ast Z3_API Z3_optimize_get_upper(Z3_context c, Z3_optimize o, unsigned idx)
Retrieve upper bound value or approximation for the i'th optimization objective.

◆ upper_values()

upper_values ( self)

Definition at line 8558 of file z3py.py.

8558 def upper_values(self):
8559 opt = self._opt
8560 return AstVector(Z3_optimize_get_upper_as_vector(opt.ctx.ref(), opt.optimize, self._value), opt.ctx)
8561
Z3_ast_vector Z3_API Z3_optimize_get_upper_as_vector(Z3_context c, Z3_optimize o, unsigned idx)
Retrieve upper bound value or approximation for the i'th optimization objective.

◆ value()

value ( self)

Definition at line 8562 of file z3py.py.

8562 def value(self):
8563 if self._is_max:
8564 return self.upper()
8565 else:
8566 return self.lower()
8567

Field Documentation

◆ _is_max

_is_max = is_max
protected

Definition at line 8544 of file z3py.py.

◆ _opt

_opt = opt
protected

Definition at line 8542 of file z3py.py.

◆ _value

_value = value
protected

Definition at line 8543 of file z3py.py.