Skip to content

Commit

Permalink
Revert
Browse files Browse the repository at this point in the history
  • Loading branch information
ajreynol committed Oct 18, 2024
1 parent a197e07 commit b012a2e
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 5 deletions.
9 changes: 6 additions & 3 deletions src/theory/arith/nl/ext/monomial_check.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -796,10 +796,13 @@ Node MonomialCheck::mkLit(Node a, Node b, int status, bool isAbsolute) const
Node zero = mkZero(a.getType());
Node a_is_nonnegative = nm->mkNode(Kind::GEQ, a, zero);
Node b_is_nonnegative = nm->mkNode(Kind::GEQ, b, zero);
Node negate_a = nm->mkNode(Kind::NEG, a);
Node negate_b = nm->mkNode(Kind::NEG, b);
Node polEq = a_is_nonnegative.eqNode(b_is_nonnegative);
ret = nm->mkNode(Kind::ITE, polEq, nm->mkNode(k, a, b),
nm->mkNode(k, a, negate_b));
ret = a_is_nonnegative.iteNode(
b_is_nonnegative.iteNode(nm->mkNode(k, a, b),
nm->mkNode(k, a, negate_b)),
b_is_nonnegative.iteNode(nm->mkNode(k, negate_a, b),
nm->mkNode(k, negate_a, negate_b)));
}
}
return ret;
Expand Down
21 changes: 19 additions & 2 deletions src/theory/arith/rewrites
Original file line number Diff line number Diff line change
Expand Up @@ -79,5 +79,22 @@
(define-rule arith-pi-not-int () (is_int real.pi) false)

;(define-rule arith-abs-eq ((x ?) (y ?)) (= (abs x) (abs y)) (or (= x y) (= x (- y))))
;(define-rule arith-abs-int-gt ((x Int) (y Int)) (> (abs x) (abs y)) (ite (= (>= x 0) (>= y 0)) (= x y) (= x (- y))))
;(define-rule arith-abs-real-gt ((x Real) (y Real)) (> (abs x) (abs y)) (ite (= (>= x 0/1) (>= y 0/1)) (= x y) (= x (- y))))
;(define-rule arith-abs-int-gt ((x Int) (y Int))
; (> (abs x) (abs y))
; (ite (>= x 0)
; (ite (>= y 0)
; (> x y)
; (> x (- y)))
; (ite (>= y 0)
; (> (- x) y)
; (> (- x) (- y)))))
;
;(define-rule arith-abs-real-gt ((x Real) (y Real))
; (> (abs x) (abs y))
; (ite (>= x 0/1)
; (ite (>= y 0/1)
; (> x y)
; (> x (- y)))
; (ite (>= y 0/1)
; (> (- x) y)
; (> (- x) (- y)))))

0 comments on commit b012a2e

Please sign in to comment.