3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-23 09:05:31 +00:00
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2023-10-10 13:43:38 -07:00
parent 338d7b3283
commit d04807e8c3
8 changed files with 122 additions and 85 deletions

View file

@ -83,6 +83,7 @@ def_module_params(module_name='smt',
('arith.nl.optimize_bounds', BOOL, True, 'enable bounds optimization'),
('arith.nl.cross_nested', BOOL, True, 'enable cross-nested consistency checking'),
('arith.propagate_eqs', BOOL, True, 'propagate (cheap) equalities'),
('arith.nl.internal_bounds', BOOL, False, 'use internal bounds propagation'),
('arith.propagation_mode', UINT, 1, '0 - no propagation, 1 - propagate existing literals, 2 - refine finite bounds'),
('arith.branch_cut_ratio', UINT, 2, 'branch/cut ratio for linear integer arithmetic'),
('arith.int_eq_branch', BOOL, False, 'branching using derived integer equations'),

View file

@ -39,6 +39,7 @@ void theory_arith_params::updt_params(params_ref const & _p) {
m_nl_arith_propagate_linear_monomials = p.arith_nl_propagate_linear_monomials();
m_nl_arith_optimize_bounds = p.arith_nl_optimize_bounds();
m_nl_arith_cross_nested = p.arith_nl_cross_nested();
m_nl_arith_internal_bounds = p.arith_nl_internal_bounds();
arith_rewriter_params ap(_p);
m_arith_eq2ineq = ap.eq2ineq();
@ -95,4 +96,5 @@ void theory_arith_params::display(std::ostream & out) const {
DISPLAY_PARAM(m_nl_arith_propagate_linear_monomials);
DISPLAY_PARAM(m_nl_arith_optimize_bounds);
DISPLAY_PARAM(m_nl_arith_cross_nested);
DISPLAY_PARAM(m_nl_arith_internal_bounds);
}

View file

@ -108,6 +108,7 @@ struct theory_arith_params {
bool m_nl_arith_propagate_linear_monomials = true;
bool m_nl_arith_optimize_bounds = true;
bool m_nl_arith_cross_nested = true;
bool m_nl_arith_internal_bounds = false;
theory_arith_params(params_ref const & p = params_ref()) {

View file

@ -2113,7 +2113,6 @@ public:
bool propagate_core() {
m_model_is_initialized = false;
flush_bound_axioms();
// disabled in master:
propagate_nla();
if (ctx().inconsistent())
return true;
@ -3175,14 +3174,13 @@ public:
ctx().display_detailed_literal(tout << ctx().get_assign_level(c.var()) << " " << c << " ", c) << "\n";
for (auto e : m_eqs)
tout << pp(e.first, m) << " = " << pp(e.second, m) << "\n";
tout << " ==> ";
tout << pp(x, m) << " = " << pp(y, m) << "\n";
tout << " ==> " << pp(x, m) << " = " << pp(y, m) << "\n";
);
std::function<expr*(void)> fn = [&]() { return m.mk_eq(x->get_expr(), y->get_expr()); };
scoped_trace_stream _sts(th, fn);
//VERIFY(validate_eq(x, y));
// VERIFY(validate_eq(x, y));
ctx().assign_eq(x, y, eq_justification(js));
}
@ -3291,11 +3289,11 @@ public:
tout << "lemma scope: " << ctx().get_scope_level();
for (auto const& p : m_params) tout << " " << p;
tout << "\n";
display_evidence(tout, m_explanation);
display(tout << "is-conflict: " << is_conflict << "\n"););
display_evidence(tout, m_explanation););
for (auto ev : m_explanation)
set_evidence(ev.ci(), m_core, m_eqs);
SASSERT(!m_core.empty() || !m_eqs.empty());
// SASSERT(validate_conflict(m_core, m_eqs));
if (is_conflict) {
@ -3517,7 +3515,7 @@ public:
cancel_eh<reslimit> eh(m.limit());
scoped_timer timer(1000, &eh);
bool result = l_true != nctx.check();
CTRACE("arith", !result, ctx().display_lemma_as_smt_problem(tout, core.size(), core.data(), eqs.size(), eqs.data(), false_literal););
CTRACE("arith", !result, ctx().display_lemma_as_smt_problem(tout, core.size(), core.data(), eqs.size(), eqs.data(), false_literal););
return result;
}