mirror of
https://github.com/Z3Prover/z3
synced 2025-06-06 14:13:23 +00:00
port Grobner
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
This commit is contained in:
parent
5a2ce93ed7
commit
47bb9b2689
1 changed files with 24 additions and 6 deletions
|
@ -500,12 +500,12 @@ void nla_grobner::superpose(equation * eq1, equation * eq2) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NOT_IMPLEMENTED_YET();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool nla_grobner::find_b_c(nex_mul*ab, nex_mul* ac, nex_mul*& b, nex_mul*& c) {
|
bool nla_grobner::find_b_c(nex_mul*ab, nex_mul* ac, nex_mul*& b, nex_mul*& c) {
|
||||||
if (!find_b_c_check(ab, ac))
|
if (!find_b_c_check(ab, ac))
|
||||||
return false;
|
return false;
|
||||||
unsigned i = 0, j = 0; // i points to ab, j points to ac
|
|
||||||
b = m_nex_creator.mk_mul(); c = m_nex_creator.mk_mul();
|
b = m_nex_creator.mk_mul(); c = m_nex_creator.mk_mul();
|
||||||
nex_pow* bp = ab->begin();
|
nex_pow* bp = ab->begin();
|
||||||
nex_pow* cp = ac->begin();
|
nex_pow* cp = ac->begin();
|
||||||
|
@ -519,12 +519,30 @@ bool nla_grobner::find_b_c(nex_mul*ab, nex_mul* ac, nex_mul*& b, nex_mul*& c) {
|
||||||
if (++cp == ac->end())
|
if (++cp == ac->end())
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
NOT_IMPLEMENTED_YET();
|
unsigned b_pow = bp->pow();
|
||||||
|
unsigned c_pow = cp->pow();
|
||||||
|
if (b_pow > c_pow) {
|
||||||
|
b->add_child_in_power(bp->e(), b_pow - c_pow);
|
||||||
|
} else if (c_pow > b_pow) {
|
||||||
|
c->add_child_in_power(cp->e(), c_pow - b_pow);
|
||||||
|
} // otherwise the power are equal and no child added to either b or c
|
||||||
|
bp++; cp++;
|
||||||
|
|
||||||
|
if (bp == ab->end() || cp == ac->end()) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
while (cp != ac->end()) {
|
||||||
|
c->add_child_in_power(*cp);
|
||||||
|
cp++;
|
||||||
}
|
}
|
||||||
NOT_IMPLEMENTED_YET();
|
while (bp != ab->end()) {
|
||||||
return true;
|
b->add_child_in_power(*bp);
|
||||||
|
bp++;
|
||||||
|
}
|
||||||
|
TRACE("nla_grobner", tout << "b=" << *b << ", c=" <<*c << "\n";);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool nla_grobner::find_b_c_check(const nex_mul*ab, const nex_mul* ac) const {
|
bool nla_grobner::find_b_c_check(const nex_mul*ab, const nex_mul* ac) const {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue