3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-06-29 09:28:45 +00:00
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2017-09-23 22:36:36 -05:00
parent 95ee4c94f1
commit 2751cbc270
10 changed files with 70 additions and 52 deletions

View file

@ -151,14 +151,15 @@ namespace smt {
m_autil.is_numeral(rhs, _k);
numeral offset(_k);
app * s, * t;
if (m_autil.is_add(lhs) && to_app(lhs)->get_num_args() == 2 && is_times_minus_one(to_app(lhs)->get_arg(1), s)) {
t = to_app(to_app(lhs)->get_arg(0));
expr *arg1, *arg2;
if (m_autil.is_add(lhs, arg1, arg2) && is_times_minus_one(arg2, s)) {
t = to_app(arg1);
}
else if (m_autil.is_add(lhs) && to_app(lhs)->get_num_args() == 2 && is_times_minus_one(to_app(lhs)->get_arg(0), s)) {
t = to_app(to_app(lhs)->get_arg(1));
else if (m_autil.is_add(lhs, arg1, arg2) && is_times_minus_one(arg1, s)) {
t = to_app(arg2);
}
else if (m_autil.is_mul(lhs) && to_app(lhs)->get_num_args() == 2 && m_autil.is_minus_one(to_app(lhs)->get_arg(0))) {
s = to_app(to_app(lhs)->get_arg(1));
else if (m_autil.is_mul(lhs, arg1, arg2) && m_autil.is_minus_one(arg1)) {
s = to_app(arg2);
t = mk_zero_for(s);
}
else if (!m_autil.is_arith_expr(lhs)) {
@ -170,6 +171,7 @@ namespace smt {
found_non_diff_logic_expr(n);
return false;
}
TRACE("arith", tout << expr_ref(lhs, get_manager()) << " " << expr_ref(s, get_manager()) << " " << expr_ref(t, get_manager()) << "\n";);
source = internalize_term_core(s);
target = internalize_term_core(t);
if (source == null_theory_var || target == null_theory_var) {