3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-22 16:45:31 +00:00

Add method to (explicitly) re-assign the pdd manager

This commit is contained in:
Jakob Rath 2023-05-29 15:44:37 +02:00
parent 2795ac5e90
commit 129039dc52
2 changed files with 9 additions and 0 deletions

View file

@ -1825,6 +1825,14 @@ namespace dd {
return *this;
}
/* Reset pdd to 0. Allows re-assigning the pdd manager. */
void pdd::reset(pdd_manager& new_m) {
m->dec_ref(root);
root = 0;
m = &new_m;
SASSERT(is_zero());
}
rational const& pdd::leading_coefficient() const {
pdd p = *this;
while (!p.is_val())

View file

@ -413,6 +413,7 @@ namespace dd {
pdd& operator=(rational const& k);
// TODO: pdd& operator=(pdd&& other); (just swap like move constructor?)
~pdd() { m->dec_ref(root); }
void reset(pdd_manager& new_m);
pdd lo() const { return pdd(m->lo(root), m); }
pdd hi() const { return pdd(m->hi(root), m); }
unsigned index() const { return root; }