mirror of
https://github.com/Z3Prover/z3
synced 2025-04-12 04:03:39 +00:00
move away from sets and into vectors for data associated with Boolean variables
This commit is contained in:
parent
92ad285951
commit
d944779e18
|
@ -2882,6 +2882,8 @@ namespace sls {
|
||||||
expr_mark visited;
|
expr_mark visited;
|
||||||
ptr_buffer<expr> todo;
|
ptr_buffer<expr> todo;
|
||||||
|
|
||||||
|
m_tmp_set.reset();
|
||||||
|
|
||||||
todo.push_back(e);
|
todo.push_back(e);
|
||||||
while (!todo.empty()) {
|
while (!todo.empty()) {
|
||||||
auto e = todo.back();
|
auto e = todo.back();
|
||||||
|
@ -2899,7 +2901,7 @@ namespace sls {
|
||||||
continue;
|
continue;
|
||||||
if (is_uninterp(e)) {
|
if (is_uninterp(e)) {
|
||||||
if (!i.fixable_atoms.contains(bv)) {
|
if (!i.fixable_atoms.contains(bv)) {
|
||||||
i.fixable_atoms.insert(bv);
|
i.fixable_atoms.push_back(bv);
|
||||||
i.fixable_exprs.push_back(e);
|
i.fixable_exprs.push_back(e);
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
|
@ -2907,7 +2909,7 @@ namespace sls {
|
||||||
auto* ineq = get_ineq(bv);
|
auto* ineq = get_ineq(bv);
|
||||||
if (!ineq)
|
if (!ineq)
|
||||||
continue;
|
continue;
|
||||||
i.fixable_atoms.insert(bv);
|
i.fixable_atoms.push_back(bv);
|
||||||
buffer<var_t> vars;
|
buffer<var_t> vars;
|
||||||
|
|
||||||
for (auto& [v, occ] : ineq->m_nonlinear)
|
for (auto& [v, occ] : ineq->m_nonlinear)
|
||||||
|
@ -2915,7 +2917,7 @@ namespace sls {
|
||||||
|
|
||||||
for (unsigned j = 0; j < vars.size(); ++j) {
|
for (unsigned j = 0; j < vars.size(); ++j) {
|
||||||
auto v = vars[j];
|
auto v = vars[j];
|
||||||
if (i.fixable_vars.contains(v))
|
if (m_tmp_set.contains(v))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (is_add(v)) {
|
if (is_add(v)) {
|
||||||
|
@ -2928,11 +2930,13 @@ namespace sls {
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
i.fixable_exprs.push_back(m_vars[v].m_expr);
|
i.fixable_exprs.push_back(m_vars[v].m_expr);
|
||||||
i.fixable_vars.insert(v);
|
m_tmp_set.insert(v);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
for (auto v : m_tmp_set)
|
||||||
|
i.fixable_vars.push_back(v);
|
||||||
return i.fixable_exprs;
|
return i.fixable_exprs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -330,9 +330,9 @@ namespace sls {
|
||||||
double score = 0;
|
double score = 0;
|
||||||
unsigned touched = 1;
|
unsigned touched = 1;
|
||||||
lbool value = l_undef;
|
lbool value = l_undef;
|
||||||
indexed_uint_set fixable_atoms;
|
sat::bool_var_vector fixable_atoms;
|
||||||
uint_set fixable_vars;
|
svector<var_t> fixable_vars;
|
||||||
ptr_vector<expr> fixable_exprs;
|
ptr_vector<expr> fixable_exprs;
|
||||||
bool_info(unsigned w) : weight(w) {}
|
bool_info(unsigned w) : weight(w) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue