Z3
Public Member Functions
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)
 

Detailed Description

Optimize.

Definition at line 7367 of file z3py.py.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  opt,
  value,
  is_max 
)

Definition at line 7368 of file z3py.py.

7368  def __init__(self, opt, value, is_max):
7369  self._opt = opt
7370  self._value = value
7371  self._is_max = is_max
7372 

Member Function Documentation

◆ __str__()

def __str__ (   self)

Definition at line 7395 of file z3py.py.

7395  def __str__(self):
7396  return "%s:%s" % (self._value, self._is_max)
7397 
7398 

◆ lower()

def lower (   self)

Definition at line 7373 of file z3py.py.

7373  def lower(self):
7374  opt = self._opt
7375  return _to_expr_ref(Z3_optimize_get_lower(opt.ctx.ref(), opt.optimize, self._value), opt.ctx)
7376 

Referenced by OptimizeObjective.value().

◆ lower_values()

def lower_values (   self)

Definition at line 7381 of file z3py.py.

7381  def lower_values(self):
7382  opt = self._opt
7383  return AstVector(Z3_optimize_get_lower_as_vector(opt.ctx.ref(), opt.optimize, self._value), opt.ctx)
7384 

◆ upper()

def upper (   self)

Definition at line 7377 of file z3py.py.

7377  def upper(self):
7378  opt = self._opt
7379  return _to_expr_ref(Z3_optimize_get_upper(opt.ctx.ref(), opt.optimize, self._value), opt.ctx)
7380 

Referenced by OptimizeObjective.value().

◆ upper_values()

def upper_values (   self)

Definition at line 7385 of file z3py.py.

7385  def upper_values(self):
7386  opt = self._opt
7387  return AstVector(Z3_optimize_get_upper_as_vector(opt.ctx.ref(), opt.optimize, self._value), opt.ctx)
7388 

◆ value()

def value (   self)

Definition at line 7389 of file z3py.py.

7389  def value(self):
7390  if self._is_max:
7391  return self.upper()
7392  else:
7393  return self.lower()
7394 
Z3_optimize_get_lower_as_vector
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 ...
z3py.UserPropagateBase.__init__
def __init__(self, s, ctx=None)
Definition: z3py.py:10582
Z3_optimize_get_lower
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.
Z3_optimize_get_upper
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.
Z3_optimize_get_upper_as_vector
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.