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

Constructor & Destructor Documentation

◆ __init__()

__init__ ( self,
opt,
value,
is_max )

Definition at line 8152 of file z3py.py.

8152 def __init__(self, opt, value, is_max):
8153 self._opt = opt
8154 self._value = value
8155 self._is_max = is_max
8156

Member Function Documentation

◆ __str__()

__str__ ( self)

Definition at line 8179 of file z3py.py.

8179 def __str__(self):
8180 return "%s:%s" % (self._value, self._is_max)
8181
8182

◆ lower()

lower ( self)

Definition at line 8157 of file z3py.py.

8157 def lower(self):
8158 opt = self._opt
8159 return _to_expr_ref(Z3_optimize_get_lower(opt.ctx.ref(), opt.optimize, self._value), opt.ctx)
8160
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 8165 of file z3py.py.

8165 def lower_values(self):
8166 opt = self._opt
8167 return AstVector(Z3_optimize_get_lower_as_vector(opt.ctx.ref(), opt.optimize, self._value), opt.ctx)
8168
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 8161 of file z3py.py.

8161 def upper(self):
8162 opt = self._opt
8163 return _to_expr_ref(Z3_optimize_get_upper(opt.ctx.ref(), opt.optimize, self._value), opt.ctx)
8164
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 8169 of file z3py.py.

8169 def upper_values(self):
8170 opt = self._opt
8171 return AstVector(Z3_optimize_get_upper_as_vector(opt.ctx.ref(), opt.optimize, self._value), opt.ctx)
8172
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 8173 of file z3py.py.

8173 def value(self):
8174 if self._is_max:
8175 return self.upper()
8176 else:
8177 return self.lower()
8178

Field Documentation

◆ _is_max

_is_max = is_max
protected

Definition at line 8155 of file z3py.py.

◆ _opt

_opt = opt
protected

Definition at line 8153 of file z3py.py.

◆ _value

_value = value
protected

Definition at line 8154 of file z3py.py.