3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-29 11:55:51 +00:00

fix nex simplification

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
This commit is contained in:
Lev Nachmanson 2019-10-01 11:18:25 -07:00
parent 9f8f6dee9e
commit f07d9a80c5
4 changed files with 24 additions and 10 deletions

View file

@ -141,10 +141,18 @@ public:
int& pow() { return m_power; }
std::string to_string() const {
std::stringstream s;
if (pow() == 1) {
s <<"(" << *e() << ")";
if (pow() == 1) {
if (e()->is_elementary()) {
s << *e();
} else {
s <<"(" << *e() << ")";
}
} else {
s << "(" << *e() << "^" << pow() << ")";
if (e()->is_elementary()){
s << "(" << *e() << "^" << pow() << ")";
} else {
s << "((" << *e() << ")^" << pow() << ")";
}
}
return s.str();
}