Browse Source

moved cudd's c++ objects to a separate namespace in an attempt to make cudd and sylvan coexist without name clashes

Former-commit-id: 425381c8e8
main
dehnert 10 years ago
parent
commit
cb58b79e24
  1. 3
      resources/3rdparty/cudd-2.5.0/src/obj/cuddObj.cc
  2. 5
      resources/3rdparty/cudd-2.5.0/src/obj/cuddObj.hh
  3. 2
      src/storage/dd/cudd/CuddAddIterator.cpp
  4. 24
      src/storage/dd/cudd/InternalCuddAdd.cpp
  5. 8
      src/storage/dd/cudd/InternalCuddAdd.h
  6. 22
      src/storage/dd/cudd/InternalCuddBdd.cpp
  7. 12
      src/storage/dd/cudd/InternalCuddBdd.h
  8. 4
      src/storage/dd/cudd/InternalCuddDdManager.cpp
  9. 6
      src/storage/dd/cudd/InternalCuddDdManager.h
  10. 1
      src/storage/dd/sylvan/InternalSylvanBdd.cpp
  11. 5
      src/storage/dd/sylvan/InternalSylvanBdd.h

3
resources/3rdparty/cudd-2.5.0/src/obj/cuddObj.cc

@ -72,6 +72,7 @@ static char rcsid[] UNUSED = "$Id: cuddObj.cc,v 1.15 2012/02/05 01:06:40 fabio E
// Members of class DD // Members of class DD
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
namespace cudd {
DD::DD() : p(0), node(0) {} DD::DD() : p(0), node(0) {}
@ -5835,3 +5836,5 @@ Cudd::DumpDot(
checkReturnValue(result); checkReturnValue(result);
} // vector<ZDD>::DumpDot } // vector<ZDD>::DumpDot
} // end namespace cudd

5
resources/3rdparty/cudd-2.5.0/src/obj/cuddObj.hh

@ -72,6 +72,8 @@
#include <vector> #include <vector>
#include "cudd.h" #include "cudd.h"
namespace cudd {
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
/* Type definitions */ /* Type definitions */
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
@ -770,7 +772,8 @@ public:
}; // Cudd }; // Cudd
extern void defaultError(std::string message); extern void defaultError(std::string message);
} // end namespace cudd
#endif #endif

2
src/storage/dd/cudd/CuddAddIterator.cpp

@ -67,7 +67,7 @@ namespace storm {
// found solutions and get the next "first" cube. // found solutions and get the next "first" cube.
if (this->relevantDontCareDdVariables.empty() || this->cubeCounter >= std::pow(2, this->relevantDontCareDdVariables.size()) - 1) { if (this->relevantDontCareDdVariables.empty() || this->cubeCounter >= std::pow(2, this->relevantDontCareDdVariables.size()) - 1) {
// Get the next cube and check for emptiness. // Get the next cube and check for emptiness.
ABDD::NextCube(generator, &cube, &valueAsDouble);
cudd::ABDD::NextCube(generator, &cube, &valueAsDouble);
this->isAtEnd = (Cudd_IsGenEmpty(generator) != 0); this->isAtEnd = (Cudd_IsGenEmpty(generator) != 0);
// In case we are not done yet, we get ready to treat the next cube. // In case we are not done yet, we get ready to treat the next cube.

24
src/storage/dd/cudd/InternalCuddAdd.cpp

@ -13,7 +13,7 @@
namespace storm { namespace storm {
namespace dd { namespace dd {
template<typename ValueType> template<typename ValueType>
InternalAdd<DdType::CUDD, ValueType>::InternalAdd(InternalDdManager<DdType::CUDD> const* ddManager, ADD cuddAdd) : ddManager(ddManager), cuddAdd(cuddAdd) {
InternalAdd<DdType::CUDD, ValueType>::InternalAdd(InternalDdManager<DdType::CUDD> const* ddManager, cudd::ADD cuddAdd) : ddManager(ddManager), cuddAdd(cuddAdd) {
// Intentionally left empty. // Intentionally left empty.
} }
@ -183,8 +183,8 @@ namespace storm {
template<typename ValueType> template<typename ValueType>
InternalAdd<DdType::CUDD, ValueType> InternalAdd<DdType::CUDD, ValueType>::swapVariables(std::vector<InternalAdd<DdType::CUDD, ValueType>> const& from, std::vector<InternalAdd<DdType::CUDD, ValueType>> const& to) const { InternalAdd<DdType::CUDD, ValueType> InternalAdd<DdType::CUDD, ValueType>::swapVariables(std::vector<InternalAdd<DdType::CUDD, ValueType>> const& from, std::vector<InternalAdd<DdType::CUDD, ValueType>> const& to) const {
std::vector<ADD> fromAdd;
std::vector<ADD> toAdd;
std::vector<cudd::ADD> fromAdd;
std::vector<cudd::ADD> toAdd;
STORM_LOG_ASSERT(fromAdd.size() == toAdd.size(), "Sizes of vectors do not match."); STORM_LOG_ASSERT(fromAdd.size() == toAdd.size(), "Sizes of vectors do not match.");
for (auto it1 = from.begin(), ite1 = from.end(), it2 = to.begin(); it1 != ite1; ++it1, ++it2) { for (auto it1 = from.begin(), ite1 = from.end(), it2 = to.begin(); it1 != ite1; ++it1, ++it2) {
fromAdd.push_back(it1->getCuddAdd()); fromAdd.push_back(it1->getCuddAdd());
@ -196,7 +196,7 @@ namespace storm {
template<typename ValueType> template<typename ValueType>
InternalAdd<DdType::CUDD, ValueType> InternalAdd<DdType::CUDD, ValueType>::multiplyMatrix(InternalAdd<DdType::CUDD, ValueType> const& otherMatrix, std::vector<InternalAdd<DdType::CUDD, ValueType>> const& summationDdVariables) const { InternalAdd<DdType::CUDD, ValueType> InternalAdd<DdType::CUDD, ValueType>::multiplyMatrix(InternalAdd<DdType::CUDD, ValueType> const& otherMatrix, std::vector<InternalAdd<DdType::CUDD, ValueType>> const& summationDdVariables) const {
// Create the CUDD summation variables. // Create the CUDD summation variables.
std::vector<ADD> summationAdds;
std::vector<cudd::ADD> summationAdds;
for (auto const& ddVariable : summationDdVariables) { for (auto const& ddVariable : summationDdVariables) {
summationAdds.push_back(ddVariable.getCuddAdd()); summationAdds.push_back(ddVariable.getCuddAdd());
} }
@ -261,13 +261,13 @@ namespace storm {
template<typename ValueType> template<typename ValueType>
ValueType InternalAdd<DdType::CUDD, ValueType>::getMin() const { ValueType InternalAdd<DdType::CUDD, ValueType>::getMin() const {
ADD constantMinAdd = this->getCuddAdd().FindMin();
cudd::ADD constantMinAdd = this->getCuddAdd().FindMin();
return static_cast<double>(Cudd_V(constantMinAdd.getNode())); return static_cast<double>(Cudd_V(constantMinAdd.getNode()));
} }
template<typename ValueType> template<typename ValueType>
ValueType InternalAdd<DdType::CUDD, ValueType>::getMax() const { ValueType InternalAdd<DdType::CUDD, ValueType>::getMax() const {
ADD constantMaxAdd = this->getCuddAdd().FindMax();
cudd::ADD constantMaxAdd = this->getCuddAdd().FindMax();
return static_cast<double>(Cudd_V(constantMaxAdd.getNode())); return static_cast<double>(Cudd_V(constantMaxAdd.getNode()));
} }
@ -313,7 +313,7 @@ namespace storm {
// Open the file, dump the DD and close it again. // Open the file, dump the DD and close it again.
FILE* filePointer = fopen(filename.c_str() , "w"); FILE* filePointer = fopen(filename.c_str() , "w");
std::vector<ADD> cuddAddVector = { this->getCuddAdd() };
std::vector<cudd::ADD> cuddAddVector = { this->getCuddAdd() };
ddManager->getCuddManager().DumpDot(cuddAddVector, &ddVariableNames[0], &ddNames[0], filePointer); ddManager->getCuddManager().DumpDot(cuddAddVector, &ddVariableNames[0], &ddNames[0], filePointer);
fclose(filePointer); fclose(filePointer);
@ -340,7 +340,7 @@ namespace storm {
} }
template<typename ValueType> template<typename ValueType>
ADD InternalAdd<DdType::CUDD, ValueType>::getCuddAdd() const {
cudd::ADD InternalAdd<DdType::CUDD, ValueType>::getCuddAdd() const {
return this->cuddAdd; return this->cuddAdd;
} }
@ -362,7 +362,7 @@ namespace storm {
} }
template<typename ValueType> template<typename ValueType>
std::shared_ptr<Odd> InternalAdd<DdType::CUDD, ValueType>::createOddRec(DdNode* dd, Cudd const& manager, uint_fast64_t currentLevel, uint_fast64_t maxLevel, std::vector<uint_fast64_t> const& ddVariableIndices, std::vector<std::unordered_map<DdNode*, std::shared_ptr<Odd>>>& uniqueTableForLevels) {
std::shared_ptr<Odd> InternalAdd<DdType::CUDD, ValueType>::createOddRec(DdNode* dd, cudd::Cudd const& manager, uint_fast64_t currentLevel, uint_fast64_t maxLevel, std::vector<uint_fast64_t> const& ddVariableIndices, std::vector<std::unordered_map<DdNode*, std::shared_ptr<Odd>>>& uniqueTableForLevels) {
// Check whether the ODD for this node has already been computed (for this level) and if so, return this instead. // Check whether the ODD for this node has already been computed (for this level) and if so, return this instead.
auto const& iterator = uniqueTableForLevels[currentLevel].find(dd); auto const& iterator = uniqueTableForLevels[currentLevel].find(dd);
if (iterator != uniqueTableForLevels[currentLevel].end()) { if (iterator != uniqueTableForLevels[currentLevel].end()) {
@ -449,7 +449,7 @@ namespace storm {
} }
if (currentLevel == maxLevel) { if (currentLevel == maxLevel) {
groups.push_back(InternalAdd<DdType::CUDD, ValueType>(ddManager, ADD(ddManager->getCuddManager(), dd)));
groups.push_back(InternalAdd<DdType::CUDD, ValueType>(ddManager, cudd::ADD(ddManager->getCuddManager(), dd)));
} else if (ddGroupVariableIndices[currentLevel] < dd->index) { } else if (ddGroupVariableIndices[currentLevel] < dd->index) {
splitIntoGroupsRec(dd, groups, ddGroupVariableIndices, currentLevel + 1, maxLevel); splitIntoGroupsRec(dd, groups, ddGroupVariableIndices, currentLevel + 1, maxLevel);
splitIntoGroupsRec(dd, groups, ddGroupVariableIndices, currentLevel + 1, maxLevel); splitIntoGroupsRec(dd, groups, ddGroupVariableIndices, currentLevel + 1, maxLevel);
@ -474,7 +474,7 @@ namespace storm {
} }
if (currentLevel == maxLevel) { if (currentLevel == maxLevel) {
groups.push_back(std::make_pair(InternalAdd<DdType::CUDD, ValueType>(ddManager, ADD(ddManager->getCuddManager(), dd1)), InternalAdd<DdType::CUDD, ValueType>(ddManager, ADD(ddManager->getCuddManager(), dd2))));
groups.push_back(std::make_pair(InternalAdd<DdType::CUDD, ValueType>(ddManager, cudd::ADD(ddManager->getCuddManager(), dd1)), InternalAdd<DdType::CUDD, ValueType>(ddManager, cudd::ADD(ddManager->getCuddManager(), dd2))));
} else if (ddGroupVariableIndices[currentLevel] < dd1->index) { } else if (ddGroupVariableIndices[currentLevel] < dd1->index) {
if (ddGroupVariableIndices[currentLevel] < dd2->index) { if (ddGroupVariableIndices[currentLevel] < dd2->index) {
splitIntoGroupsRec(dd1, dd2, groups, ddGroupVariableIndices, currentLevel + 1, maxLevel); splitIntoGroupsRec(dd1, dd2, groups, ddGroupVariableIndices, currentLevel + 1, maxLevel);
@ -553,7 +553,7 @@ namespace storm {
template<typename ValueType> template<typename ValueType>
InternalAdd<DdType::CUDD, ValueType> InternalAdd<DdType::CUDD, ValueType>::fromVector(InternalDdManager<DdType::CUDD> const* ddManager, std::vector<ValueType> const& values, storm::dd::Odd const& odd, std::vector<uint_fast64_t> const& ddVariableIndices) { InternalAdd<DdType::CUDD, ValueType> InternalAdd<DdType::CUDD, ValueType>::fromVector(InternalDdManager<DdType::CUDD> const* ddManager, std::vector<ValueType> const& values, storm::dd::Odd const& odd, std::vector<uint_fast64_t> const& ddVariableIndices) {
uint_fast64_t offset = 0; uint_fast64_t offset = 0;
return InternalAdd<DdType::CUDD, ValueType>(ddManager, ADD(ddManager->getCuddManager(), fromVectorRec(ddManager->getCuddManager().getManager(), offset, 0, ddVariableIndices.size(), values, odd, ddVariableIndices)));
return InternalAdd<DdType::CUDD, ValueType>(ddManager, cudd::ADD(ddManager->getCuddManager(), fromVectorRec(ddManager->getCuddManager().getManager(), offset, 0, ddVariableIndices.size(), values, odd, ddVariableIndices)));
} }
template<typename ValueType> template<typename ValueType>

8
src/storage/dd/cudd/InternalCuddAdd.h

@ -47,7 +47,7 @@ namespace storm {
* @param cuddAdd The CUDD ADD to store. * @param cuddAdd The CUDD ADD to store.
* @param containedMetaVariables The meta variables that appear in the DD. * @param containedMetaVariables The meta variables that appear in the DD.
*/ */
InternalAdd(InternalDdManager<DdType::CUDD> const* ddManager, ADD cuddAdd);
InternalAdd(InternalDdManager<DdType::CUDD> const* ddManager, cudd::ADD cuddAdd);
// Instantiate all copy/move constructors/assignments with the default implementation. // Instantiate all copy/move constructors/assignments with the default implementation.
InternalAdd() = default; InternalAdd() = default;
@ -586,7 +586,7 @@ namespace storm {
* *
* @return The CUDD ADD object associated with this ADD. * @return The CUDD ADD object associated with this ADD.
*/ */
ADD getCuddAdd() const;
cudd::ADD getCuddAdd() const;
/*! /*!
* Retrieves the raw DD node of CUDD associated with this ADD. * Retrieves the raw DD node of CUDD associated with this ADD.
@ -687,11 +687,11 @@ namespace storm {
* ODD nodes for the same DD and level unique. * ODD nodes for the same DD and level unique.
* @return A pointer to the constructed ODD for the given arguments. * @return A pointer to the constructed ODD for the given arguments.
*/ */
static std::shared_ptr<Odd> createOddRec(DdNode* dd, Cudd const& manager, uint_fast64_t currentLevel, uint_fast64_t maxLevel, std::vector<uint_fast64_t> const& ddVariableIndices, std::vector<std::unordered_map<DdNode*, std::shared_ptr<Odd>>>& uniqueTableForLevels);
static std::shared_ptr<Odd> createOddRec(DdNode* dd, cudd::Cudd const& manager, uint_fast64_t currentLevel, uint_fast64_t maxLevel, std::vector<uint_fast64_t> const& ddVariableIndices, std::vector<std::unordered_map<DdNode*, std::shared_ptr<Odd>>>& uniqueTableForLevels);
InternalDdManager<DdType::CUDD> const* ddManager; InternalDdManager<DdType::CUDD> const* ddManager;
ADD cuddAdd;
cudd::ADD cuddAdd;
}; };
} }
} }

22
src/storage/dd/cudd/InternalCuddBdd.cpp

@ -9,14 +9,14 @@
namespace storm { namespace storm {
namespace dd { namespace dd {
InternalBdd<DdType::CUDD>::InternalBdd(InternalDdManager<DdType::CUDD> const* ddManager, BDD cuddBdd) : ddManager(ddManager), cuddBdd(cuddBdd) {
InternalBdd<DdType::CUDD>::InternalBdd(InternalDdManager<DdType::CUDD> const* ddManager, cudd::BDD cuddBdd) : ddManager(ddManager), cuddBdd(cuddBdd) {
// Intentionally left empty. // Intentionally left empty.
} }
template<typename ValueType> template<typename ValueType>
InternalBdd<DdType::CUDD> InternalBdd<DdType::CUDD>::fromVector(InternalDdManager<DdType::CUDD> const* ddManager, std::vector<ValueType> const& values, Odd const& odd, std::vector<uint_fast64_t> const& sortedDdVariableIndices, std::function<bool (ValueType const&)> const& filter) { InternalBdd<DdType::CUDD> InternalBdd<DdType::CUDD>::fromVector(InternalDdManager<DdType::CUDD> const* ddManager, std::vector<ValueType> const& values, Odd const& odd, std::vector<uint_fast64_t> const& sortedDdVariableIndices, std::function<bool (ValueType const&)> const& filter) {
uint_fast64_t offset = 0; uint_fast64_t offset = 0;
return InternalBdd<DdType::CUDD>(ddManager, BDD(ddManager->getCuddManager(), fromVectorRec(ddManager->getCuddManager().getManager(), offset, 0, sortedDdVariableIndices.size(), values, odd, sortedDdVariableIndices, filter)));
return InternalBdd<DdType::CUDD>(ddManager, cudd::BDD(ddManager->getCuddManager(), fromVectorRec(ddManager->getCuddManager().getManager(), offset, 0, sortedDdVariableIndices.size(), values, odd, sortedDdVariableIndices, filter)));
} }
bool InternalBdd<DdType::CUDD>::operator==(InternalBdd<DdType::CUDD> const& other) const { bool InternalBdd<DdType::CUDD>::operator==(InternalBdd<DdType::CUDD> const& other) const {
@ -97,8 +97,8 @@ namespace storm {
} }
InternalBdd<DdType::CUDD> InternalBdd<DdType::CUDD>::swapVariables(std::vector<InternalBdd<DdType::CUDD>> const& from, std::vector<InternalBdd<DdType::CUDD>> const& to) const { InternalBdd<DdType::CUDD> InternalBdd<DdType::CUDD>::swapVariables(std::vector<InternalBdd<DdType::CUDD>> const& from, std::vector<InternalBdd<DdType::CUDD>> const& to) const {
std::vector<BDD> fromBdd;
std::vector<BDD> toBdd;
std::vector<cudd::BDD> fromBdd;
std::vector<cudd::BDD> toBdd;
for (auto it1 = from.begin(), ite1 = from.end(), it2 = to.begin(); it1 != ite1; ++it1, ++it2) { for (auto it1 = from.begin(), ite1 = from.end(), it2 = to.begin(); it1 != ite1; ++it1, ++it2) {
fromBdd.push_back(it1->getCuddBdd()); fromBdd.push_back(it1->getCuddBdd());
toBdd.push_back(it2->getCuddBdd()); toBdd.push_back(it2->getCuddBdd());
@ -150,7 +150,7 @@ namespace storm {
// Open the file, dump the DD and close it again. // Open the file, dump the DD and close it again.
FILE* filePointer = fopen(filename.c_str() , "w"); FILE* filePointer = fopen(filename.c_str() , "w");
std::vector<BDD> cuddBddVector = { this->getCuddBdd() };
std::vector<cudd::BDD> cuddBddVector = { this->getCuddBdd() };
ddManager->getCuddManager().DumpDot(cuddBddVector, &ddVariableNames[0], &ddNames[0], filePointer); ddManager->getCuddManager().DumpDot(cuddBddVector, &ddVariableNames[0], &ddNames[0], filePointer);
fclose(filePointer); fclose(filePointer);
@ -163,7 +163,7 @@ namespace storm {
} }
} }
BDD InternalBdd<DdType::CUDD>::getCuddBdd() const {
cudd::BDD InternalBdd<DdType::CUDD>::getCuddBdd() const {
return this->cuddBdd; return this->cuddBdd;
} }
@ -239,7 +239,7 @@ namespace storm {
return result; return result;
} }
void InternalBdd<DdType::CUDD>::toVectorRec(DdNode const* dd, Cudd const& manager, storm::storage::BitVector& result, Odd const& rowOdd, bool complement, uint_fast64_t currentRowLevel, uint_fast64_t maxLevel, uint_fast64_t currentRowOffset, std::vector<uint_fast64_t> const& ddRowVariableIndices) const {
void InternalBdd<DdType::CUDD>::toVectorRec(DdNode const* dd, cudd::Cudd const& manager, storm::storage::BitVector& result, Odd const& rowOdd, bool complement, uint_fast64_t currentRowLevel, uint_fast64_t maxLevel, uint_fast64_t currentRowOffset, std::vector<uint_fast64_t> const& ddRowVariableIndices) const {
// If there are no more values to select, we can directly return. // If there are no more values to select, we can directly return.
if (dd == Cudd_ReadLogicZero(manager.getManager()) && !complement) { if (dd == Cudd_ReadLogicZero(manager.getManager()) && !complement) {
return; return;
@ -285,7 +285,7 @@ namespace storm {
return result; return result;
} }
std::shared_ptr<Odd> InternalBdd<DdType::CUDD>::createOddRec(DdNode* dd, Cudd const& manager, uint_fast64_t currentLevel, bool complement, uint_fast64_t maxLevel, std::vector<uint_fast64_t> const& ddVariableIndices, std::vector<std::unordered_map<std::pair<DdNode*, bool>, std::shared_ptr<Odd>, HashFunctor>>& uniqueTableForLevels) {
std::shared_ptr<Odd> InternalBdd<DdType::CUDD>::createOddRec(DdNode* dd, cudd::Cudd const& manager, uint_fast64_t currentLevel, bool complement, uint_fast64_t maxLevel, std::vector<uint_fast64_t> const& ddVariableIndices, std::vector<std::unordered_map<std::pair<DdNode*, bool>, std::shared_ptr<Odd>, HashFunctor>>& uniqueTableForLevels) {
// Check whether the ODD for this node has already been computed (for this level) and if so, return this instead. // Check whether the ODD for this node has already been computed (for this level) and if so, return this instead.
auto const& iterator = uniqueTableForLevels[currentLevel].find(std::make_pair(dd, complement)); auto const& iterator = uniqueTableForLevels[currentLevel].find(std::make_pair(dd, complement));
if (iterator != uniqueTableForLevels[currentLevel].end()) { if (iterator != uniqueTableForLevels[currentLevel].end()) {
@ -341,7 +341,7 @@ namespace storm {
} }
template<typename ValueType> template<typename ValueType>
void InternalBdd<DdType::CUDD>::filterExplicitVectorRec(DdNode* dd, Cudd const& manager, uint_fast64_t currentLevel, bool complement, uint_fast64_t maxLevel, std::vector<uint_fast64_t> const& ddVariableIndices, uint_fast64_t currentOffset, storm::dd::Odd const& odd, std::vector<ValueType>& result, uint_fast64_t& currentIndex, std::vector<ValueType> const& values) {
void InternalBdd<DdType::CUDD>::filterExplicitVectorRec(DdNode* dd, cudd::Cudd const& manager, uint_fast64_t currentLevel, bool complement, uint_fast64_t maxLevel, std::vector<uint_fast64_t> const& ddVariableIndices, uint_fast64_t currentOffset, storm::dd::Odd const& odd, std::vector<ValueType>& result, uint_fast64_t& currentIndex, std::vector<ValueType> const& values) {
// If there are no more values to select, we can directly return. // If there are no more values to select, we can directly return.
if (dd == Cudd_ReadLogicZero(manager.getManager()) && !complement) { if (dd == Cudd_ReadLogicZero(manager.getManager()) && !complement) {
return; return;
@ -384,8 +384,8 @@ namespace storm {
template InternalAdd<DdType::CUDD, double> InternalBdd<DdType::CUDD>::toAdd() const; template InternalAdd<DdType::CUDD, double> InternalBdd<DdType::CUDD>::toAdd() const;
template InternalAdd<DdType::CUDD, uint_fast64_t> InternalBdd<DdType::CUDD>::toAdd() const; template InternalAdd<DdType::CUDD, uint_fast64_t> InternalBdd<DdType::CUDD>::toAdd() const;
template void InternalBdd<DdType::CUDD>::filterExplicitVectorRec<double>(DdNode* dd, Cudd const& manager, uint_fast64_t currentLevel, bool complement, uint_fast64_t maxLevel, std::vector<uint_fast64_t> const& ddVariableIndices, uint_fast64_t currentOffset, storm::dd::Odd const& odd, std::vector<double>& result, uint_fast64_t& currentIndex, std::vector<double> const& values);
template void InternalBdd<DdType::CUDD>::filterExplicitVectorRec<uint_fast64_t>(DdNode* dd, Cudd const& manager, uint_fast64_t currentLevel, bool complement, uint_fast64_t maxLevel, std::vector<uint_fast64_t> const& ddVariableIndices, uint_fast64_t currentOffset, storm::dd::Odd const& odd, std::vector<uint_fast64_t>& result, uint_fast64_t& currentIndex, std::vector<uint_fast64_t> const& values);
template void InternalBdd<DdType::CUDD>::filterExplicitVectorRec<double>(DdNode* dd, cudd::Cudd const& manager, uint_fast64_t currentLevel, bool complement, uint_fast64_t maxLevel, std::vector<uint_fast64_t> const& ddVariableIndices, uint_fast64_t currentOffset, storm::dd::Odd const& odd, std::vector<double>& result, uint_fast64_t& currentIndex, std::vector<double> const& values);
template void InternalBdd<DdType::CUDD>::filterExplicitVectorRec<uint_fast64_t>(DdNode* dd, cudd::Cudd const& manager, uint_fast64_t currentLevel, bool complement, uint_fast64_t maxLevel, std::vector<uint_fast64_t> const& ddVariableIndices, uint_fast64_t currentOffset, storm::dd::Odd const& odd, std::vector<uint_fast64_t>& result, uint_fast64_t& currentIndex, std::vector<uint_fast64_t> const& values);
template void InternalBdd<DdType::CUDD>::filterExplicitVector(Odd const& odd, std::vector<uint_fast64_t> const& ddVariableIndices, std::vector<double> const& sourceValues, std::vector<double>& targetValues) const; template void InternalBdd<DdType::CUDD>::filterExplicitVector(Odd const& odd, std::vector<uint_fast64_t> const& ddVariableIndices, std::vector<double> const& sourceValues, std::vector<double>& targetValues) const;
template void InternalBdd<DdType::CUDD>::filterExplicitVector(Odd const& odd, std::vector<uint_fast64_t> const& ddVariableIndices, std::vector<uint_fast64_t> const& sourceValues, std::vector<uint_fast64_t>& targetValues) const; template void InternalBdd<DdType::CUDD>::filterExplicitVector(Odd const& odd, std::vector<uint_fast64_t> const& ddVariableIndices, std::vector<uint_fast64_t> const& sourceValues, std::vector<uint_fast64_t>& targetValues) const;

12
src/storage/dd/cudd/InternalCuddBdd.h

@ -37,7 +37,7 @@ namespace storm {
* @param cuddBdd The CUDD BDD to store. * @param cuddBdd The CUDD BDD to store.
* @param containedMetaVariables The meta variables that appear in the DD. * @param containedMetaVariables The meta variables that appear in the DD.
*/ */
InternalBdd(InternalDdManager<DdType::CUDD> const* ddManager, BDD cuddBdd);
InternalBdd(InternalDdManager<DdType::CUDD> const* ddManager, cudd::BDD cuddBdd);
// Instantiate all copy/move constructors/assignments with the default implementation. // Instantiate all copy/move constructors/assignments with the default implementation.
InternalBdd() = default; InternalBdd() = default;
@ -310,7 +310,7 @@ namespace storm {
* *
* @return The CUDD BDD object associated with this DD. * @return The CUDD BDD object associated with this DD.
*/ */
BDD getCuddBdd() const;
cudd::BDD getCuddBdd() const;
/*! /*!
* Retrieves the raw DD node of CUDD associated with this BDD. * Retrieves the raw DD node of CUDD associated with this BDD.
@ -348,7 +348,7 @@ namespace storm {
* @param currentRowOffset The current row offset. * @param currentRowOffset The current row offset.
* @param ddRowVariableIndices The (sorted) indices of all DD row variables that need to be considered. * @param ddRowVariableIndices The (sorted) indices of all DD row variables that need to be considered.
*/ */
void toVectorRec(DdNode const* dd, Cudd const& manager, storm::storage::BitVector& result, Odd const& rowOdd, bool complement, uint_fast64_t currentRowLevel, uint_fast64_t maxLevel, uint_fast64_t currentRowOffset, std::vector<uint_fast64_t> const& ddRowVariableIndices) const;
void toVectorRec(DdNode const* dd, cudd::Cudd const& manager, storm::storage::BitVector& result, Odd const& rowOdd, bool complement, uint_fast64_t currentRowLevel, uint_fast64_t maxLevel, uint_fast64_t currentRowOffset, std::vector<uint_fast64_t> const& ddRowVariableIndices) const;
// Declare a hash functor that is used for the unique tables in the construction process of ODDs. // Declare a hash functor that is used for the unique tables in the construction process of ODDs.
class HashFunctor { class HashFunctor {
@ -369,7 +369,7 @@ namespace storm {
* ODD nodes for the same DD and level unique. * ODD nodes for the same DD and level unique.
* @return A pointer to the constructed ODD for the given arguments. * @return A pointer to the constructed ODD for the given arguments.
*/ */
static std::shared_ptr<Odd> createOddRec(DdNode* dd, Cudd const& manager, uint_fast64_t currentLevel, bool complement, uint_fast64_t maxLevel, std::vector<uint_fast64_t> const& ddVariableIndices, std::vector<std::unordered_map<std::pair<DdNode*, bool>, std::shared_ptr<Odd>, HashFunctor>>& uniqueTableForLevels);
static std::shared_ptr<Odd> createOddRec(DdNode* dd, cudd::Cudd const& manager, uint_fast64_t currentLevel, bool complement, uint_fast64_t maxLevel, std::vector<uint_fast64_t> const& ddVariableIndices, std::vector<std::unordered_map<std::pair<DdNode*, bool>, std::shared_ptr<Odd>, HashFunctor>>& uniqueTableForLevels);
/*! /*!
* Adds the selected values the target vector. * Adds the selected values the target vector.
@ -386,11 +386,11 @@ namespace storm {
* @param values The value vector from which to select the values. * @param values The value vector from which to select the values.
*/ */
template<typename ValueType> template<typename ValueType>
static void filterExplicitVectorRec(DdNode* dd, Cudd const& manager, uint_fast64_t currentLevel, bool complement, uint_fast64_t maxLevel, std::vector<uint_fast64_t> const& ddVariableIndices, uint_fast64_t currentOffset, storm::dd::Odd const& odd, std::vector<ValueType>& result, uint_fast64_t& currentIndex, std::vector<ValueType> const& values);
static void filterExplicitVectorRec(DdNode* dd, cudd::Cudd const& manager, uint_fast64_t currentLevel, bool complement, uint_fast64_t maxLevel, std::vector<uint_fast64_t> const& ddVariableIndices, uint_fast64_t currentOffset, storm::dd::Odd const& odd, std::vector<ValueType>& result, uint_fast64_t& currentIndex, std::vector<ValueType> const& values);
InternalDdManager<DdType::CUDD> const* ddManager; InternalDdManager<DdType::CUDD> const* ddManager;
BDD cuddBdd;
cudd::BDD cuddBdd;
}; };
} }
} }

4
src/storage/dd/cudd/InternalCuddDdManager.cpp

@ -85,11 +85,11 @@ namespace storm {
this->getCuddManager().ReduceHeap(this->reorderingTechnique, 0); this->getCuddManager().ReduceHeap(this->reorderingTechnique, 0);
} }
Cudd& InternalDdManager<DdType::CUDD>::getCuddManager() {
cudd::Cudd& InternalDdManager<DdType::CUDD>::getCuddManager() {
return cuddManager; return cuddManager;
} }
Cudd const& InternalDdManager<DdType::CUDD>::getCuddManager() const {
cudd::Cudd const& InternalDdManager<DdType::CUDD>::getCuddManager() const {
return cuddManager; return cuddManager;
} }

6
src/storage/dd/cudd/InternalCuddDdManager.h

@ -100,17 +100,17 @@ namespace storm {
* *
* @return The underlying CUDD manager. * @return The underlying CUDD manager.
*/ */
Cudd& getCuddManager();
cudd::Cudd& getCuddManager();
/*! /*!
* Retrieves the underlying CUDD manager. * Retrieves the underlying CUDD manager.
* *
* @return The underlying CUDD manager. * @return The underlying CUDD manager.
*/ */
Cudd const& getCuddManager() const;
cudd::Cudd const& getCuddManager() const;
// The manager responsible for the DDs created/modified with this DdManager. // The manager responsible for the DDs created/modified with this DdManager.
Cudd cuddManager;
cudd::Cudd cuddManager;
// The technique that is used for dynamic reordering. // The technique that is used for dynamic reordering.
Cudd_ReorderingType reorderingTechnique; Cudd_ReorderingType reorderingTechnique;

1
src/storage/dd/sylvan/InternalSylvanBdd.cpp

@ -2,7 +2,6 @@
#include "src/storage/dd/sylvan/InternalSylvanAdd.h" #include "src/storage/dd/sylvan/InternalSylvanAdd.h"
#include "src/storage/dd/sylvan/SylvanAddIterator.h" #include "src/storage/dd/sylvan/SylvanAddIterator.h"
#
#include "src/storage/BitVector.h" #include "src/storage/BitVector.h"

5
src/storage/dd/sylvan/InternalSylvanBdd.h

@ -8,6 +8,8 @@
#include "src/storage/dd/InternalBdd.h" #include "src/storage/dd/InternalBdd.h"
#include "src/storage/dd/InternalAdd.h" #include "src/storage/dd/InternalAdd.h"
#include "sylvan_obj.hpp"
namespace storm { namespace storm {
namespace storage { namespace storage {
class BitVector; class BitVector;
@ -17,9 +19,6 @@ namespace storm {
template<DdType LibraryType> template<DdType LibraryType>
class InternalDdManager; class InternalDdManager;
template<DdType LibraryType, typename ValueType>
class InternalAdd;
class Odd; class Odd;
template<> template<>

Loading…
Cancel
Save