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

Constructor & Destructor Documentation

◆ __init__()

__init__ ( self,
opt,
value,
is_max )

Definition at line 7981 of file z3py.py.

7981 def __init__(self, opt, value, is_max):
7982 self._opt = opt
7983 self._value = value
7984 self._is_max = is_max
7985

Member Function Documentation

◆ __str__()

__str__ ( self)

Definition at line 8008 of file z3py.py.

8008 def __str__(self):
8009 return "%s:%s" % (self._value, self._is_max)
8010
8011

◆ lower()

lower ( self)

Definition at line 7986 of file z3py.py.

7986 def lower(self):
7987 opt = self._opt
7988 return _to_expr_ref(Z3_optimize_get_lower(opt.ctx.ref(), opt.optimize, self._value), opt.ctx)
7989
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 7994 of file z3py.py.

7994 def lower_values(self):
7995 opt = self._opt
7996 return AstVector(Z3_optimize_get_lower_as_vector(opt.ctx.ref(), opt.optimize, self._value), opt.ctx)
7997
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 7990 of file z3py.py.

7990 def upper(self):
7991 opt = self._opt
7992 return _to_expr_ref(Z3_optimize_get_upper(opt.ctx.ref(), opt.optimize, self._value), opt.ctx)
7993
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 7998 of file z3py.py.

7998 def upper_values(self):
7999 opt = self._opt
8000 return AstVector(Z3_optimize_get_upper_as_vector(opt.ctx.ref(), opt.optimize, self._value), opt.ctx)
8001
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 8002 of file z3py.py.

8002 def value(self):
8003 if self._is_max:
8004 return self.upper()
8005 else:
8006 return self.lower()
8007

Field Documentation

◆ _is_max

_is_max = is_max
protected

Definition at line 7984 of file z3py.py.

◆ _opt

_opt = opt
protected

Definition at line 7982 of file z3py.py.

◆ _value

_value = value
protected

Definition at line 7983 of file z3py.py.