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

Constructor & Destructor Documentation

◆ __init__()

__init__ ( self,
opt,
value,
is_max )

Definition at line 8105 of file z3py.py.

8105 def __init__(self, opt, value, is_max):
8106 self._opt = opt
8107 self._value = value
8108 self._is_max = is_max
8109

Member Function Documentation

◆ __str__()

__str__ ( self)

Definition at line 8132 of file z3py.py.

8132 def __str__(self):
8133 return "%s:%s" % (self._value, self._is_max)
8134
8135

◆ lower()

lower ( self)

Definition at line 8110 of file z3py.py.

8110 def lower(self):
8111 opt = self._opt
8112 return _to_expr_ref(Z3_optimize_get_lower(opt.ctx.ref(), opt.optimize, self._value), opt.ctx)
8113
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 8118 of file z3py.py.

8118 def lower_values(self):
8119 opt = self._opt
8120 return AstVector(Z3_optimize_get_lower_as_vector(opt.ctx.ref(), opt.optimize, self._value), opt.ctx)
8121
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 8114 of file z3py.py.

8114 def upper(self):
8115 opt = self._opt
8116 return _to_expr_ref(Z3_optimize_get_upper(opt.ctx.ref(), opt.optimize, self._value), opt.ctx)
8117
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 8122 of file z3py.py.

8122 def upper_values(self):
8123 opt = self._opt
8124 return AstVector(Z3_optimize_get_upper_as_vector(opt.ctx.ref(), opt.optimize, self._value), opt.ctx)
8125
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 8126 of file z3py.py.

8126 def value(self):
8127 if self._is_max:
8128 return self.upper()
8129 else:
8130 return self.lower()
8131

Field Documentation

◆ _is_max

_is_max = is_max
protected

Definition at line 8108 of file z3py.py.

◆ _opt

_opt = opt
protected

Definition at line 8106 of file z3py.py.

◆ _value

_value = value
protected

Definition at line 8107 of file z3py.py.