Skip to content

Commit

Permalink
sort muxes
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolajBjorner committed Apr 15, 2022
1 parent 7d47e45 commit a634876
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 2 additions & 0 deletions src/cmd_context/eval_cmd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ class eval_cmd : public parametric_cmd {

void execute(cmd_context & ctx) override {
model_ref md;
if (ctx.ignore_check())
return;
if (!ctx.is_model_available(md))
throw cmd_exception("model is not available");
if (!m_target)
Expand Down
12 changes: 7 additions & 5 deletions src/sat/sat_solver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4192,17 +4192,19 @@ namespace sat {
m_ext->find_mutexes(_lits, mutexes);
}
unsigned_vector ps;
for (literal lit : _lits) {
for (literal lit : _lits)
ps.push_back(lit.index());
}
mc.cliques(ps, _mutexes);
vector<vector<literal_vector>> sorted;
for (auto const& mux : _mutexes) {
literal_vector clique;
for (auto const& idx : mux) {
sorted.reserve(mux.size() + 1);
for (auto const& idx : mux)
clique.push_back(to_literal(idx));
}
mutexes.push_back(clique);
sorted[mux.size()].push_back(clique);
}
for (unsigned i = sorted.size(); i-- > 0; )
mutexes.append(sorted[i]);
return l_true;
}

Expand Down

0 comments on commit a634876

Please sign in to comment.