mirror of
https://github.com/Z3Prover/z3
synced 2025-04-21 16:16:38 +00:00
Add some fi info
This commit is contained in:
parent
d59c32261f
commit
be488f75ab
|
@ -92,13 +92,15 @@ namespace polysat {
|
|||
out().flush();
|
||||
}
|
||||
|
||||
void log_gamma(search_state const& m_search) {
|
||||
void end_conflict(search_state const& search, viable const& v) {
|
||||
out() << "\n" << hline() << "\n\n";
|
||||
out() << "Search state (part):\n";
|
||||
for (auto const& item : m_search)
|
||||
for (auto const& item : search)
|
||||
if (is_relevant(item))
|
||||
out_indent() << search_item_pp(m_search, item, true) << "\n";
|
||||
// TODO: log viable
|
||||
out_indent() << search_item_pp(search, item, true) << "\n";
|
||||
out() << hline() << "\nViable (part):\n";
|
||||
for (pvar var : m_used_vars)
|
||||
out_indent() << "v" << std::setw(3) << std::left << var << ": " << viable::var_pp(v, var) << "\n";
|
||||
out().flush();
|
||||
}
|
||||
|
||||
|
@ -139,9 +141,9 @@ namespace polysat {
|
|||
m_logger->log_inference(*this, &inf);
|
||||
}
|
||||
|
||||
void conflict::log_gamma() {
|
||||
void conflict::end_conflict() {
|
||||
if (m_logger)
|
||||
m_logger->log_gamma(s.m_search);
|
||||
m_logger->end_conflict(s.m_search, s.m_viable);
|
||||
}
|
||||
|
||||
constraint_manager& conflict::cm() const { return s.m_constraints; }
|
||||
|
|
|
@ -136,8 +136,8 @@ namespace polysat {
|
|||
/// Log inference at the current state.
|
||||
void log_inference(inference const& inf);
|
||||
void log_inference(char const* name) { log_inference(inference_named(name)); }
|
||||
/// Log relevant part of search state.
|
||||
void log_gamma();
|
||||
/// Log relevant part of search state and viable.
|
||||
void end_conflict();
|
||||
|
||||
pvar conflict_var() const { return m_conflict_var; }
|
||||
|
||||
|
|
|
@ -602,7 +602,7 @@ namespace polysat {
|
|||
inc_activity(v);
|
||||
justification& j = m_justification[v];
|
||||
if (j.level() > base_level() && !m_conflict.resolve_value(v) && j.is_decision()) {
|
||||
m_conflict.log_gamma();
|
||||
m_conflict.end_conflict();
|
||||
revert_decision(v);
|
||||
return;
|
||||
}
|
||||
|
@ -623,7 +623,7 @@ namespace polysat {
|
|||
if (m_bvars.is_assumption(var))
|
||||
continue;
|
||||
else if (m_bvars.is_decision(var)) {
|
||||
m_conflict.log_gamma();
|
||||
m_conflict.end_conflict();
|
||||
revert_bool_decision(lit);
|
||||
return;
|
||||
}
|
||||
|
@ -635,7 +635,7 @@ namespace polysat {
|
|||
}
|
||||
}
|
||||
}
|
||||
m_conflict.log_gamma();
|
||||
m_conflict.end_conflict();
|
||||
report_unsat();
|
||||
}
|
||||
|
||||
|
|
|
@ -615,6 +615,15 @@ namespace polysat {
|
|||
return dd::find_t::multiple;
|
||||
}
|
||||
|
||||
struct inference_fi : public inference {
|
||||
viable& v;
|
||||
pvar var;
|
||||
inference_fi(viable& v, pvar var) : v(v), var(var) {}
|
||||
std::ostream& display(std::ostream& out) const override {
|
||||
return out << "Forbidden intervals for v" << var << ": " << viable::var_pp(v, var);
|
||||
}
|
||||
};
|
||||
|
||||
bool viable::resolve(pvar v, conflict& core) {
|
||||
if (has_viable(v))
|
||||
return false;
|
||||
|
@ -649,7 +658,7 @@ namespace polysat {
|
|||
break;
|
||||
}
|
||||
}
|
||||
core.log_inference("forbidden intervals");
|
||||
core.log_inference(inference_fi(*this, v));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -171,9 +171,9 @@ namespace polysat {
|
|||
std::ostream& display(std::ostream& out, pvar v) const;
|
||||
|
||||
struct var_pp {
|
||||
viable& v;
|
||||
viable const& v;
|
||||
pvar var;
|
||||
var_pp(viable& v, pvar var) : v(v), var(var) {}
|
||||
var_pp(viable const& v, pvar var) : v(v), var(var) {}
|
||||
};
|
||||
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue