mirror of
https://github.com/Z3Prover/z3
synced 2025-08-03 09:50:23 +00:00
delay updating parameters to ensure rewriting in asserted_formulas is applied using configuration overrides. Fixes build regression for tree_interpolation documentation test
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
534a31f74e
commit
eb1122c5cb
8 changed files with 47 additions and 48 deletions
|
@ -27,8 +27,9 @@ Revision History:
|
|||
#include "ast/macros/quasi_macros.h"
|
||||
#include "smt/asserted_formulas.h"
|
||||
|
||||
asserted_formulas::asserted_formulas(ast_manager & m, smt_params & p):
|
||||
asserted_formulas::asserted_formulas(ast_manager & m, smt_params & sp, params_ref const& p):
|
||||
m(m),
|
||||
m_smt_params(sp),
|
||||
m_params(p),
|
||||
m_rewriter(m),
|
||||
m_substitution(m),
|
||||
|
@ -65,20 +66,20 @@ asserted_formulas::asserted_formulas(ast_manager & m, smt_params & p):
|
|||
}
|
||||
|
||||
void asserted_formulas::setup() {
|
||||
switch (m_params.m_lift_ite) {
|
||||
switch (m_smt_params.m_lift_ite) {
|
||||
case LI_FULL:
|
||||
m_params.m_ng_lift_ite = LI_NONE;
|
||||
m_smt_params.m_ng_lift_ite = LI_NONE;
|
||||
break;
|
||||
case LI_CONSERVATIVE:
|
||||
if (m_params.m_ng_lift_ite == LI_CONSERVATIVE)
|
||||
m_params.m_ng_lift_ite = LI_NONE;
|
||||
if (m_smt_params.m_ng_lift_ite == LI_CONSERVATIVE)
|
||||
m_smt_params.m_ng_lift_ite = LI_NONE;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (m_params.m_relevancy_lvl == 0)
|
||||
m_params.m_relevancy_lemma = false;
|
||||
if (m_smt_params.m_relevancy_lvl == 0)
|
||||
m_smt_params.m_relevancy_lemma = false;
|
||||
}
|
||||
|
||||
|
||||
|
@ -118,24 +119,23 @@ void asserted_formulas::push_assertion(expr * e, proof * pr, vector<justified_ex
|
|||
}
|
||||
|
||||
void asserted_formulas::updt_params(params_ref const& p) {
|
||||
m_rewriter.updt_params(p);
|
||||
m_params.append(p);
|
||||
}
|
||||
|
||||
void asserted_formulas::set_eliminate_and(bool flag) {
|
||||
if (flag == m_elim_and) return;
|
||||
m_elim_and = flag;
|
||||
params_ref p;
|
||||
if (m_params.m_pull_cheap_ite) p.set_bool("pull_cheap_ite", true);
|
||||
p.set_bool("elim_and", flag);
|
||||
p.set_bool("arith_ineq_lhs", true);
|
||||
p.set_bool("sort_sums", true);
|
||||
p.set_bool("rewrite_patterns", true);
|
||||
p.set_bool("eq2ineq", m_params.m_arith_eq2ineq);
|
||||
p.set_bool("gcd_rounding", true);
|
||||
p.set_bool("expand_select_store", true);
|
||||
p.set_bool("bv_sort_ac", true);
|
||||
p.set_bool("som", true);
|
||||
m_rewriter.updt_params(p);
|
||||
if (m_smt_params.m_pull_cheap_ite) m_params.set_bool("pull_cheap_ite", true);
|
||||
m_params.set_bool("elim_and", flag);
|
||||
m_params.set_bool("arith_ineq_lhs", true);
|
||||
m_params.set_bool("sort_sums", true);
|
||||
m_params.set_bool("rewrite_patterns", true);
|
||||
m_params.set_bool("eq2ineq", m_smt_params.m_arith_eq2ineq);
|
||||
m_params.set_bool("gcd_rounding", true);
|
||||
m_params.set_bool("expand_select_store", true);
|
||||
m_params.set_bool("bv_sort_ac", true);
|
||||
m_params.set_bool("som", true);
|
||||
m_rewriter.updt_params(m_params);
|
||||
flush_cache();
|
||||
}
|
||||
|
||||
|
@ -147,7 +147,7 @@ void asserted_formulas::assert_expr(expr * e, proof * _in_pr) {
|
|||
if (inconsistent())
|
||||
return;
|
||||
|
||||
if (m_params.m_preprocess) {
|
||||
if (m_smt_params.m_preprocess) {
|
||||
TRACE("assert_expr_bug", tout << r << "\n";);
|
||||
set_eliminate_and(false); // do not eliminate and before nnf.
|
||||
m_rewriter(e, r, pr);
|
||||
|
@ -230,7 +230,7 @@ void asserted_formulas::reduce() {
|
|||
return;
|
||||
if (m_qhead == m_formulas.size())
|
||||
return;
|
||||
if (!m_params.m_preprocess)
|
||||
if (!m_smt_params.m_preprocess)
|
||||
return;
|
||||
if (m_macro_manager.has_macros())
|
||||
invoke(m_find_macros);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue