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

Constructor & Destructor Documentation

◆ __init__()

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

Definition at line 5472 of file z3py.py.

5472 def __init__(self, ctx=None, params=None):
5473 self.ctx = _get_ctx(ctx)
5474 if params is None:
5475 self.params = Z3_mk_params(self.ctx.ref())
5476 else:
5477 self.params = params
5478 Z3_params_inc_ref(self.ctx.ref(), self.params)
5479
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 5483 of file z3py.py.

5483 def __del__(self):
5484 if self.ctx.ref() is not None and Z3_params_dec_ref is not None:
5485 Z3_params_dec_ref(self.ctx.ref(), self.params)
5486
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 5480 of file z3py.py.

5480 def __deepcopy__(self, memo={}):
5481 return ParamsRef(self.ctx, self.params)
5482

◆ __repr__()

__repr__ ( self)

Definition at line 5504 of file z3py.py.

5504 def __repr__(self):
5505 return Z3_params_to_string(self.ctx.ref(), self.params)
5506
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 5487 of file z3py.py.

5487 def set(self, name, val):
5488 """Set parameter name with value val."""
5489 if z3_debug():
5490 _z3_assert(isinstance(name, str), "parameter name must be a string")
5491 name_sym = to_symbol(name, self.ctx)
5492 if isinstance(val, bool):
5493 Z3_params_set_bool(self.ctx.ref(), self.params, name_sym, val)
5494 elif _is_int(val):
5495 Z3_params_set_uint(self.ctx.ref(), self.params, name_sym, val)
5496 elif isinstance(val, float):
5497 Z3_params_set_double(self.ctx.ref(), self.params, name_sym, val)
5498 elif isinstance(val, str):
5499 Z3_params_set_symbol(self.ctx.ref(), self.params, name_sym, to_symbol(val, self.ctx))
5500 else:
5501 if z3_debug():
5502 _z3_assert(False, "invalid parameter value")
5503
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 5507 of file z3py.py.

5507 def validate(self, ds):
5508 _z3_assert(isinstance(ds, ParamDescrsRef), "parameter description set expected")
5509 Z3_params_validate(self.ctx.ref(), self.params, ds.descr)
5510
5511
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 5473 of file z3py.py.

Referenced by ArithRef.__add__(), BitVecRef.__add__(), BitVecRef.__and__(), FuncDeclRef.__call__(), AstMap.__contains__(), AstRef.__copy__(), AstVector.__copy__(), FuncInterp.__copy__(), Goal.__copy__(), ModelRef.__copy__(), AstMap.__deepcopy__(), AstRef.__deepcopy__(), AstVector.__deepcopy__(), Datatype.__deepcopy__(), FuncEntry.__deepcopy__(), FuncInterp.__deepcopy__(), Goal.__deepcopy__(), ModelRef.__deepcopy__(), ParamDescrsRef.__deepcopy__(), ParamsRef.__deepcopy__(), Statistics.__deepcopy__(), AstMap.__del__(), AstRef.__del__(), AstVector.__del__(), Context.__del__(), FuncEntry.__del__(), FuncInterp.__del__(), Goal.__del__(), ModelRef.__del__(), ParamDescrsRef.__del__(), ParamsRef.__del__(), ScopedConstructor.__del__(), ScopedConstructorList.__del__(), Solver.__del__(), Statistics.__del__(), ArithRef.__div__(), BitVecRef.__div__(), ExprRef.__eq__(), ArithRef.__ge__(), BitVecRef.__ge__(), AstMap.__getitem__(), AstVector.__getitem__(), ModelRef.__getitem__(), Statistics.__getitem__(), ArithRef.__gt__(), BitVecRef.__gt__(), BitVecRef.__invert__(), ArithRef.__le__(), BitVecRef.__le__(), AstMap.__len__(), AstVector.__len__(), ModelRef.__len__(), Statistics.__len__(), BitVecRef.__lshift__(), ArithRef.__lt__(), BitVecRef.__lt__(), ArithRef.__mod__(), BitVecRef.__mod__(), ArithRef.__mul__(), BitVecRef.__mul__(), BoolRef.__mul__(), ExprRef.__ne__(), ArithRef.__neg__(), BitVecRef.__neg__(), BitVecRef.__or__(), ArithRef.__pow__(), ArithRef.__radd__(), BitVecRef.__radd__(), BitVecRef.__rand__(), ArithRef.__rdiv__(), BitVecRef.__rdiv__(), AstMap.__repr__(), ParamDescrsRef.__repr__(), ParamsRef.__repr__(), Statistics.__repr__(), BitVecRef.__rlshift__(), ArithRef.__rmod__(), BitVecRef.__rmod__(), ArithRef.__rmul__(), BitVecRef.__rmul__(), BitVecRef.__ror__(), ArithRef.__rpow__(), BitVecRef.__rrshift__(), BitVecRef.__rshift__(), ArithRef.__rsub__(), BitVecRef.__rsub__(), BitVecRef.__rxor__(), AstMap.__setitem__(), AstVector.__setitem__(), ArithRef.__sub__(), BitVecRef.__sub__(), BitVecRef.__xor__(), DatatypeSortRef.accessor(), ExprRef.arg(), FuncEntry.arg_value(), FuncInterp.arity(), Goal.as_expr(), Solver.assert_and_track(), Goal.assert_exprs(), Solver.assert_exprs(), QuantifierRef.body(), Solver.check(), Goal.convert_model(), AstRef.ctx_ref(), ExprRef.decl(), ModelRef.decls(), ArrayRef.default(), RatNumRef.denominator(), Goal.depth(), Goal.dimacs(), FuncDeclRef.domain(), ArraySortRef.domain_n(), 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(), SortRef.name(), QuantifierRef.no_pattern(), FuncEntry.num_args(), FuncInterp.num_entries(), Solver.num_scopes(), ModelRef.num_sorts(), FuncDeclRef.params(), QuantifierRef.pattern(), AlgebraicNumRef.poly(), Solver.pop(), Goal.prec(), AstVector.push(), Solver.push(), QuantifierRef.qid(), ArraySortRef.range(), FuncDeclRef.range(), DatatypeSortRef.recognizer(), Context.ref(), AstMap.reset(), Solver.reset(), AstVector.resize(), ParamsRef.set(), Solver.set(), AstVector.sexpr(), Goal.sexpr(), ModelRef.sexpr(), Goal.size(), ParamDescrsRef.size(), QuantifierRef.skolem_id(), AstRef.translate(), AstVector.translate(), Goal.translate(), ModelRef.translate(), ParamsRef.validate(), FuncEntry.value(), QuantifierRef.var_name(), and QuantifierRef.var_sort().

◆ params

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