mirror of
https://github.com/Z3Prover/z3
synced 2025-06-26 07:43:41 +00:00
add debugging output
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
187a6b17dd
commit
3f3ac924ab
3 changed files with 23 additions and 1 deletions
|
@ -546,6 +546,18 @@ namespace polysat {
|
||||||
return false;
|
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
|
* Explain why the current variable is not viable or
|
||||||
* or why it can only have a single value.
|
* or why it can only have a single value.
|
||||||
|
@ -555,6 +567,8 @@ namespace polysat {
|
||||||
auto last = m_explain.back();
|
auto last = m_explain.back();
|
||||||
auto after = last;
|
auto after = last;
|
||||||
|
|
||||||
|
verbose_stream() << m_explain_kind << "\n";
|
||||||
|
|
||||||
if (c.inconsistent())
|
if (c.inconsistent())
|
||||||
verbose_stream() << "inconsistent explain\n";
|
verbose_stream() << "inconsistent explain\n";
|
||||||
TRACE("bv", display_explain(tout));
|
TRACE("bv", display_explain(tout));
|
||||||
|
@ -631,7 +645,7 @@ namespace polysat {
|
||||||
return result;
|
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)
|
for (auto const& slice : m_overlaps)
|
||||||
if (auto d = propagate_from_containing_slice(e, value, e_deps, slice); !d.is_null())
|
if (auto d = propagate_from_containing_slice(e, value, e_deps, slice); !d.is_null())
|
||||||
return d;
|
return d;
|
||||||
|
|
|
@ -145,6 +145,9 @@ namespace polysat {
|
||||||
assignment,
|
assignment,
|
||||||
none
|
none
|
||||||
};
|
};
|
||||||
|
|
||||||
|
friend std::ostream& operator<<(std::ostream& out, explain_t e);
|
||||||
|
|
||||||
pvar m_var = null_var;
|
pvar m_var = null_var;
|
||||||
explain_t m_explain_kind = explain_t::none;
|
explain_t m_explain_kind = explain_t::none;
|
||||||
unsigned m_num_bits = 0;
|
unsigned m_num_bits = 0;
|
||||||
|
|
|
@ -124,6 +124,11 @@ namespace polysat {
|
||||||
euf::theory_var v = m_pddvar2var[pv];
|
euf::theory_var v = m_pddvar2var[pv];
|
||||||
expr_ref val(bv.mk_numeral(slice.value, slice.length), m);
|
expr_ref val(bv.mk_numeral(slice.value, slice.length), m);
|
||||||
euf::enode* b = ctx.get_egraph().find(val);
|
euf::enode* b = ctx.get_egraph().find(val);
|
||||||
|
if (!b) {
|
||||||
|
verbose_stream() << v << " " << val << "\n";
|
||||||
|
ctx.get_egraph().display(verbose_stream());
|
||||||
|
}
|
||||||
|
|
||||||
SASSERT(b);
|
SASSERT(b);
|
||||||
m_bv_plugin->explain_slice(var2enode(v), slice.offset, b, consume_eq);
|
m_bv_plugin->explain_slice(var2enode(v), slice.offset, b, consume_eq);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue