Z3
Public Member Functions | Data Fields
ParamsRef Class Reference

Parameter Sets. More...

Public Member Functions

def __init__
 
def __del__ (self)
 
def set (self, name, val)
 
def __repr__ (self)
 
def validate (self, ds)
 

Data Fields

 ctx
 
 params
 

Detailed Description

Parameter Sets.

Set of parameters used to configure Solvers, Tactics and Simplifiers in Z3.

Consider using the function `args2params` to create instances of this object.

Definition at line 4430 of file z3py.py.

Constructor & Destructor Documentation

def __init__ (   self,
  ctx = None 
)

Definition at line 4435 of file z3py.py.

4435  def __init__(self, ctx=None):
4436  self.ctx = _get_ctx(ctx)
4437  self.params = Z3_mk_params(self.ctx.ref())
4438  Z3_params_inc_ref(self.ctx.ref(), self.params)
4439 
void Z3_API Z3_params_inc_ref(__in Z3_context c, __in Z3_params p)
Increment the reference counter of the given parameter set.
Z3_params Z3_API Z3_mk_params(__in Z3_context c)
Create a Z3 (empty) parameter set. Starting at Z3 4.0, parameter sets are used to configure many comp...
def __init__
Definition: z3py.py:4435
def __del__ (   self)

Definition at line 4440 of file z3py.py.

4440  def __del__(self):
4441  Z3_params_dec_ref(self.ctx.ref(), self.params)
4442 
void Z3_API Z3_params_dec_ref(__in Z3_context c, __in Z3_params p)
Decrement the reference counter of the given parameter set.
def __del__(self)
Definition: z3py.py:4440

Member Function Documentation

def __repr__ (   self)

Definition at line 4460 of file z3py.py.

4460  def __repr__(self):
4461  return Z3_params_to_string(self.ctx.ref(), self.params)
4462 
def __repr__(self)
Definition: z3py.py:4460
Z3_string Z3_API Z3_params_to_string(__in Z3_context c, __in Z3_params p)
Convert a parameter set into a string. This function is mainly used for printing the contents of a pa...
def set (   self,
  name,
  val 
)
Set parameter name with value val.

Definition at line 4443 of file z3py.py.

4443  def set(self, name, val):
4444  """Set parameter name with value val."""
4445  if __debug__:
4446  _z3_assert(isinstance(name, str), "parameter name must be a string")
4447  name_sym = to_symbol(name, self.ctx)
4448  if isinstance(val, bool):
4449  Z3_params_set_bool(self.ctx.ref(), self.params, name_sym, val)
4450  elif isinstance(val, int):
4451  Z3_params_set_uint(self.ctx.ref(), self.params, name_sym, val)
4452  elif isinstance(val, float):
4453  Z3_params_set_double(self.ctx.ref(), self.params, name_sym, val)
4454  elif isinstance(val, str):
4455  Z3_params_set_symbol(self.ctx.ref(), self.params, name_sym, to_symbol(val, self.ctx))
4456  else:
4457  if __debug__:
4458  _z3_assert(False, "invalid parameter value")
4459 
void Z3_API Z3_params_set_symbol(__in Z3_context c, __in Z3_params p, __in Z3_symbol k, __in Z3_symbol v)
Add a symbol parameter k with value v to the parameter set p.
void Z3_API Z3_params_set_uint(__in Z3_context c, __in Z3_params p, __in Z3_symbol k, __in unsigned v)
Add a unsigned parameter k with value v to the parameter set p.
void Z3_API Z3_params_set_double(__in Z3_context c, __in Z3_params p, __in Z3_symbol k, __in double v)
Add a double parameter k with value v to the parameter set p.
def set(self, name, val)
Definition: z3py.py:4443
void Z3_API Z3_params_set_bool(__in Z3_context c, __in Z3_params p, __in Z3_symbol k, __in Z3_bool v)
Add a Boolean parameter k with value v to the parameter set p.
def to_symbol
Definition: z3py.py:94
def validate (   self,
  ds 
)

Definition at line 4463 of file z3py.py.

4463  def validate(self, ds):
4464  _z3_assert(isinstance(ds, ParamDescrsRef), "parameter description set expected")
4465  Z3_params_validate(self.ctx.ref(), self.params, ds.descr)
4466 
def validate(self, ds)
Definition: z3py.py:4463
void Z3_API Z3_params_validate(__in Z3_context c, __in Z3_params p, __in Z3_param_descrs d)
Validate the parameter set p against the parameter description set d.

Field Documentation

ctx
params

Definition at line 4437 of file z3py.py.

Referenced by ParamsRef.__del__(), ParamsRef.__repr__(), ParamsRef.set(), and ParamsRef.validate().