3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-09-30 13:19:04 +00:00
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
This commit is contained in:
Lev Nachmanson 2025-09-02 12:49:57 -10:00
parent 7907e0ecaa
commit 7e45f25364

View file

@ -574,26 +574,30 @@ namespace nlsat {
m_Q.erase(it); m_Q.erase(it);
} }
void apply_pre_an_del(const property& p) { // Extracted helper: check preconditions for an_del property; returns true if ok, false otherwise.
bool precondition_on_an_del(const property& p) {
if (!p.poly) { if (!p.poly) {
TRACE(levelwise, tout << "apply_pre: an_del with null poly -> fail" << std::endl;); TRACE(levelwise, tout << "apply_pre: an_del with null poly -> fail" << std::endl;);
m_fail = true; m_fail = true;
return; return false;
} }
if (p.level == static_cast<unsigned>(-1)) { if (p.level == static_cast<unsigned>(-1)) {
TRACE(levelwise, tout << "apply_pre: an_del with unspecified level -> skip" << std::endl;); TRACE(levelwise, tout << "apply_pre: an_del with unspecified level -> skip" << std::endl;);
NOT_IMPLEMENTED_YET(); NOT_IMPLEMENTED_YET();
return; return false;
} }
// If p is nullified on the sample for its level we must abort (Rule 4.1) // If p is nullified on the sample for its level we must abort (Rule 4.1)
if (coeffs_are_zeroes_on_sample(p.poly, m_pm, sample(), m_am)) { if (coeffs_are_zeroes_on_sample(p.poly, m_pm, sample(), m_am)) {
TRACE(levelwise, tout << "Rule 4.1: polynomial nullified at sample -> failing" << std::endl;); TRACE(levelwise, tout << "Rule 4.1: polynomial nullified at sample -> failing" << std::endl;);
m_fail = true; m_fail = true;
NOT_IMPLEMENTED_YET(); NOT_IMPLEMENTED_YET();
return; return false;
} }
return true;
}
void apply_pre_an_del(const property& p) {
if (!precondition_on_an_del(p)) return;
// Pre-conditions for an_del(p) per Rule 4.1 // Pre-conditions for an_del(p) per Rule 4.1
unsigned i = (p.level > 0) ? p.level - 1 : 0; unsigned i = (p.level > 0) ? p.level - 1 : 0;