Z3
 
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes
OptimizeObjective Class Reference

Optimize. More...

Public Member Functions

def __init__ (self, opt, value, is_max)
 
def lower (self)
 
def upper (self)
 
def lower_values (self)
 
def upper_values (self)
 
def value (self)
 
def __str__ (self)
 

Protected Attributes

 _opt
 
 _value
 
 _is_max
 

Detailed Description

Optimize.

Definition at line 7823 of file z3py.py.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  opt,
  value,
  is_max 
)

Definition at line 7824 of file z3py.py.

7824 def __init__(self, opt, value, is_max):
7825 self._opt = opt
7826 self._value = value
7827 self._is_max = is_max
7828

Member Function Documentation

◆ __str__()

def __str__ (   self)

Definition at line 7851 of file z3py.py.

7851 def __str__(self):
7852 return "%s:%s" % (self._value, self._is_max)
7853
7854

◆ lower()

def lower (   self)

Definition at line 7829 of file z3py.py.

7829 def lower(self):
7830 opt = self._opt
7831 return _to_expr_ref(Z3_optimize_get_lower(opt.ctx.ref(), opt.optimize, self._value), opt.ctx)
7832
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.

Referenced by OptimizeObjective.value().

◆ lower_values()

def lower_values (   self)

Definition at line 7837 of file z3py.py.

7837 def lower_values(self):
7838 opt = self._opt
7839 return AstVector(Z3_optimize_get_lower_as_vector(opt.ctx.ref(), opt.optimize, self._value), opt.ctx)
7840
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()

def upper (   self)

Definition at line 7833 of file z3py.py.

7833 def upper(self):
7834 opt = self._opt
7835 return _to_expr_ref(Z3_optimize_get_upper(opt.ctx.ref(), opt.optimize, self._value), opt.ctx)
7836
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.

Referenced by OptimizeObjective.value().

◆ upper_values()

def upper_values (   self)

Definition at line 7841 of file z3py.py.

7841 def upper_values(self):
7842 opt = self._opt
7843 return AstVector(Z3_optimize_get_upper_as_vector(opt.ctx.ref(), opt.optimize, self._value), opt.ctx)
7844
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()

def value (   self)

Definition at line 7845 of file z3py.py.

7845 def value(self):
7846 if self._is_max:
7847 return self.upper()
7848 else:
7849 return self.lower()
7850

Referenced by FuncEntry.as_list().

Field Documentation

◆ _is_max

_is_max
protected

Definition at line 7827 of file z3py.py.

Referenced by OptimizeObjective.__str__(), and OptimizeObjective.value().

◆ _opt

_opt
protected

◆ _value

_value
protected