From: Andrew Reynolds Date: Sun, 13 Jun 2021 02:27:33 +0000 (-0500) Subject: Minor simplifications to LogicInfo (#6737) X-Git-Tag: cvc5-1.0.0~1606 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0d51f9839eb4a242de33576d884af82004d68cf2;p=cvc5.git Minor simplifications to LogicInfo (#6737) --- diff --git a/src/theory/logic_info.cpp b/src/theory/logic_info.cpp index 05f8c7a9f..8ba43aa1a 100644 --- a/src/theory/logic_info.cpp +++ b/src/theory/logic_info.cpp @@ -122,20 +122,10 @@ bool LogicInfo::hasEverything() const PrettyCheckArgument(d_locked, *this, "This LogicInfo isn't locked yet, and cannot be queried"); - // A logic has everything if all theories are enabled as well as quantifiers - bool doesNotHaveEverything = !isQuantified(); - for (TheoryId id = THEORY_FIRST; !doesNotHaveEverything && id < THEORY_LAST; - ++id) - { - // if not configured with symfpu, we allow THEORY_FP to be disabled and - // still *this to contain the ALL logic - if (!this->d_theories[id] - && (id != THEORY_FP || Configuration::isBuiltWithSymFPU())) - { - doesNotHaveEverything = true; - } - } - return !doesNotHaveEverything; + LogicInfo everything; + everything.enableEverything(isHigherOrder()); + everything.lock(); + return (*this == everything); } /** Is this the all-exclusive logic? (Here, that means propositional logic) */ @@ -223,16 +213,18 @@ bool LogicInfo::operator==(const LogicInfo& other) const { PrettyCheckArgument(d_sharingTheories == other.d_sharingTheories, *this, "LogicInfo internal inconsistency"); - bool res = d_cardinalityConstraints == other.d_cardinalityConstraints - && d_higherOrder == other.d_higherOrder; + if (d_cardinalityConstraints != other.d_cardinalityConstraints || + d_higherOrder != other.d_higherOrder ) + { + return false; + } if(isTheoryEnabled(theory::THEORY_ARITH)) { return d_integers == other.d_integers && d_reals == other.d_reals && d_transcendentals == other.d_transcendentals && d_linear == other.d_linear - && d_differenceLogic == other.d_differenceLogic && res; - } else { - return res; + && d_differenceLogic == other.d_differenceLogic; } + return true; } bool LogicInfo::operator<=(const LogicInfo& other) const {