3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-24 01:25:31 +00:00

add test routines to nla_expr

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
This commit is contained in:
Lev Nachmanson 2019-08-19 10:53:40 -07:00
parent 9266ab7ed1
commit 63748206fe
2 changed files with 39 additions and 2 deletions

View file

@ -556,6 +556,41 @@ public:
}
bool done() const { return m_done; }
#if Z3DEBUG
nex *clone (nex * a) {
switch (a->type()) {
case expr_type::VAR: {
auto v = to_var(a);
return mk_var(v->var());
}
case expr_type::SCALAR: {
auto v = to_scalar(a);
return mk_scalar(v->value());
}
case expr_type::MUL: {
auto m = to_mul(a);
auto r = mk_mul();
for (nex * e : m->children()) {
r->add_child(clone(e));
}
return r;
}
case expr_type::SUM: {
auto m = to_sum(a);
auto r = mk_sum();
for (nex * e : m->children()) {
r->add_child(clone(e));
}
return r;
}
default:
SASSERT(false);
break;
}
return nullptr;
}
#endif
};
}