3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-23 09:05:31 +00:00

adjusting examples

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
Leonardo de Moura 2012-12-03 15:19:47 -08:00
parent 6d7d205e13
commit 0ec6e2f218
3 changed files with 22 additions and 12 deletions

View file

@ -64,6 +64,10 @@ namespace z3 {
class apply_result;
class fixedpoint;
inline void set_param(char const * param, char const * value) { Z3_global_param_set(param, value); }
inline void set_param(char const * param, bool value) { Z3_global_param_set(param, value ? "true" : "false"); }
inline void set_param(char const * param, int value) { std::ostringstream oss; oss << value; Z3_global_param_set(param, oss.str().c_str()); }
/**
\brief Exception used to sign API usage errors.
*/

View file

@ -198,10 +198,10 @@ def _get_ctx(ctx):
else:
return ctx
def set_option(*args, **kws):
def set_param(*args, **kws):
"""Set Z3 global (or module) parameters.
>>> set_option(precision=10)
>>> set_param(precision=10)
"""
if __debug__:
_z3_assert(len(args) % 2 == 0, "Argument list must have an even number of elements.")
@ -219,10 +219,15 @@ def set_option(*args, **kws):
Z3_global_param_set(str(prev), _to_param_value(a))
prev = None
def get_option(name):
def set_option(*args, **kws):
"""Alias for 'set_param' for backward compatibility.
"""
return set_param(*args, **kws)
def get_param(name):
"""Return the value of a Z3 global (or module) parameter
>>> get_option('nlsat.reorder')
>>> get_param('nlsat.reorder')
'true'
"""
ptr = (ctypes.c_char_p * 1)()