3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-29 20:05:51 +00:00

Add functionality for BDD vectors (#5198)

* Fix XOR over BDDs

* Add operator<< for find_int_t

* Add equality assertion macro that prints expression values on failure

* Adapt contains_int and find_int to take externally-defined bits

* Add more operations on BDD vectors

* Remove old functions

* Additional bddv functions

* Rename some things

* Make bddv a class and add operators

* Fix find_num/contains_num calls
This commit is contained in:
Jakob Rath 2021-04-19 18:05:19 +02:00 committed by GitHub
parent 981839ee73
commit 4da1b7b03c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 499 additions and 138 deletions

View file

@ -57,13 +57,13 @@ namespace polysat {
if (try_narrow_with(q, s)) {
rational val;
switch (s.find_viable(other_var, val)) {
case dd::find_int_t::empty:
case dd::find_result::empty:
s.set_conflict(*this);
return false;
case dd::find_int_t::singleton:
case dd::find_result::singleton:
s.propagate(other_var, val, *this);
return false;
case dd::find_int_t::multiple:
case dd::find_result::multiple:
/* do nothing */
break;
}
@ -95,7 +95,8 @@ namespace polysat {
pvar v = q.var();
rational a = q.hi().val();
rational b = q.lo().val();
bdd xs = s.m_bdd.mk_affine(a, b, s.size(v));
bddv const& x = s.m_bdd.mk_var(s.sz2bits(s.size(v)));
bdd xs = (a * x + b == rational(0));
s.intersect_viable(v, xs);
s.push_cjust(v, this);
return true;