Z3
 
Loading...
Searching...
No Matches
ParamsRef Class Reference

Parameter Sets. More...

Public Member Functions

 __init__ (self, ctx=None, params=None)
 
 __deepcopy__ (self, memo={})
 
 __del__ (self)
 
 set (self, name, val)
 
 __repr__ (self)
 
 validate (self, ds)
 

Data Fields

 ctx = _get_ctx(ctx)
 
 params = Z3_mk_params(self.ctx.ref())
 

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

Constructor & Destructor Documentation

◆ __init__()

__init__ ( self,
ctx = None,
params = None )

Definition at line 5516 of file z3py.py.

5516 def __init__(self, ctx=None, params=None):
5517 self.ctx = _get_ctx(ctx)
5518 if params is None:
5519 self.params = Z3_mk_params(self.ctx.ref())
5520 else:
5521 self.params = params
5522 Z3_params_inc_ref(self.ctx.ref(), self.params)
5523
Z3_params Z3_API Z3_mk_params(Z3_context c)
Create a Z3 (empty) parameter set. Starting at Z3 4.0, parameter sets are used to configure many comp...
void Z3_API Z3_params_inc_ref(Z3_context c, Z3_params p)
Increment the reference counter of the given parameter set.

◆ __del__()

__del__ ( self)

Definition at line 5527 of file z3py.py.

5527 def __del__(self):
5528 if self.ctx.ref() is not None and Z3_params_dec_ref is not None:
5529 Z3_params_dec_ref(self.ctx.ref(), self.params)
5530
void Z3_API Z3_params_dec_ref(Z3_context c, Z3_params p)
Decrement the reference counter of the given parameter set.

Member Function Documentation

◆ __deepcopy__()

__deepcopy__ ( self,
memo = {} )

Definition at line 5524 of file z3py.py.

5524 def __deepcopy__(self, memo={}):
5525 return ParamsRef(self.ctx, self.params)
5526

◆ __repr__()

__repr__ ( self)

Definition at line 5548 of file z3py.py.

5548 def __repr__(self):
5549 return Z3_params_to_string(self.ctx.ref(), self.params)
5550
Z3_string Z3_API Z3_params_to_string(Z3_context c, Z3_params p)
Convert a parameter set into a string. This function is mainly used for printing the contents of a pa...

◆ set()

set ( self,
name,
val )
Set parameter name with value val.

Definition at line 5531 of file z3py.py.

5531 def set(self, name, val):
5532 """Set parameter name with value val."""
5533 if z3_debug():
5534 _z3_assert(isinstance(name, str), "parameter name must be a string")
5535 name_sym = to_symbol(name, self.ctx)
5536 if isinstance(val, bool):
5537 Z3_params_set_bool(self.ctx.ref(), self.params, name_sym, val)
5538 elif _is_int(val):
5539 Z3_params_set_uint(self.ctx.ref(), self.params, name_sym, val)
5540 elif isinstance(val, float):
5541 Z3_params_set_double(self.ctx.ref(), self.params, name_sym, val)
5542 elif isinstance(val, str):
5543 Z3_params_set_symbol(self.ctx.ref(), self.params, name_sym, to_symbol(val, self.ctx))
5544 else:
5545 if z3_debug():
5546 _z3_assert(False, "invalid parameter value")
5547
void Z3_API Z3_params_set_bool(Z3_context c, Z3_params p, Z3_symbol k, bool v)
Add a Boolean parameter k with value v to the parameter set p.
void Z3_API Z3_params_set_double(Z3_context c, Z3_params p, Z3_symbol k, double v)
Add a double parameter k with value v to the parameter set p.
void Z3_API Z3_params_set_uint(Z3_context c, Z3_params p, Z3_symbol k, unsigned v)
Add a unsigned parameter k with value v to the parameter set p.
void Z3_API Z3_params_set_symbol(Z3_context c, Z3_params p, Z3_symbol k, Z3_symbol v)
Add a symbol parameter k with value v to the parameter set p.

◆ validate()

validate ( self,
ds )

Definition at line 5551 of file z3py.py.

5551 def validate(self, ds):
5552 _z3_assert(isinstance(ds, ParamDescrsRef), "parameter description set expected")
5553 Z3_params_validate(self.ctx.ref(), self.params, ds.descr)
5554
5555
void Z3_API Z3_params_validate(Z3_context c, Z3_params p, Z3_param_descrs d)
Validate the parameter set p against the parameter description set d.

Field Documentation

◆ ctx

ctx = _get_ctx(ctx)

Definition at line 5517 of file z3py.py.

Referenced by AstMap.__contains__(), AstVector.__copy__(), FuncInterp.__copy__(), Goal.__copy__(), ModelRef.__copy__(), AstMap.__deepcopy__(), AstVector.__deepcopy__(), FuncEntry.__deepcopy__(), FuncInterp.__deepcopy__(), Goal.__deepcopy__(), ModelRef.__deepcopy__(), ParamDescrsRef.__deepcopy__(), __deepcopy__(), Statistics.__deepcopy__(), AstMap.__del__(), AstVector.__del__(), FuncEntry.__del__(), FuncInterp.__del__(), Goal.__del__(), ModelRef.__del__(), ParamDescrsRef.__del__(), __del__(), Solver.__del__(), Statistics.__del__(), AstMap.__getitem__(), AstVector.__getitem__(), ModelRef.__getitem__(), Statistics.__getitem__(), AstMap.__len__(), AstVector.__len__(), ModelRef.__len__(), Statistics.__len__(), AstMap.__repr__(), ParamDescrsRef.__repr__(), __repr__(), Statistics.__repr__(), AstMap.__setitem__(), AstVector.__setitem__(), FuncEntry.arg_value(), FuncInterp.arity(), Goal.as_expr(), Solver.assert_and_track(), Goal.assert_exprs(), Solver.assert_exprs(), Solver.check(), Goal.convert_model(), ModelRef.decls(), Goal.depth(), Goal.dimacs(), FuncInterp.else_value(), FuncInterp.entry(), AstMap.erase(), ModelRef.eval(), Goal.get(), ParamDescrsRef.get_documentation(), ModelRef.get_interp(), Statistics.get_key_value(), ParamDescrsRef.get_kind(), ParamDescrsRef.get_name(), ModelRef.get_sort(), ModelRef.get_universe(), Goal.inconsistent(), AstMap.keys(), Statistics.keys(), Solver.model(), FuncEntry.num_args(), FuncInterp.num_entries(), Solver.num_scopes(), ModelRef.num_sorts(), Solver.pop(), Goal.prec(), ModelRef.project(), ModelRef.project_with_witness(), AstVector.push(), Solver.push(), AstMap.reset(), Solver.reset(), AstVector.resize(), set(), Solver.set(), AstVector.sexpr(), Goal.sexpr(), ModelRef.sexpr(), Goal.size(), ParamDescrsRef.size(), AstVector.translate(), Goal.translate(), ModelRef.translate(), validate(), and FuncEntry.value().

◆ params

params = Z3_mk_params(self.ctx.ref())

Definition at line 5519 of file z3py.py.

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