mirror of
https://github.com/Z3Prover/z3
synced 2025-04-15 05:18:44 +00:00
reduce_invertible: recognize (* x -1) as the same as (- x)
This commit is contained in:
parent
cf0952c232
commit
91497f923a
|
@ -105,6 +105,17 @@ private:
|
|||
throw tactic_exception(m.limit().get_cancel_msg());
|
||||
}
|
||||
|
||||
bool is_bv_neg(expr * e) {
|
||||
if (m_bv.is_bv_neg(e))
|
||||
return true;
|
||||
|
||||
expr *a, *b;
|
||||
if (m_bv.is_bv_mul(e, a, b)) {
|
||||
return m_bv.is_allone(a) || m_bv.is_allone(b);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
expr_mark m_inverted;
|
||||
void mark_inverted(expr *p) {
|
||||
ptr_buffer<expr> todo;
|
||||
|
@ -256,7 +267,7 @@ private:
|
|||
|
||||
if (m_bv.is_bv_xor(p) ||
|
||||
m_bv.is_bv_not(p) ||
|
||||
m_bv.is_bv_neg(p)) {
|
||||
is_bv_neg(p)) {
|
||||
if (mc) {
|
||||
ensure_mc(mc);
|
||||
(*mc)->add(v, p);
|
||||
|
|
Loading…
Reference in a new issue