mirror of
https://github.com/Z3Prover/z3
synced 2025-04-23 00:55:31 +00:00
Print polynomials with power
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
6413c8717a
commit
278babe625
1 changed files with 17 additions and 4 deletions
|
@ -1350,12 +1350,25 @@ namespace dd {
|
|||
out << c;
|
||||
if (!m.second.empty()) out << "*";
|
||||
}
|
||||
bool f = true;
|
||||
unsigned v_prev = UINT_MAX;
|
||||
unsigned pow = 0;
|
||||
for (unsigned v : m.second) {
|
||||
if (!f) out << "*";
|
||||
f = false;
|
||||
out << "v" << v;
|
||||
if (v == v_prev) {
|
||||
pow++;
|
||||
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";
|
||||
return out;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue