mirror of
https://github.com/Z3Prover/z3
synced 2025-04-10 19:27:06 +00:00
sort muxes
This commit is contained in:
parent
7d47e45c6b
commit
a634876180
|
@ -57,6 +57,8 @@ public:
|
|||
|
||||
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)
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue