mirror of
https://github.com/Z3Prover/z3
synced 2025-06-06 14:13:23 +00:00
Merge branch 'polysat' of https://github.com/z3prover/z3 into polysat
This commit is contained in:
commit
f1b10b0ea4
3 changed files with 18 additions and 4 deletions
|
@ -57,7 +57,7 @@ namespace polysat {
|
||||||
if (!m_out)
|
if (!m_out)
|
||||||
m_out = alloc(std::ofstream, "conflicts.txt");
|
m_out = alloc(std::ofstream, "conflicts.txt");
|
||||||
else
|
else
|
||||||
out() << "\n\n\n\n\n" << hline() << "\n" << hline() << "\n" << hline() << "\n\n\n\n\n";
|
out() << "\n\n\n\n\n\n\n\n\n\n\n\n";
|
||||||
out() << "CONFLICT #" << ++m_conflicts << "\n";
|
out() << "CONFLICT #" << ++m_conflicts << "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -74,13 +74,15 @@ namespace polysat {
|
||||||
m_used_constraints.insert(c.blit().index());
|
m_used_constraints.insert(c.blit().index());
|
||||||
}
|
}
|
||||||
for (auto v : core.vars()) {
|
for (auto v : core.vars()) {
|
||||||
out_indent() << "v" << v << "\n";
|
out_indent() << "v" << v << " := " << core.s.get_value(v) << "\n";
|
||||||
m_used_vars.insert(v);
|
m_used_vars.insert(v);
|
||||||
}
|
}
|
||||||
for (auto v : core.bail_vars()) {
|
for (auto v : core.bail_vars()) {
|
||||||
out_indent() << "v" << v << " (bail)\n";
|
out_indent() << "v" << v << " := " << core.s.get_value(v) << " (bail)\n";
|
||||||
m_used_vars.insert(v);
|
m_used_vars.insert(v);
|
||||||
}
|
}
|
||||||
|
if (core.is_bailout())
|
||||||
|
out_indent() << "(bailout)\n";
|
||||||
out().flush();
|
out().flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -106,6 +106,7 @@ namespace polysat {
|
||||||
uint_set m_vars; // variable assignments used as premises
|
uint_set m_vars; // variable assignments used as premises
|
||||||
uint_set m_bail_vars;
|
uint_set m_bail_vars;
|
||||||
|
|
||||||
|
friend class inference_logger;
|
||||||
scoped_ptr<inference_logger> m_logger;
|
scoped_ptr<inference_logger> m_logger;
|
||||||
|
|
||||||
// If this is not null_var, the conflict was due to empty viable set for this variable.
|
// If this is not null_var, the conflict was due to empty viable set for this variable.
|
||||||
|
|
|
@ -143,6 +143,17 @@ namespace polysat {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct inference_sup : public inference {
|
||||||
|
const char* name;
|
||||||
|
pvar var;
|
||||||
|
signed_constraint reduced;
|
||||||
|
signed_constraint reducer;
|
||||||
|
inference_sup(const char* name, pvar var, signed_constraint reduced, signed_constraint reducer) : name(name), var(var), reduced(reduced), reducer(reducer) {}
|
||||||
|
std::ostream& display(std::ostream& out) const override {
|
||||||
|
return out << "Superposition " << name << ", reduced v" << var << " in " << reduced << " by " << reducer;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
bool ex_polynomial_superposition::reduce_by(pvar v, signed_constraint eq, conflict& core) {
|
bool ex_polynomial_superposition::reduce_by(pvar v, signed_constraint eq, conflict& core) {
|
||||||
pdd p = eq.eq();
|
pdd p = eq.eq();
|
||||||
LOG("using v" << v << " " << eq);
|
LOG("using v" << v << " " << eq);
|
||||||
|
@ -189,7 +200,7 @@ namespace polysat {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
core.set(c2);
|
core.set(c2);
|
||||||
core.log_inference("superposition 5");
|
core.log_inference(inference_sup("5", v, c, eq));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue