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

Constructor & Destructor Documentation

◆ __init__()

__init__ ( self,
opt,
value,
is_max )

Definition at line 8045 of file z3py.py.

8045 def __init__(self, opt, value, is_max):
8046 self._opt = opt
8047 self._value = value
8048 self._is_max = is_max
8049

Member Function Documentation

◆ __str__()

__str__ ( self)

Definition at line 8072 of file z3py.py.

8072 def __str__(self):
8073 return "%s:%s" % (self._value, self._is_max)
8074
8075

◆ lower()

lower ( self)

Definition at line 8050 of file z3py.py.

8050 def lower(self):
8051 opt = self._opt
8052 return _to_expr_ref(Z3_optimize_get_lower(opt.ctx.ref(), opt.optimize, self._value), opt.ctx)
8053
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 8058 of file z3py.py.

8058 def lower_values(self):
8059 opt = self._opt
8060 return AstVector(Z3_optimize_get_lower_as_vector(opt.ctx.ref(), opt.optimize, self._value), opt.ctx)
8061
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 8054 of file z3py.py.

8054 def upper(self):
8055 opt = self._opt
8056 return _to_expr_ref(Z3_optimize_get_upper(opt.ctx.ref(), opt.optimize, self._value), opt.ctx)
8057
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 8062 of file z3py.py.

8062 def upper_values(self):
8063 opt = self._opt
8064 return AstVector(Z3_optimize_get_upper_as_vector(opt.ctx.ref(), opt.optimize, self._value), opt.ctx)
8065
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 8066 of file z3py.py.

8066 def value(self):
8067 if self._is_max:
8068 return self.upper()
8069 else:
8070 return self.lower()
8071

Field Documentation

◆ _is_max

_is_max = is_max
protected

Definition at line 8048 of file z3py.py.

◆ _opt

_opt = opt
protected

Definition at line 8046 of file z3py.py.

◆ _value

_value = value
protected

Definition at line 8047 of file z3py.py.