mirror of
https://github.com/Z3Prover/z3
synced 2025-06-27 08:28:44 +00:00
fix in neutral lemma
Signed-off-by: Lev <levnach@hotmail.com>
This commit is contained in:
parent
5b786c428d
commit
47d7331dd5
1 changed files with 15 additions and 4 deletions
|
@ -636,6 +636,9 @@ struct solver::imp {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// mon_var = 0
|
||||||
|
mk_ineq(mon_var, lp::lconstraint_kind::EQ);
|
||||||
|
|
||||||
// negate abs(jl) == abs()
|
// negate abs(jl) == abs()
|
||||||
if (vvr(jl) == - vvr(mon_var))
|
if (vvr(jl) == - vvr(mon_var))
|
||||||
mk_ineq(jl, mon_var, lp::lconstraint_kind::NE);
|
mk_ineq(jl, mon_var, lp::lconstraint_kind::NE);
|
||||||
|
@ -700,6 +703,11 @@ struct solver::imp {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void explain(const factorization& f) {
|
||||||
|
for (const auto& fc : f) {
|
||||||
|
explain(fc);
|
||||||
|
}
|
||||||
|
}
|
||||||
// use basic multiplication properties to create a lemma
|
// use basic multiplication properties to create a lemma
|
||||||
// for the given monomial
|
// for the given monomial
|
||||||
bool basic_lemma_for_mon(const rooted_mon& rm) {
|
bool basic_lemma_for_mon(const rooted_mon& rm) {
|
||||||
|
@ -708,17 +716,20 @@ struct solver::imp {
|
||||||
if (factorization.is_empty())
|
if (factorization.is_empty())
|
||||||
continue;
|
continue;
|
||||||
if (basic_lemma_for_mon_zero(rm, factorization) ||
|
if (basic_lemma_for_mon_zero(rm, factorization) ||
|
||||||
basic_lemma_for_mon_neutral(rm, factorization))
|
basic_lemma_for_mon_neutral(rm, factorization)) {
|
||||||
|
explain(factorization);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
for (auto factorization : factorization_factory_imp(rm.m_vars, *this)) {
|
for (auto factorization : factorization_factory_imp(rm.m_vars, *this)) {
|
||||||
if (factorization.is_empty())
|
if (factorization.is_empty())
|
||||||
continue;
|
continue;
|
||||||
if (basic_lemma_for_mon_non_zero(rm, factorization) ||
|
if (basic_lemma_for_mon_non_zero(rm, factorization) ||
|
||||||
basic_lemma_for_mon_neutral(rm, factorization))
|
basic_lemma_for_mon_neutral(rm, factorization)) {
|
||||||
|
explain(factorization);
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue