3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-22 16:45:31 +00:00

stub for conflict::find_deps

This commit is contained in:
Jakob Rath 2023-02-01 10:53:49 +01:00
parent 1bb68a4fc1
commit 576e0b70b2
3 changed files with 25 additions and 7 deletions

View file

@ -504,6 +504,27 @@ namespace polysat {
}
#endif
void conflict::find_deps(dependency_vector& out_deps) const {
sat::literal_vector todo;
sat::literal_set done;
indexed_uint_set deps;
LOG("conflict: " << *this);
// TODO: starting at literals/variables in the conflict, chase propagations backwards and accumulate dependencies.
verbose_stream() << "WARNING: unsat_core requested but dependency tracking in polysat is TODO\n";
for (signed_constraint c : *this) {
dependency d = s.m_bvars.dep(c.blit());
if (!d.is_null())
deps.insert(d.val());
}
for (unsigned d : deps)
out_deps.push_back(dependency(d));
if (!m_dep.is_null())
out_deps.push_back(m_dep);
}
std::ostream& conflict::display(std::ostream& out) const {
char const* sep = "";
for (auto c : *this)

View file

@ -195,6 +195,8 @@ namespace polysat {
/** Move the literals to be narrowed out of the conflict */
sat::literal_vector take_narrow_queue();
void find_deps(dependency_vector& out_deps) const;
std::ostream& display(std::ostream& out) const;
};

View file

@ -1318,14 +1318,9 @@ namespace polysat {
}
void solver::unsat_core(dependency_vector& deps) {
verbose_stream() << "WARNING: unsat_core requested but dependency tracking in polysat is TODO\n";
VERIFY(is_conflict());
deps.reset();
LOG("conflict" << m_conflict);
for (auto c : m_conflict) {
auto d = m_bvars.dep(c.blit());
if (d != null_dependency)
deps.push_back(d);
}
m_conflict.find_deps(deps);
}
std::ostream& solver::display(std::ostream& out) const {