mirror of
https://github.com/Z3Prover/z3
synced 2025-04-29 11:55:51 +00:00
fixes in nex expressions
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
This commit is contained in:
parent
3929e002a5
commit
f9beef19ce
4 changed files with 60 additions and 45 deletions
|
@ -398,5 +398,33 @@ inline bool less_than_nex_standard(const nex* a, const nex* b) {
|
|||
lt_on_vars lt = [](lpvar j, lpvar k) { return j < k; };
|
||||
return less_than_nex(a, b, lt);
|
||||
}
|
||||
|
||||
inline std::unordered_set<lpvar> get_vars_of_expr(const nex *e ) {
|
||||
std::unordered_set<lpvar> r;
|
||||
switch (e->type()) {
|
||||
case expr_type::SCALAR:
|
||||
return r;
|
||||
case expr_type::SUM:
|
||||
{
|
||||
for (auto c: *to_sum(e))
|
||||
for ( lpvar j : get_vars_of_expr(c))
|
||||
r.insert(j);
|
||||
}
|
||||
case expr_type::MUL:
|
||||
{
|
||||
for (auto &c: *to_mul(e))
|
||||
for ( lpvar j : get_vars_of_expr(c.e()))
|
||||
r.insert(j);
|
||||
}
|
||||
return r;
|
||||
case expr_type::VAR:
|
||||
r.insert(to_var(e)->var());
|
||||
return r;
|
||||
default:
|
||||
TRACE("nla_cn_details", tout << e->type() << "\n";);
|
||||
SASSERT(false);
|
||||
return r;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue