mirror of
https://github.com/Z3Prover/z3
synced 2025-05-01 12:55:52 +00:00
Polysat: use constraint_literal and begin move to core-based conflict representation (#5489)
* Rename solver_scope for fixplex tests (otherwise the wrong constructor is called for polysat's solver_scope) * Update conflict_core * simplify * Be clearer about constraint_literal lifetime * remove old comment * Remove status (positive/negative) from constraint * Use constraint_literal in the solver * Fix build (constraint -> get_constraint)
This commit is contained in:
parent
30e9f24fa3
commit
ebaea2159e
19 changed files with 933 additions and 1004 deletions
|
@ -20,9 +20,40 @@ Author:
|
|||
namespace polysat {
|
||||
|
||||
std::ostream& conflict_core::display(std::ostream& out) const {
|
||||
out << "TODO: display conflict_core";
|
||||
// depending on sign: A /\ B /\ C or ¬A \/ ¬B \/ ¬C
|
||||
bool first = true;
|
||||
for (auto c : m_constraints) {
|
||||
if (first)
|
||||
first = false;
|
||||
else
|
||||
out << " ; ";
|
||||
out << c;
|
||||
}
|
||||
if (m_needs_model)
|
||||
out << " ; + current model";
|
||||
return out;
|
||||
}
|
||||
|
||||
void conflict_core::set(std::nullptr_t) {
|
||||
SASSERT(empty());
|
||||
m_constraints.push_back({});
|
||||
m_needs_model = false;
|
||||
}
|
||||
|
||||
void conflict_core::set(constraint_literal c) {
|
||||
LOG("Conflict: " << c);
|
||||
SASSERT(empty());
|
||||
m_constraints.push_back(std::move(c));
|
||||
m_needs_model = true;
|
||||
}
|
||||
|
||||
void conflict_core::set(pvar v, vector<constraint_literal> const& cjust_v) {
|
||||
LOG("Conflict for v" << v << ": " << cjust_v);
|
||||
SASSERT(empty());
|
||||
NOT_IMPLEMENTED_YET();
|
||||
m_constraints.append(cjust_v);
|
||||
if (cjust_v.empty())
|
||||
m_constraints.push_back({});
|
||||
m_needs_model = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue