mirror of
https://github.com/Z3Prover/z3
synced 2025-04-24 01:25:31 +00:00
ensure evaluation of array equalities is enabled for external facing evaluator. Issue #917
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
829519b837
commit
fcda4cee9f
6 changed files with 20 additions and 4 deletions
|
@ -50,6 +50,7 @@ struct evaluator_cfg : public default_rewriter_cfg {
|
|||
unsigned m_max_steps;
|
||||
bool m_model_completion;
|
||||
bool m_cache;
|
||||
bool m_array_equalities;
|
||||
|
||||
evaluator_cfg(ast_manager & m, model_core & md, params_ref const & p):
|
||||
m_model(md),
|
||||
|
@ -81,6 +82,7 @@ struct evaluator_cfg : public default_rewriter_cfg {
|
|||
m_max_steps = p.max_steps();
|
||||
m_model_completion = p.completion();
|
||||
m_cache = p.cache();
|
||||
m_array_equalities = p.array_equalities();
|
||||
}
|
||||
|
||||
ast_manager & m() const { return m_model.get_manager(); }
|
||||
|
@ -264,11 +266,14 @@ struct evaluator_cfg : public default_rewriter_cfg {
|
|||
|
||||
|
||||
br_status mk_array_eq(expr* a, expr* b, expr_ref& result) {
|
||||
return BR_FAILED;
|
||||
if (a == b) {
|
||||
result = m().mk_true();
|
||||
return BR_DONE;
|
||||
}
|
||||
if (!m_array_equalities) {
|
||||
return BR_FAILED;
|
||||
}
|
||||
|
||||
// disabled until made more efficient
|
||||
vector<expr_ref_vector> stores1, stores2;
|
||||
bool args_are_unique1, args_are_unique2;
|
||||
|
@ -508,6 +513,10 @@ void model_evaluator::set_model_completion(bool f) {
|
|||
m_imp->cfg().m_model_completion = f;
|
||||
}
|
||||
|
||||
void model_evaluator::set_expand_array_equalities(bool f) {
|
||||
m_imp->cfg().m_array_equalities = f;
|
||||
}
|
||||
|
||||
unsigned model_evaluator::get_num_steps() const {
|
||||
return m_imp->get_num_steps();
|
||||
}
|
||||
|
|
|
@ -35,6 +35,7 @@ public:
|
|||
|
||||
ast_manager & m () const;
|
||||
void set_model_completion(bool f);
|
||||
void set_expand_array_equalities(bool f);
|
||||
|
||||
void updt_params(params_ref const & p);
|
||||
static void get_param_descrs(param_descrs & r);
|
||||
|
|
|
@ -3,6 +3,7 @@ def_module_params('model_evaluator',
|
|||
params=(max_memory_param(),
|
||||
max_steps_param(),
|
||||
('completion', BOOL, False, 'assigns an interptetation to symbols that do not have one in the current model, when evaluating expressions in the current model'),
|
||||
('cache', BOOL, True, 'cache intermediate results in the model evaluator')
|
||||
('cache', BOOL, True, 'cache intermediate results in the model evaluator'),
|
||||
('array_equalities', BOOL, True, 'evaluate array equalities')
|
||||
))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue