diff --git a/src/builder/DdPrismModelBuilder.cpp b/src/builder/DdPrismModelBuilder.cpp index fb0707e77..3a897c1db 100644 --- a/src/builder/DdPrismModelBuilder.cpp +++ b/src/builder/DdPrismModelBuilder.cpp @@ -543,7 +543,7 @@ namespace storm { template typename DdPrismModelBuilder::ActionDecisionDiagram DdPrismModelBuilder::combineCommandsToActionMDP(GenerationInformation& generationInfo, std::vector& commandDds, uint_fast64_t nondeterminismVariableOffset) { - storm::dd::Add allGuards = generationInfo.manager->template getAddZero(); + storm::dd::Bdd allGuards = generationInfo.manager->getBddZero(); storm::dd::Add allCommands = generationInfo.manager->template getAddZero(); // Make all command DDs assign to the same global variables. @@ -553,7 +553,7 @@ namespace storm { storm::dd::Add sumOfGuards = generationInfo.manager->template getAddZero(); for (auto const& commandDd : commandDds) { sumOfGuards += commandDd.guardDd; - allGuards = allGuards || commandDd.guardDd; + allGuards |= commandDd.guardDd.toBdd(); } uint_fast64_t maxChoices = static_cast(sumOfGuards.getMax()); @@ -634,7 +634,7 @@ namespace storm { sumOfGuards = sumOfGuards * (!equalsNumberOfChoicesDd).template toAdd(); } - return ActionDecisionDiagram(allGuards, allCommands, assignedGlobalVariables, nondeterminismVariableOffset + numberOfBinaryVariables); + return ActionDecisionDiagram(allGuards.template toAdd(), allCommands, assignedGlobalVariables, nondeterminismVariableOffset + numberOfBinaryVariables); } } @@ -685,7 +685,7 @@ namespace storm { // Add a new variable that resolves the nondeterminism between the two choices. storm::dd::Add combinedTransitions = generationInfo.manager->getEncoding(generationInfo.nondeterminismMetaVariables[numberOfUsedNondeterminismVariables], 1).template toAdd().ite(action2Extended, action1Extended); - return ActionDecisionDiagram(action1.guardDd || action2.guardDd, combinedTransitions, assignedGlobalVariables, numberOfUsedNondeterminismVariables + 1); + return ActionDecisionDiagram((action1.guardDd.toBdd() || action2.guardDd.toBdd()).template toAdd(), combinedTransitions, assignedGlobalVariables, numberOfUsedNondeterminismVariables + 1); } else { STORM_LOG_THROW(false, storm::exceptions::InvalidStateException, "Illegal model type."); } diff --git a/src/storage/dd/Add.cpp b/src/storage/dd/Add.cpp index b3a504956..f43740418 100644 --- a/src/storage/dd/Add.cpp +++ b/src/storage/dd/Add.cpp @@ -35,23 +35,6 @@ namespace storm { metaVariables.insert(this->getContainedMetaVariables().begin(), this->getContainedMetaVariables().end()); return Add(this->getDdManager(), internalAdd.ite(thenAdd.internalAdd, elseAdd.internalAdd), metaVariables); } - -// template -// Add Add::operator!() const { -// return Add(this->getDdManager(), !internalAdd, this->getContainedMetaVariables()); -// } - - template - Add Add::operator||(Add const& other) const { - return Add(this->getDdManager(), internalAdd || other.internalAdd, Dd::joinMetaVariables(*this, other)); - } - - template - Add& Add::operator|=(Add const& other) { - this->addMetaVariables(other.getContainedMetaVariables()); - internalAdd |= other.internalAdd; - return *this; - } template Add Add::operator+(Add const& other) const { diff --git a/src/storage/dd/Add.h b/src/storage/dd/Add.h index 36cd2d98e..5134044ec 100644 --- a/src/storage/dd/Add.h +++ b/src/storage/dd/Add.h @@ -75,32 +75,6 @@ namespace storm { */ Add ite(Add const& thenAdd, Add const& elseAdd) const; - /*! - * Logically inverts the current ADD. That is, all inputs yielding non-zero values will be mapped to zero in - * the result and vice versa. - * - * @return The resulting ADD. - */ -// Add operator!() const; - - /*! - * Performs a logical or of the current anBd the given ADD. As a prerequisite, the operand ADDs need to be - * 0/1 ADDs. - * - * @param other The second ADD used for the operation. - * @return The logical or of the operands. - */ - Add operator||(Add const& other) const; - - /*! - * Performs a logical or of the current and the given ADD and assigns it to the current ADD. As a - * prerequisite, the operand ADDs need to be 0/1 ADDs. - * - * @param other The second ADD used for the operation. - * @return A reference to the current ADD after the operation - */ - Add& operator|=(Add const& other); - /*! * Adds the two ADDs. * diff --git a/src/storage/dd/cudd/InternalCuddAdd.cpp b/src/storage/dd/cudd/InternalCuddAdd.cpp index 83e317d97..40defb627 100644 --- a/src/storage/dd/cudd/InternalCuddAdd.cpp +++ b/src/storage/dd/cudd/InternalCuddAdd.cpp @@ -31,23 +31,7 @@ namespace storm { InternalAdd InternalAdd::ite(InternalAdd const& thenDd, InternalAdd const& elseDd) const { return InternalAdd(ddManager, this->getCuddAdd().Ite(thenDd.getCuddAdd(), elseDd.getCuddAdd())); } - - template - InternalAdd InternalAdd::operator!() const { - return InternalAdd(ddManager, ~this->getCuddAdd()); - } - - template - InternalAdd InternalAdd::operator||(InternalAdd const& other) const { - return InternalAdd(ddManager, this->getCuddAdd() | other.getCuddAdd()); - } - - template - InternalAdd& InternalAdd::operator|=(InternalAdd const& other) { - this->cuddAdd = this->getCuddAdd() | other.getCuddAdd(); - return *this; - } - + template InternalAdd InternalAdd::operator+(InternalAdd const& other) const { return InternalAdd(ddManager, this->getCuddAdd() + other.getCuddAdd()); diff --git a/src/storage/dd/cudd/InternalCuddAdd.h b/src/storage/dd/cudd/InternalCuddAdd.h index 2d5b2110d..44372e6aa 100644 --- a/src/storage/dd/cudd/InternalCuddAdd.h +++ b/src/storage/dd/cudd/InternalCuddAdd.h @@ -82,32 +82,6 @@ namespace storm { */ InternalAdd ite(InternalAdd const& thenAdd, InternalAdd const& elseAdd) const; - /*! - * Logically inverts the current ADD. That is, all inputs yielding non-zero values will be mapped to zero in - * the result and vice versa. - * - * @return The resulting ADD. - */ - InternalAdd operator!() const; - - /*! - * Performs a logical or of the current and the given ADD. As a prerequisite, the operand ADDs need to be - * 0/1 ADDs. - * - * @param other The second ADD used for the operation. - * @return The logical or of the operands. - */ - InternalAdd operator||(InternalAdd const& other) const; - - /*! - * Performs a logical or of the current and the given ADD and assigns it to the current ADD. As a - * prerequisite, the operand ADDs need to be 0/1 ADDs. - * - * @param other The second ADD used for the operation. - * @return A reference to the current ADD after the operation - */ - InternalAdd& operator|=(InternalAdd const& other); - /*! * Adds the two ADDs. * diff --git a/src/storage/dd/sylvan/InternalSylvanAdd.cpp b/src/storage/dd/sylvan/InternalSylvanAdd.cpp index 453445a5d..ba7d2ec21 100644 --- a/src/storage/dd/sylvan/InternalSylvanAdd.cpp +++ b/src/storage/dd/sylvan/InternalSylvanAdd.cpp @@ -26,22 +26,7 @@ namespace storm { InternalAdd InternalAdd::ite(InternalAdd const& thenDd, InternalAdd const& elseDd) const { STORM_LOG_THROW(false, storm::exceptions::NotImplementedException, "Not yet implemented."); } - - template - InternalAdd InternalAdd::operator!() const { - STORM_LOG_THROW(false, storm::exceptions::NotImplementedException, "Not yet implemented."); - } - - template - InternalAdd InternalAdd::operator||(InternalAdd const& other) const { - STORM_LOG_THROW(false, storm::exceptions::NotImplementedException, "Not yet implemented."); - } - - template - InternalAdd& InternalAdd::operator|=(InternalAdd const& other) { - STORM_LOG_THROW(false, storm::exceptions::NotImplementedException, "Not yet implemented."); - } - + template InternalAdd InternalAdd::operator+(InternalAdd const& other) const { return InternalAdd(ddManager, this->sylvanMtbdd.Plus(other.sylvanMtbdd)); diff --git a/src/storage/dd/sylvan/InternalSylvanAdd.h b/src/storage/dd/sylvan/InternalSylvanAdd.h index 39696ae9b..3cc68a761 100644 --- a/src/storage/dd/sylvan/InternalSylvanAdd.h +++ b/src/storage/dd/sylvan/InternalSylvanAdd.h @@ -81,33 +81,7 @@ namespace storm { * @return The ADD corresponding to the if-then-else of the operands. */ InternalAdd ite(InternalAdd const& thenAdd, InternalAdd const& elseAdd) const; - - /*! - * Logically inverts the current ADD. That is, all inputs yielding non-zero values will be mapped to zero in - * the result and vice versa. - * - * @return The resulting ADD. - */ - InternalAdd operator!() const; - - /*! - * Performs a logical or of the current and the given ADD. As a prerequisite, the operand ADDs need to be - * 0/1 ADDs. - * - * @param other The second ADD used for the operation. - * @return The logical or of the operands. - */ - InternalAdd operator||(InternalAdd const& other) const; - - /*! - * Performs a logical or of the current and the given ADD and assigns it to the current ADD. As a - * prerequisite, the operand ADDs need to be 0/1 ADDs. - * - * @param other The second ADD used for the operation. - * @return A reference to the current ADD after the operation - */ - InternalAdd& operator|=(InternalAdd const& other); - + /*! * Adds the two ADDs. *