3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-05-12 02:04:43 +00:00

moving out viable functionality

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2021-06-21 15:50:04 -07:00
parent 19099244c4
commit 6f93ed8dc2
9 changed files with 242 additions and 121 deletions

View file

@ -74,22 +74,22 @@ namespace polysat {
d = q.lo().val();
}
if (v != null_var) {
bddv const& x = s.var2bits(v).var();
bddv const& x = s.m_vble.var2bits(v).var();
s.push_cjust(v, this);
// hacky special case
if (a == 1 && b == 0 && c == 0 && d == 0)
// x <= 0
s.intersect_viable(v, is_positive() ? x.all0() : !x.all0());
s.m_vble.intersect_viable(v, is_positive() ? x.all0() : !x.all0());
else {
IF_VERBOSE(10, verbose_stream() << a << "*x + " << b << (is_positive() ? " <= " : " > ") << c << "*x + " << d << "\n");
bddv l = a * x + b;
bddv r = c * x + d;
bdd xs = is_positive() ? (l <= r) : (l > r);
s.intersect_viable(v, xs);
s.m_vble.intersect_viable(v, xs);
}
rational val;
if (s.find_viable(v, val) == dd::find_t::singleton) {
if (s.m_vble.find_viable(v, val) == dd::find_t::singleton) {
s.propagate(v, val, *this);
}