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

Constructor & Destructor Documentation

◆ __init__()

__init__ ( self,
opt,
value,
is_max )

Definition at line 8010 of file z3py.py.

8010 def __init__(self, opt, value, is_max):
8011 self._opt = opt
8012 self._value = value
8013 self._is_max = is_max
8014

Member Function Documentation

◆ __str__()

__str__ ( self)

Definition at line 8037 of file z3py.py.

8037 def __str__(self):
8038 return "%s:%s" % (self._value, self._is_max)
8039
8040

◆ lower()

lower ( self)

Definition at line 8015 of file z3py.py.

8015 def lower(self):
8016 opt = self._opt
8017 return _to_expr_ref(Z3_optimize_get_lower(opt.ctx.ref(), opt.optimize, self._value), opt.ctx)
8018
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 8023 of file z3py.py.

8023 def lower_values(self):
8024 opt = self._opt
8025 return AstVector(Z3_optimize_get_lower_as_vector(opt.ctx.ref(), opt.optimize, self._value), opt.ctx)
8026
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 8019 of file z3py.py.

8019 def upper(self):
8020 opt = self._opt
8021 return _to_expr_ref(Z3_optimize_get_upper(opt.ctx.ref(), opt.optimize, self._value), opt.ctx)
8022
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 8027 of file z3py.py.

8027 def upper_values(self):
8028 opt = self._opt
8029 return AstVector(Z3_optimize_get_upper_as_vector(opt.ctx.ref(), opt.optimize, self._value), opt.ctx)
8030
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 8031 of file z3py.py.

8031 def value(self):
8032 if self._is_max:
8033 return self.upper()
8034 else:
8035 return self.lower()
8036

Field Documentation

◆ _is_max

_is_max = is_max
protected

Definition at line 8013 of file z3py.py.

◆ _opt

_opt = opt
protected

Definition at line 8011 of file z3py.py.

◆ _value

_value = value
protected

Definition at line 8012 of file z3py.py.