3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-08-11 05:30:51 +00:00
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2020-04-06 19:43:32 -07:00
parent bd0620f245
commit 9bb579c5c8
2 changed files with 12 additions and 6 deletions

View file

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

View file

@ -274,15 +274,19 @@ namespace datalog {
} }
void bitvector_table::add_fact(const table_fact & f) { 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) { 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 { bool bitvector_table::contains_fact(const table_fact & f) const {
return m_bv.get(fact2offset(f.c_ptr())); return !f.empty() && m_bv.get(fact2offset(f.c_ptr()));
} }
table_base::iterator bitvector_table::begin() const { table_base::iterator bitvector_table::begin() const {