summaryrefslogtreecommitdiff
path: root/src/theory/arith
diff options
context:
space:
mode:
authorAndres Noetzli <andres.noetzli@gmail.com>2019-10-28 08:59:44 -0700
committerAndrew Reynolds <andrew.j.reynolds@gmail.com>2019-10-28 10:59:44 -0500
commit885ec2cf131450f7f651b68a1cae3920665da31a (patch)
treead1ddb5be206baead992983b4e376d45cb37f292 /src/theory/arith
parent3af2dfea22aae0d527fcfa93600c451b323c15b7 (diff)
Fix integer division rewrite (#3415)
Diffstat (limited to 'src/theory/arith')
-rw-r--r--src/theory/arith/arith_rewriter.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/theory/arith/arith_rewriter.cpp b/src/theory/arith/arith_rewriter.cpp
index 6dd6ffd56..86e5b3195 100644
--- a/src/theory/arith/arith_rewriter.cpp
+++ b/src/theory/arith/arith_rewriter.cpp
@@ -742,8 +742,10 @@ RewriteResponse ArithRewriter::rewriteIntsDivModTotal(TNode t, bool pre){
// (mod x (- c)) ---> (mod x c)
NodeManager* nm = NodeManager::currentNM();
Node nn = nm->mkNode(k, t[0], nm->mkConst(-t[1].getConst<Rational>()));
- Node ret = k == kind::INTS_DIVISION ? nm->mkNode(kind::UMINUS, nn) : nn;
- return RewriteResponse(REWRITE_AGAIN, nn);
+ Node ret = (k == kind::INTS_DIVISION || k == kind::INTS_DIVISION_TOTAL)
+ ? nm->mkNode(kind::UMINUS, nn)
+ : nn;
+ return RewriteResponse(REWRITE_AGAIN, ret);
}else if(dIsConstant && n.getKind() == kind::CONST_RATIONAL){
Assert(d.getConst<Rational>().isIntegral());
Assert(n.getConst<Rational>().isIntegral());
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback