3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-02-18 14:44:21 +00:00

avoid creating full tables when negated variables are unitary, add lazy table infrastructure, fix coi_filter for relations, reduce dependencies on fixedpoing_parameters.hpp header file

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2013-09-08 05:52:18 -07:00
parent 0f9160a738
commit 716663b04a
40 changed files with 1221 additions and 126 deletions

View file

@ -869,6 +869,7 @@ namespace datalog {
bool & dealloc, instruction_block & acc) {
uint_set pos_vars;
u_map<expr*> neg_vars;
u_map<unsigned> occs;
ast_manager& m = m_context.get_manager();
unsigned pt_len = r->get_positive_tail_size();
unsigned ut_len = r->get_uninterpreted_tail_size();
@ -882,7 +883,14 @@ namespace datalog {
for (unsigned j = 0; j < neg_len; ++j) {
expr * e = neg_tail->get_arg(j);
if (is_var(e)) {
neg_vars.insert(to_var(e)->get_idx(), e);
unsigned idx = to_var(e)->get_idx();
neg_vars.insert(idx, e);
if (!occs.contains(idx)) {
occs.insert(idx, 1);
}
else {
occs.find(idx)++;
}
}
}
}
@ -893,11 +901,15 @@ namespace datalog {
pos_vars.insert(to_var(e)->get_idx());
}
}
// add negative variables that are not in positive:
// add negative variables that are not in positive, but only
// for variables that occur more than once.
u_map<expr*>::iterator it = neg_vars.begin(), end = neg_vars.end();
for (; it != end; ++it) {
unsigned v = it->m_key;
expr* e = it->m_value;
if (occs.find(v) == 1) {
continue;
}
if (!pos_vars.contains(v)) {
single_res_expr.push_back(e);
reg_idx new_single_res;