Fix type checking of to_real (#1127)
authorMartin Brain <martin.brain@cs.ox.ac.uk>
Wed, 27 Sep 2017 03:00:17 +0000 (20:00 -0700)
committerAndres Noetzli <noetzli@stanford.edu>
Wed, 27 Sep 2017 03:03:31 +0000 (20:03 -0700)
to_real takes a single argument as given in kinds.

src/theory/fp/theory_fp_type_rules.h

index 54205315fb25d0981a55c49ffdaa01ae26450412..fe39993d403feae4c4393f7f9a91f22d8b9b805b 100644 (file)
@@ -445,16 +445,9 @@ class FloatingPointToRealTypeRule {
     TRACE("FloatingPointToRealTypeRule");
 
     if (check) {
-      TypeNode roundingModeType = n[0].getType(check);
-
-      if (!roundingModeType.isRoundingMode()) {
-        throw TypeCheckingExceptionPrivate(
-            n, "first argument must be a rounding mode");
-      }
-
-      TypeNode operand = n[1].getType(check);
+      TypeNode operandType = n[0].getType(check);
 
-      if (!operand.isFloatingPoint()) {
+      if (!operandType.isFloatingPoint()) {
         throw TypeCheckingExceptionPrivate(
             n, "floating-point to real applied to a non floating-point sort");
       }