3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-05-08 00:05:46 +00:00
The model is fine, but debug facility that checks the model reports a false positive.
It exposed some further opportunities for simplification
This commit is contained in:
Nikolaj Bjorner 2020-03-12 10:57:35 -07:00
parent 7a80fe20ca
commit 356a9bb9ed
2 changed files with 13 additions and 0 deletions

View file

@ -647,6 +647,13 @@ bool arith_decl_plugin::are_distinct(app * a, app * b) const {
if (is_app_of(a, m_family_id, OP_IRRATIONAL_ALGEBRAIC_NUM) && is_app_of(b, m_family_id, OP_IRRATIONAL_ALGEBRAIC_NUM)) {
return am().neq(aw().to_anum(a->get_decl()), aw().to_anum(b->get_decl()));
}
if (is_app_of(a, m_family_id, OP_IRRATIONAL_ALGEBRAIC_NUM) && is_app_of(b, m_family_id, OP_NUM)) {
std::swap(a, b);
}
if (is_app_of(a, m_family_id, OP_NUM) && is_app_of(b, m_family_id, OP_IRRATIONAL_ALGEBRAIC_NUM)) {
rational val = a->get_decl()->get_parameter(0).get_rational();
return am().neq(aw().to_anum(b->get_decl()), val.to_mpq());
}
#define is_non_zero(e) is_app_of(e,m_family_id, OP_NUM) && !to_app(e)->get_decl()->get_parameter(0).get_rational().is_zero()