Fix RoundingMode mapping in API. (#5578)
authorAina Niemetz <aina.niemetz@gmail.com>
Wed, 2 Dec 2020 23:34:13 +0000 (15:34 -0800)
committerGitHub <noreply@github.com>
Wed, 2 Dec 2020 23:34:13 +0000 (15:34 -0800)
Fixes #5524.

src/api/cvc4cpp.cpp
test/regress/CMakeLists.txt
test/regress/regress0/fp/issue-5524.smt2 [new file with mode: 0644]

index 36edfdb468f04b31363a03a94efdbfa496556b58..80fb8a5fb70413998604d6aa47169104931a1538 100644 (file)
@@ -3075,7 +3075,7 @@ const static std::
             {ROUND_NEAREST_TIES_TO_EVEN,
              CVC4::RoundingMode::ROUND_NEAREST_TIES_TO_EVEN},
             {ROUND_TOWARD_POSITIVE, CVC4::RoundingMode::ROUND_TOWARD_POSITIVE},
-            {ROUND_TOWARD_NEGATIVE, CVC4::RoundingMode::ROUND_TOWARD_POSITIVE},
+            {ROUND_TOWARD_NEGATIVE, CVC4::RoundingMode::ROUND_TOWARD_NEGATIVE},
             {ROUND_TOWARD_ZERO, CVC4::RoundingMode::ROUND_TOWARD_ZERO},
             {ROUND_NEAREST_TIES_TO_AWAY,
              CVC4::RoundingMode::ROUND_NEAREST_TIES_TO_AWAY},
index 1826b31562368230b54e7eac975ed4dda45bec46..5ab1cd6c2e65009500d9bcf632eaca43b90b4417 100644 (file)
@@ -531,6 +531,7 @@ set(regress_0_tests
   regress0/fp/issue3536.smt2
   regress0/fp/issue3619.smt2
   regress0/fp/issue4277-assign-func.smt2
+  regress0/fp/issue-5524.smt2
   regress0/fp/rti_3_5_bug.smt2
   regress0/fp/rti_3_5_bug_report.smt2
   regress0/fp/simple.smt2
diff --git a/test/regress/regress0/fp/issue-5524.smt2 b/test/regress/regress0/fp/issue-5524.smt2
new file mode 100644 (file)
index 0000000..8c36116
--- /dev/null
@@ -0,0 +1,6 @@
+; REQUIRES: symfpu
+; EXPECT: unsat
+(set-logic QF_FP)
+(declare-fun fpv5 () Float32)
+(assert (fp.eq (fp.mul RTP fpv5 fpv5) ((_ to_fp 8 24) RTN 0.04)))
+(check-sat)