mirror of
https://github.com/Z3Prover/z3
synced 2025-04-23 09:05:31 +00:00
fixed more problems in the new param framework
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
parent
d634c945bf
commit
6d7d205e13
30 changed files with 185 additions and 168 deletions
|
@ -66,7 +66,7 @@ extern "C" {
|
|||
Z3_TRY;
|
||||
LOG_Z3_params_set_bool(c, p, k, v);
|
||||
RESET_ERROR_CODE();
|
||||
to_params(p)->m_params.set_bool(to_symbol(k), v != 0);
|
||||
to_params(p)->m_params.set_bool(norm_param_name(to_symbol(k)).c_str(), v != 0);
|
||||
Z3_CATCH;
|
||||
}
|
||||
|
||||
|
@ -77,7 +77,7 @@ extern "C" {
|
|||
Z3_TRY;
|
||||
LOG_Z3_params_set_uint(c, p, k, v);
|
||||
RESET_ERROR_CODE();
|
||||
to_params(p)->m_params.set_uint(to_symbol(k), v);
|
||||
to_params(p)->m_params.set_uint(norm_param_name(to_symbol(k)).c_str(), v);
|
||||
Z3_CATCH;
|
||||
}
|
||||
|
||||
|
@ -88,7 +88,7 @@ extern "C" {
|
|||
Z3_TRY;
|
||||
LOG_Z3_params_set_double(c, p, k, v);
|
||||
RESET_ERROR_CODE();
|
||||
to_params(p)->m_params.set_double(to_symbol(k), v);
|
||||
to_params(p)->m_params.set_double(norm_param_name(to_symbol(k)).c_str(), v);
|
||||
Z3_CATCH;
|
||||
}
|
||||
|
||||
|
@ -99,7 +99,7 @@ extern "C" {
|
|||
Z3_TRY;
|
||||
LOG_Z3_params_set_symbol(c, p, k, v);
|
||||
RESET_ERROR_CODE();
|
||||
to_params(p)->m_params.set_sym(to_symbol(k), to_symbol(v));
|
||||
to_params(p)->m_params.set_sym(norm_param_name(to_symbol(k)).c_str(), to_symbol(v));
|
||||
Z3_CATCH;
|
||||
}
|
||||
|
||||
|
|
|
@ -223,7 +223,7 @@ def get_option(name):
|
|||
"""Return the value of a Z3 global (or module) parameter
|
||||
|
||||
>>> get_option('nlsat.reorder')
|
||||
true
|
||||
'true'
|
||||
"""
|
||||
ptr = (ctypes.c_char_p * 1)()
|
||||
if Z3_global_param_get(str(name), ptr):
|
||||
|
@ -4384,8 +4384,8 @@ def args2params(arguments, keywords, ctx=None):
|
|||
"""Convert python arguments into a Z3_params object.
|
||||
A ':' is added to the keywords, and '_' is replaced with '-'
|
||||
|
||||
>>> args2params([':model', True, ':relevancy', 2], {'elim_and' : True})
|
||||
(params :model 1 :relevancy 2 :elim-and 1)
|
||||
>>> args2params(['model', True, 'relevancy', 2], {'elim_and' : True})
|
||||
(params model 1 relevancy 2 elim_and 1)
|
||||
"""
|
||||
if __debug__:
|
||||
_z3_assert(len(arguments) % 2 == 0, "Argument list must have an even number of elements.")
|
||||
|
@ -4398,7 +4398,6 @@ def args2params(arguments, keywords, ctx=None):
|
|||
r.set(prev, a)
|
||||
prev = None
|
||||
for k, v in keywords.iteritems():
|
||||
k = ':' + k.replace('_', '-')
|
||||
r.set(k, v)
|
||||
return r
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue