3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-23 17:15:31 +00:00

add debugging output

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2024-02-06 09:48:09 -08:00
parent 187a6b17dd
commit 3f3ac924ab
3 changed files with 23 additions and 1 deletions

View file

@ -546,6 +546,18 @@ namespace polysat {
return false;
}
std::ostream& operator<<(std::ostream& out, viable::explain_t e) {
switch(e) {
case viable::explain_t::conflict: return out << "conflict";
case viable::explain_t::propagation: return out << "propagation";
case viable::explain_t::assignment: return out << "assignment";
case viable::explain_t::none: return out << "none";
default: UNREACHABLE();
}
return out;
}
/*
* Explain why the current variable is not viable or
* or why it can only have a single value.
@ -555,6 +567,8 @@ namespace polysat {
auto last = m_explain.back();
auto after = last;
verbose_stream() << m_explain_kind << "\n";
if (c.inconsistent())
verbose_stream() << "inconsistent explain\n";
TRACE("bv", display_explain(tout));
@ -631,7 +645,7 @@ namespace polysat {
return result;
}
dependency viable::propagate_from_containing_slice(entry* e, rational const& value, dependency_vector const& e_deps) {
dependency viable::propagate_from_containing_slice(entry* e, rational const& value, dependency_vector const& e_deps) {
for (auto const& slice : m_overlaps)
if (auto d = propagate_from_containing_slice(e, value, e_deps, slice); !d.is_null())
return d;

View file

@ -145,6 +145,9 @@ namespace polysat {
assignment,
none
};
friend std::ostream& operator<<(std::ostream& out, explain_t e);
pvar m_var = null_var;
explain_t m_explain_kind = explain_t::none;
unsigned m_num_bits = 0;

View file

@ -124,6 +124,11 @@ namespace polysat {
euf::theory_var v = m_pddvar2var[pv];
expr_ref val(bv.mk_numeral(slice.value, slice.length), m);
euf::enode* b = ctx.get_egraph().find(val);
if (!b) {
verbose_stream() << v << " " << val << "\n";
ctx.get_egraph().display(verbose_stream());
}
SASSERT(b);
m_bv_plugin->explain_slice(var2enode(v), slice.offset, b, consume_eq);
}