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

added Z3_global_param_reset_all API

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
Leonardo de Moura 2012-12-04 11:55:12 -08:00
parent 7d24cd4ae3
commit 92a29b1e43
7 changed files with 56 additions and 71 deletions

View file

@ -43,6 +43,13 @@ extern "C" {
}
}
void Z3_API Z3_global_param_reset_all() {
memory::initialize(UINT_MAX);
LOG_Z3_global_param_reset_all();
gparams::reset();
env_params::updt_params();
}
std::string g_Z3_global_param_get_buffer;
Z3_bool_opt Z3_API Z3_global_param_get(Z3_string param_id, Z3_string_ptr param_value) {

View file

@ -67,6 +67,7 @@ namespace z3 {
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()); }
inline void reset_params() { Z3_global_param_reset_all(); }
/**
\brief Exception used to sign API usage errors.

View file

@ -219,6 +219,11 @@ def set_param(*args, **kws):
Z3_global_param_set(str(prev), _to_param_value(a))
prev = None
def reset_params():
"""Reset all global (or module) parameters.
"""
Z3_global_param_reset_all()
def set_option(*args, **kws):
"""Alias for 'set_param' for backward compatibility.
"""

View file

@ -1260,6 +1260,17 @@ extern "C" {
def_API('Z3_global_param_set', VOID, (_in(STRING), _in(STRING)))
*/
void Z3_API Z3_global_param_set(__in Z3_string param_id, __in Z3_string param_value);
/**
\brief Restore the value of all global (and module) parameters.
This command will not affect already created objects (such as tactics and solvers).
\sa Z3_global_param_set
def_API('Z3_global_param_reset_all', VOID, ())
*/
void Z3_API Z3_global_param_reset_all();
/**
\brief Get a global (or module) parameter.