Skip to content

Commit

Permalink
use vector instead of indexed uint set for Boolean var occurrences
Browse files Browse the repository at this point in the history
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
  • Loading branch information
NikolajBjorner committed Jan 21, 2025
1 parent eebff13 commit 92ad285
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/ast/sls/sls_arith_base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1416,6 +1416,7 @@ namespace sls {
buffer<var_t> todo;
todo.push_back(v);
auto& vi = m_vars[v];
m_tmp_set.reset();
for (unsigned i = 0; i < todo.size(); ++i) {
var_t u = todo[i];
auto& ui = m_vars[u];
Expand All @@ -1434,8 +1435,10 @@ namespace sls {
todo.push_back(x);
}
for (auto const& [coeff, bv] : ui.m_linear_occurs)
vi.m_bool_vars_of.insert(bv);
m_tmp_set.insert(bv);
}
for (auto bv : m_tmp_set)
vi.m_bool_vars_of.push_back(bv);
}

template<typename num_t>
Expand Down
3 changes: 2 additions & 1 deletion src/ast/sls/sls_arith_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ namespace sls {
arith_op_kind m_op = arith_op_kind::LAST_ARITH_OP;
unsigned m_def_idx = UINT_MAX;
vector<std::pair<num_t, sat::bool_var>> m_linear_occurs;
indexed_uint_set m_bool_vars_of;
sat::bool_var_vector m_bool_vars_of;
unsigned_vector m_muls;
unsigned_vector m_adds;
optional<bound> m_lo, m_hi;
Expand Down Expand Up @@ -215,6 +215,7 @@ namespace sls {
arith_clausal<num_t> m_clausal_sls;
svector<double> m_prob_break;
indexed_uint_set m_bool_var_atoms;
indexed_uint_set m_tmp_set;

void invariant();
void invariant(ineq const& i);
Expand Down

0 comments on commit 92ad285

Please sign in to comment.