3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-08-24 12:07:52 +00:00

lit_pp with extra information

This commit is contained in:
Jakob Rath 2022-08-17 09:29:00 +02:00
parent 618b3945c1
commit 201d841a90
2 changed files with 23 additions and 1 deletions

View file

@ -920,7 +920,7 @@ namespace polysat {
void solver::add_clause(clause& clause) {
LOG((clause.is_redundant() ? "Lemma: ": "Aux: ") << clause);
for (sat::literal lit : clause) {
LOG(" Literal " << lit << " is: " << lit2cnstr(lit));
LOG(" Literal " << lit << " is: " << lit_pp(*this, lit));
// SASSERT(m_bvars.value(lit) != l_true);
// it could be that such a literal has been created previously but we don't detect it when e.g. narrowing a mul_ovfl_constraint
if (m_bvars.value(lit) == l_true) {
@ -1046,6 +1046,17 @@ namespace polysat {
return out;
}
std::ostream& lit_pp::display(std::ostream& out) const {
auto c = s.lit2cnstr(lit);
out << lit << ": " << c << " [";
out << " bvalue=" << s.m_bvars.value(lit);
if (s.m_bvars.is_assigned(lit))
out << " @" << s.m_bvars.level(lit);
out << " pwatched=" << c->is_pwatched();
out << " ]";
return out;
}
std::ostream& num_pp::display(std::ostream& out) const {
rational const& p = rational::power_of_two(s.size(var));
if (val > mod(-val, p))