mirror of
https://github.com/Z3Prover/z3
synced 2025-06-28 08:58:44 +00:00
Print polynomials with power
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
0e9fc4762a
commit
f18789257e
1 changed files with 17 additions and 4 deletions
|
@ -1350,12 +1350,25 @@ namespace dd {
|
||||||
out << c;
|
out << c;
|
||||||
if (!m.second.empty()) out << "*";
|
if (!m.second.empty()) out << "*";
|
||||||
}
|
}
|
||||||
bool f = true;
|
unsigned v_prev = UINT_MAX;
|
||||||
|
unsigned pow = 0;
|
||||||
for (unsigned v : m.second) {
|
for (unsigned v : m.second) {
|
||||||
if (!f) out << "*";
|
if (v == v_prev) {
|
||||||
f = false;
|
pow++;
|
||||||
out << "v" << v;
|
continue;
|
||||||
}
|
}
|
||||||
|
if (v_prev != UINT_MAX) {
|
||||||
|
out << "v" << v_prev;
|
||||||
|
if (pow > 1)
|
||||||
|
out << "^" << pow;
|
||||||
|
out << "*";
|
||||||
|
}
|
||||||
|
pow = 1;
|
||||||
|
v_prev = v;
|
||||||
|
}
|
||||||
|
out << "v" << v_prev;
|
||||||
|
if (pow > 1)
|
||||||
|
out << "^" << pow;
|
||||||
}
|
}
|
||||||
if (first) out << "0";
|
if (first) out << "0";
|
||||||
return out;
|
return out;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue