From 44232973fcb5b09d5440ef25cdb969fe4ad37962 Mon Sep 17 00:00:00 2001 From: Andres Noetzli Date: Mon, 24 Jan 2022 19:22:48 -0800 Subject: [PATCH] [FP] Fix unused variable warning (#7977) --- src/theory/fp/theory_fp.cpp | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/theory/fp/theory_fp.cpp b/src/theory/fp/theory_fp.cpp index bcbd9e297..547e52503 100644 --- a/src/theory/fp/theory_fp.cpp +++ b/src/theory/fp/theory_fp.cpp @@ -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); } } -- 2.30.2