Z3
 
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes
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
 
 _value
 
 _is_max
 

Detailed Description

Optimize.

Definition at line 8037 of file z3py.py.

Constructor & Destructor Documentation

◆ __init__()

__init__ (   self,
  opt,
  value,
  is_max 
)

Definition at line 8038 of file z3py.py.

8038 def __init__(self, opt, value, is_max):
8039 self._opt = opt
8040 self._value = value
8041 self._is_max = is_max
8042

Member Function Documentation

◆ __str__()

__str__ (   self)

Definition at line 8065 of file z3py.py.

8065 def __str__(self):
8066 return "%s:%s" % (self._value, self._is_max)
8067
8068

◆ lower()

lower (   self)

Definition at line 8043 of file z3py.py.

8043 def lower(self):
8044 opt = self._opt
8045 return _to_expr_ref(Z3_optimize_get_lower(opt.ctx.ref(), opt.optimize, self._value), opt.ctx)
8046
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 8051 of file z3py.py.

8051 def lower_values(self):
8052 opt = self._opt
8053 return AstVector(Z3_optimize_get_lower_as_vector(opt.ctx.ref(), opt.optimize, self._value), opt.ctx)
8054
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 8047 of file z3py.py.

8047 def upper(self):
8048 opt = self._opt
8049 return _to_expr_ref(Z3_optimize_get_upper(opt.ctx.ref(), opt.optimize, self._value), opt.ctx)
8050
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 8055 of file z3py.py.

8055 def upper_values(self):
8056 opt = self._opt
8057 return AstVector(Z3_optimize_get_upper_as_vector(opt.ctx.ref(), opt.optimize, self._value), opt.ctx)
8058
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 8059 of file z3py.py.

8059 def value(self):
8060 if self._is_max:
8061 return self.upper()
8062 else:
8063 return self.lower()
8064

Referenced by FuncEntry.as_list().

Field Documentation

◆ _is_max

_is_max
protected

Definition at line 8041 of file z3py.py.

◆ _opt

_opt
protected

Definition at line 8039 of file z3py.py.

◆ _value

_value
protected

Definition at line 8040 of file z3py.py.