mirror of
https://github.com/Z3Prover/z3
synced 2025-04-16 22:05:36 +00:00
parent
bd0620f245
commit
9bb579c5c8
src/muz/rel
|
@ -366,7 +366,7 @@ namespace datalog {
|
|||
*/
|
||||
table_base * table_base::complement(func_decl* p, const table_element * func_columns) const {
|
||||
const table_signature & sig = get_signature();
|
||||
SASSERT(sig.functional_columns()==0 || func_columns!=0);
|
||||
SASSERT(sig.functional_columns() == 0 || func_columns != 0);
|
||||
SASSERT(sig.first_functional() <= 1);
|
||||
|
||||
table_base * res = get_plugin().mk_empty(sig);
|
||||
|
@ -377,6 +377,8 @@ 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;
|
||||
|
|
|
@ -260,7 +260,7 @@ namespace datalog {
|
|||
unsigned bitvector_table::fact2offset(const table_element* f) const {
|
||||
unsigned result = 0;
|
||||
for (unsigned i = 0; i < m_num_cols; ++i) {
|
||||
SASSERT(f[i]<get_signature()[i]);
|
||||
SASSERT(f[i] < get_signature()[i]);
|
||||
result += ((unsigned)f[i]) << m_shift[i];
|
||||
}
|
||||
return result;
|
||||
|
@ -274,15 +274,19 @@ namespace datalog {
|
|||
}
|
||||
|
||||
void bitvector_table::add_fact(const table_fact & f) {
|
||||
m_bv.set(fact2offset(f.c_ptr()));
|
||||
if (m_num_cols > 0) {
|
||||
m_bv.set(fact2offset(f.c_ptr()));
|
||||
}
|
||||
}
|
||||
|
||||
void bitvector_table::remove_fact(const table_element* fact) {
|
||||
m_bv.unset(fact2offset(fact));
|
||||
void bitvector_table::remove_fact(const table_element* fact) {
|
||||
if (m_num_cols > 0) {
|
||||
m_bv.unset(fact2offset(fact));
|
||||
}
|
||||
}
|
||||
|
||||
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 {
|
||||
|
|
Loading…
Reference in a new issue