[FP] Fix unused variable warning (#7977)
authorAndres Noetzli <andres.noetzli@gmail.com>
Tue, 25 Jan 2022 03:22:48 +0000 (19:22 -0800)
committerGitHub <noreply@github.com>
Tue, 25 Jan 2022 03:22:48 +0000 (03:22 +0000)
src/theory/fp/theory_fp.cpp

index bcbd9e297324ef370d5d763dd44ff396271570a6..547e525031fe70e3e32007c1a51f72ebd7855ad5 100644 (file)
@@ -855,10 +855,16 @@ bool TheoryFp::collectModelValues(TheoryModel* m,
           nm->mkNode(kind::FLOATINGPOINT_COMPONENT_SIGNIFICAND, node);
 
       eq::EqualityEngine* ee = m->getEqualityEngine();
-      Assert(ee->hasTerm(compNaN) && ee->getRepresentative(compNaN).isConst());
-      Assert(ee->hasTerm(compInf) && ee->getRepresentative(compInf).isConst());
-      Assert(ee->hasTerm(compZero)
-             && ee->getRepresentative(compZero).isConst());
+      Assert(ee->hasTerm(compNaN));
+      Assert(ee->hasTerm(compInf));
+      Assert(ee->hasTerm(compZero));
+      TNode rCompNaN = ee->getRepresentative(compNaN);
+      TNode rCompInf = ee->getRepresentative(compInf);
+      TNode rCompZero = ee->getRepresentative(compZero);
+      Assert(rCompNaN.isConst());
+      Assert(rCompInf.isConst());
+      Assert(rCompZero.isConst());
+
       Assert(ee->hasTerm(compExponent)
              && ee->getRepresentative(compExponent).isConst());
       Assert(ee->hasTerm(compSignificand));
@@ -866,11 +872,9 @@ bool TheoryFp::collectModelValues(TheoryModel* m,
 
       // At most one of the flags (NaN, inf, zero) can be set
       Node one = nm->mkConst(BitVector(1U, 1U));
-      size_t numFlags = 0;
-      numFlags += ee->getRepresentative(compNaN) == one ? 1 : 0;
-      numFlags += ee->getRepresentative(compInf) == one ? 1 : 0;
-      numFlags += ee->getRepresentative(compZero) == one ? 1 : 0;
-      Assert(numFlags <= 1);
+      Assert((rCompNaN == one ? 1 : 0) + (rCompInf == one ? 1 : 0)
+                 + (rCompZero == one ? 1 : 0)
+             <= 1);
     }
   }