Z3
 
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes
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
 
 _value
 
 _is_max
 

Detailed Description

Optimize.

Definition at line 8081 of file z3py.py.

Constructor & Destructor Documentation

◆ __init__()

__init__ (   self,
  opt,
  value,
  is_max 
)

Definition at line 8082 of file z3py.py.

8082 def __init__(self, opt, value, is_max):
8083 self._opt = opt
8084 self._value = value
8085 self._is_max = is_max
8086

Member Function Documentation

◆ __str__()

__str__ (   self)

Definition at line 8109 of file z3py.py.

8109 def __str__(self):
8110 return "%s:%s" % (self._value, self._is_max)
8111
8112

◆ lower()

lower (   self)

Definition at line 8087 of file z3py.py.

8087 def lower(self):
8088 opt = self._opt
8089 return _to_expr_ref(Z3_optimize_get_lower(opt.ctx.ref(), opt.optimize, self._value), opt.ctx)
8090
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 8095 of file z3py.py.

8095 def lower_values(self):
8096 opt = self._opt
8097 return AstVector(Z3_optimize_get_lower_as_vector(opt.ctx.ref(), opt.optimize, self._value), opt.ctx)
8098
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 8091 of file z3py.py.

8091 def upper(self):
8092 opt = self._opt
8093 return _to_expr_ref(Z3_optimize_get_upper(opt.ctx.ref(), opt.optimize, self._value), opt.ctx)
8094
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 8099 of file z3py.py.

8099 def upper_values(self):
8100 opt = self._opt
8101 return AstVector(Z3_optimize_get_upper_as_vector(opt.ctx.ref(), opt.optimize, self._value), opt.ctx)
8102
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 8103 of file z3py.py.

8103 def value(self):
8104 if self._is_max:
8105 return self.upper()
8106 else:
8107 return self.lower()
8108

Referenced by FuncEntry.as_list().

Field Documentation

◆ _is_max

_is_max
protected

Definition at line 8085 of file z3py.py.

◆ _opt

_opt
protected

Definition at line 8083 of file z3py.py.

◆ _value

_value
protected

Definition at line 8084 of file z3py.py.