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 8673 of file z3py.py.

Constructor & Destructor Documentation

◆ __init__()

__init__ ( self,
opt,
value,
is_max )

Definition at line 8674 of file z3py.py.

8674 def __init__(self, opt, value, is_max):
8675 self._opt = opt
8676 self._value = value
8677 self._is_max = is_max
8678

Member Function Documentation

◆ __str__()

__str__ ( self)

Definition at line 8701 of file z3py.py.

8701 def __str__(self):
8702 return "%s:%s" % (self._value, self._is_max)
8703
8704

◆ lower()

lower ( self)

Definition at line 8679 of file z3py.py.

8679 def lower(self):
8680 opt = self._opt
8681 return _to_expr_ref(Z3_optimize_get_lower(opt.ctx.ref(), opt.optimize, self._value), opt.ctx)
8682
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 8687 of file z3py.py.

8687 def lower_values(self):
8688 opt = self._opt
8689 return AstVector(Z3_optimize_get_lower_as_vector(opt.ctx.ref(), opt.optimize, self._value), opt.ctx)
8690
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 8683 of file z3py.py.

8683 def upper(self):
8684 opt = self._opt
8685 return _to_expr_ref(Z3_optimize_get_upper(opt.ctx.ref(), opt.optimize, self._value), opt.ctx)
8686
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 8691 of file z3py.py.

8691 def upper_values(self):
8692 opt = self._opt
8693 return AstVector(Z3_optimize_get_upper_as_vector(opt.ctx.ref(), opt.optimize, self._value), opt.ctx)
8694
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 8695 of file z3py.py.

8695 def value(self):
8696 if self._is_max:
8697 return self.upper()
8698 else:
8699 return self.lower()
8700

Field Documentation

◆ _is_max

_is_max = is_max
protected

Definition at line 8677 of file z3py.py.

◆ _opt

_opt = opt
protected

Definition at line 8675 of file z3py.py.

◆ _value

_value = value
protected

Definition at line 8676 of file z3py.py.