3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-25 18:15:32 +00:00

normalize more pretty printing

This commit is contained in:
Nikolaj Bjorner 2022-08-17 08:24:41 -07:00
parent 309473edad
commit 31ffe89480
3 changed files with 7 additions and 4 deletions

View file

@ -1627,9 +1627,9 @@ namespace dd {
rational c = abs(m.first);
m.second.reverse();
if (!c.is_one() || m.second.empty()) {
if (m_semantics == mod2N_e && mod(-c, m_mod2N) < c)
out << -mod(-c, m_mod2N);
else
if (m_semantics == mod2N_e)
out << normalize(c);
else
out << c;
if (!m.second.empty()) out << "*";
}

View file

@ -374,6 +374,8 @@ namespace dd {
unsigned power_of_2() const { return m_power_of_2; }
rational const& max_value() const { return m_max_value; }
rational const& two_to_N() const { return m_mod2N; }
rational normalize(rational const& n) const { return mod(-n, m_mod2N) < n ? -mod(-n, m_mod2N) : n; }
unsigned_vector const& free_vars(pdd const& p);