3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-27 19:05:51 +00:00
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2020-04-07 10:40:36 -07:00
parent cb136418d5
commit 8dac9b7b94
6 changed files with 14 additions and 17 deletions

View file

@ -377,8 +377,6 @@ namespace datalog {
if (sig.first_functional() == 0) {
if (empty()) {
if (fact.empty())
throw default_exception("empty relations cannot be complemented");
res->add_fact(fact);
}
return res;

View file

@ -1231,7 +1231,7 @@ namespace datalog {
bool populated() const { return !m_current.empty(); }
void ensure_populated() const {
if(!populated()) {
if (!populated()) {
get_fact(m_current);
}
}

View file

@ -229,7 +229,7 @@ namespace datalog {
};
bitvector_table::bitvector_table(bitvector_table_plugin & plugin, const table_signature & sig)
: table_base(plugin, sig) {
: table_base(plugin, sig){
SASSERT(plugin.can_handle_signature(sig));
m_num_cols = sig.size();
@ -237,7 +237,7 @@ namespace datalog {
for (unsigned i = 0; i < m_num_cols; ++i) {
unsigned s = static_cast<unsigned>(sig[i]);
if (s != sig[i] || !is_power_of_two(s)) {
throw default_exception("bit-vector table is specialized to small domains that are powers of two");
throw default_exception("bit-vector table is specialized to small domains that are powers of two");
}
m_shift.push_back(shift);
m_mask.push_back(s - 1);
@ -253,8 +253,8 @@ namespace datalog {
if (shift >= 32) {
throw default_exception("bit-vector table is specialized to small domains that are powers of two");
}
m_bv.reserve(1 << shift);
}
m_bv.reserve(1 << shift);
}
unsigned bitvector_table::fact2offset(const table_element* f) const {
@ -274,19 +274,15 @@ namespace datalog {
}
void bitvector_table::add_fact(const table_fact & f) {
if (m_num_cols > 0) {
m_bv.set(fact2offset(f.c_ptr()));
}
m_bv.set(fact2offset(f.c_ptr()));
}
void bitvector_table::remove_fact(const table_element* fact) {
if (m_num_cols > 0) {
m_bv.unset(fact2offset(fact));
}
m_bv.unset(fact2offset(fact));
}
bool bitvector_table::contains_fact(const table_fact & f) const {
return !f.empty() && m_bv.get(fact2offset(f.c_ptr()));
return m_bv.get(fact2offset(f.c_ptr()));
}
table_base::iterator bitvector_table::begin() const {

View file

@ -127,8 +127,8 @@ namespace datalog {
friend class bitvector_table_plugin;
class bv_iterator;
bit_vector m_bv;
unsigned m_num_cols;
bit_vector m_bv;
unsigned m_num_cols;
unsigned_vector m_shift;
unsigned_vector m_mask;