3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-08-21 18:50:26 +00:00

testing projection

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2014-09-18 15:42:30 -07:00
parent 4173bf930b
commit 8154fc24e1
4 changed files with 56 additions and 7 deletions

View file

@ -52,6 +52,9 @@ doc* doc_manager::allocate(doc const& src) {
}
return r;
}
doc* doc_manager::allocate(tbv* t) {
return alloc(doc, t);
}
doc* doc_manager::allocate(tbv const& src) {
return allocate(m.allocate(src));
}
@ -317,6 +320,8 @@ doc* doc_manager::project(doc_manager& dstm, unsigned n, bool const* to_delete,
for (unsigned i = 0; i < n; ++i) {
if (to_delete[i] && (*bits)[i] == BIT_z) {
new_todo.reset();
pos.reset();
neg.reset();
for (unsigned j = 0; j < todo.size(); ++j) {
tbv& t = *todo[j];
switch(t[i]) {

View file

@ -19,12 +19,17 @@ Revision History:
--*/
#include "tbv.h"
#include "hashtable.h"
static ptr_addr_hashtable<tbv> allocated_tbvs;
void tbv_manager::reset() {
m.reset();
}
tbv* tbv_manager::allocate() {
return reinterpret_cast<tbv*>(m.allocate());
tbv* r = reinterpret_cast<tbv*>(m.allocate());
allocated_tbvs.insert(r);
return r;
}
tbv* tbv_manager::allocate1() {
tbv* v = allocate();
@ -42,7 +47,9 @@ tbv* tbv_manager::allocateX() {
return v;
}
tbv* tbv_manager::allocate(tbv const& bv) {
return reinterpret_cast<tbv*>(m.allocate(bv));
tbv* r = allocate();
copy(*r, bv);
return r;
}
tbv* tbv_manager::allocate(uint64 val) {
tbv* v = allocate0();
@ -124,6 +131,11 @@ tbv* tbv_manager::allocate(rational const& r) {
return v;
}
void tbv_manager::deallocate(tbv* bv) {
if (!allocated_tbvs.contains(bv)) {
std::cout << "double deallocate: " << bv << "\n";
UNREACHABLE();
}
allocated_tbvs.erase(bv);
m.deallocate(bv);
}
void tbv_manager::copy(tbv& dst, tbv const& src) const {