From 47f003828a8ba0cd8edd362accaef8b2449b0c46 Mon Sep 17 00:00:00 2001 From: Gereon Kremer Date: Wed, 5 Aug 2020 20:55:00 +0200 Subject: [PATCH] Improve error message for unsupported exponents (#4852) We have had a few issues where essentially users misinterpreted the error message about which types of exponents are supported for (^ base exp). Given that this is rewritten to a multiplication of length exp, we only support reasonably small natural numbers. This PR improves the error message. Fixes #4692 --- src/theory/arith/arith_rewriter.cpp | 11 +++++++---- test/regress/CMakeLists.txt | 1 + test/regress/regress1/arith/bug716.1.cvc | 2 +- test/regress/regress1/arith/bug716.2.cvc | 6 ++++++ 4 files changed, 15 insertions(+), 5 deletions(-) create mode 100644 test/regress/regress1/arith/bug716.2.cvc diff --git a/src/theory/arith/arith_rewriter.cpp b/src/theory/arith/arith_rewriter.cpp index 188ef47e6..f0e0487a0 100644 --- a/src/theory/arith/arith_rewriter.cpp +++ b/src/theory/arith/arith_rewriter.cpp @@ -229,8 +229,9 @@ RewriteResponse ArithRewriter::postRewriteTerm(TNode t){ if(exp.sgn() == 0){ return RewriteResponse(REWRITE_DONE, mkRationalNode(Rational(1))); }else if(exp.sgn() > 0 && exp.isIntegral()){ - CVC4::Rational r(INT_MAX); - if( exp