summaryrefslogtreecommitdiff
path: root/test/unit
diff options
context:
space:
mode:
authorAndres Noetzli <andres.noetzli@gmail.com>2020-01-31 06:06:39 -0800
committerGitHub <noreply@github.com>2020-01-31 08:06:39 -0600
commitb77641f3db3d868536549deb0fc7851ff07b5e88 (patch)
tree3377181222efba76be911604e8f179d3c90d7cb9 /test/unit
parenta456ef81b15e2f8612cd41a31ad811af35f47846 (diff)
Fix arithmetic rewriter for exponential (#3688)
Diffstat (limited to 'test/unit')
-rw-r--r--test/unit/theory/theory_arith_white.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/unit/theory/theory_arith_white.h b/test/unit/theory/theory_arith_white.h
index 0e71fe911..0460759bc 100644
--- a/test/unit/theory/theory_arith_white.h
+++ b/test/unit/theory/theory_arith_white.h
@@ -294,6 +294,7 @@ public:
void testIntNormalForm() {
Node x = d_nm->mkVar(*d_intType);
+ Node xr = d_nm->mkVar(*d_realType);
Node c0 = d_nm->mkConst<Rational>(d_zero);
Node c1 = d_nm->mkConst<Rational>(d_one);
Node c2 = d_nm->mkConst<Rational>(Rational(2));
@@ -327,5 +328,10 @@ public:
// (abs x) --> (abs x)
Node absX = d_nm->mkNode(ABS, x);
TS_ASSERT_EQUALS(Rewriter::rewrite(absX), absX);
+
+ // (exp (+ 2 + x)) --> (* (exp x) (exp 1) (exp 1))
+ Node t = d_nm->mkNode(EXPONENTIAL, d_nm->mkNode(PLUS, c2, xr)).eqNode(c0);
+ TS_ASSERT_EQUALS(Rewriter::rewrite(Rewriter::rewrite(t)),
+ Rewriter::rewrite(t));
}
};
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback