mirror of
https://github.com/Z3Prover/z3
synced 2025-08-02 17:30:23 +00:00
fix #6808
remove bv_eq_axioms as an external option to toggle. Diseqalities have to be enforced for extensionality. There are no internal code paths where the option is set to false.
This commit is contained in:
parent
d0d434e4f1
commit
08599177d0
5 changed files with 23 additions and 40 deletions
|
@ -429,12 +429,9 @@ namespace smt {
|
|||
};
|
||||
|
||||
void theory_bv::add_fixed_eq(theory_var v1, theory_var v2) {
|
||||
if (!params().m_bv_eq_axioms)
|
||||
return;
|
||||
|
||||
if (v1 > v2) {
|
||||
if (v1 > v2)
|
||||
std::swap(v1, v2);
|
||||
}
|
||||
|
||||
unsigned act = m_eq_activity[hash_u_u(v1, v2) & 0xFF]++;
|
||||
if ((act & 0xFF) != 0xFF) {
|
||||
|
@ -1163,8 +1160,6 @@ namespace smt {
|
|||
}
|
||||
|
||||
void theory_bv::expand_diseq(theory_var v1, theory_var v2) {
|
||||
if (!params().m_bv_eq_axioms)
|
||||
return;
|
||||
|
||||
SASSERT(get_bv_size(v1) == get_bv_size(v2));
|
||||
if (v1 > v2) {
|
||||
|
@ -1331,29 +1326,27 @@ namespace smt {
|
|||
}
|
||||
else {
|
||||
ctx.assign(consequent, mk_bit_eq_justification(v1, v2, consequent, antecedent));
|
||||
if (params().m_bv_eq_axioms) {
|
||||
|
||||
literal_vector lits;
|
||||
lits.push_back(~consequent);
|
||||
lits.push_back(antecedent);
|
||||
literal eq = mk_eq(get_expr(v1), get_expr(v2), false);
|
||||
lits.push_back(~eq);
|
||||
//
|
||||
// Issue #3035:
|
||||
// merge_eh invokes assign_bit, which updates the propagation queue and includes the
|
||||
// theory axiom for the propagated equality. When relevancy is non-zero, propagation may get
|
||||
// lost on backtracking because the propagation queue is reset on conflicts.
|
||||
// An alternative approach is to ensure the propagation queue is chronological with
|
||||
// backtracking scopes (ie., it doesn't get reset, but shrunk to a previous level, and similar
|
||||
// with a qhead indicator.
|
||||
//
|
||||
ctx.mark_as_relevant(lits[0]);
|
||||
ctx.mark_as_relevant(lits[1]);
|
||||
ctx.mark_as_relevant(lits[2]);
|
||||
{
|
||||
scoped_trace_stream _sts(*this, lits);
|
||||
ctx.mk_th_axiom(get_id(), lits.size(), lits.data());
|
||||
}
|
||||
literal_vector lits;
|
||||
lits.push_back(~consequent);
|
||||
lits.push_back(antecedent);
|
||||
literal eq = mk_eq(get_expr(v1), get_expr(v2), false);
|
||||
lits.push_back(~eq);
|
||||
//
|
||||
// Issue #3035:
|
||||
// merge_eh invokes assign_bit, which updates the propagation queue and includes the
|
||||
// theory axiom for the propagated equality. When relevancy is non-zero, propagation may get
|
||||
// lost on backtracking because the propagation queue is reset on conflicts.
|
||||
// An alternative approach is to ensure the propagation queue is chronological with
|
||||
// backtracking scopes (ie., it doesn't get reset, but shrunk to a previous level, and similar
|
||||
// with a qhead indicator.
|
||||
//
|
||||
ctx.mark_as_relevant(lits[0]);
|
||||
ctx.mark_as_relevant(lits[1]);
|
||||
ctx.mark_as_relevant(lits[2]);
|
||||
{
|
||||
scoped_trace_stream _sts(*this, lits);
|
||||
ctx.mk_th_axiom(get_id(), lits.size(), lits.data());
|
||||
}
|
||||
|
||||
if (m_wpos[v2] == idx)
|
||||
|
@ -1382,7 +1375,7 @@ namespace smt {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void theory_bv::relevant_eh(app * n) {
|
||||
TRACE("arith", tout << "relevant: #" << n->get_id() << " " << ctx.e_internalized(n) << ": " << mk_bounded_pp(n, m) << "\n";);
|
||||
TRACE("bv", tout << "relevant: #" << n->get_id() << " " << ctx.e_internalized(n) << ": " << mk_pp(n, m) << "\n";);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue