|
|
@ -143,10 +143,10 @@ namespace storm { |
|
|
|
} |
|
|
|
|
|
|
|
template<DdType LibraryType> |
|
|
|
Bdd<LibraryType> Bdd<LibraryType>::relationalProduct(Bdd<LibraryType> const& relation, std::set<storm::expressions::Variable> const& rowMetaVariables) const { |
|
|
|
Bdd<LibraryType> Bdd<LibraryType>::relationalProduct(Bdd<LibraryType> const& relation, std::set<storm::expressions::Variable> const& rowMetaVariables, std::set<storm::expressions::Variable> const& columnMetaVariables) const { |
|
|
|
std::set<storm::expressions::Variable> tmpMetaVariables = Dd<LibraryType>::joinMetaVariables(*this, relation); |
|
|
|
std::set<storm::expressions::Variable> newMetaVariables; |
|
|
|
std::set_difference(tmpMetaVariables.begin(), tmpMetaVariables.end(), rowMetaVariables.begin(), rowMetaVariables.end(), std::inserter(newMetaVariables, newMetaVariables.begin())); |
|
|
|
std::set_difference(tmpMetaVariables.begin(), tmpMetaVariables.end(), columnMetaVariables.begin(), columnMetaVariables.end(), std::inserter(newMetaVariables, newMetaVariables.begin())); |
|
|
|
|
|
|
|
std::vector<InternalBdd<LibraryType>> rowVariables; |
|
|
|
for (auto const& metaVariable : rowMetaVariables) { |
|
|
@ -159,6 +159,23 @@ namespace storm { |
|
|
|
return Bdd<LibraryType>(this->getDdManager(), internalBdd.relationalProduct(relation, rowVariables), newMetaVariables); |
|
|
|
} |
|
|
|
|
|
|
|
template<DdType LibraryType> |
|
|
|
Bdd<LibraryType> Bdd<LibraryType>::inverseRelationalProduct(Bdd<LibraryType> const& relation, std::set<storm::expressions::Variable> const& rowMetaVariables, std::set<storm::expressions::Variable> const& columnMetaVariables) const { |
|
|
|
std::set<storm::expressions::Variable> tmpMetaVariables = Dd<LibraryType>::joinMetaVariables(*this, relation); |
|
|
|
std::set<storm::expressions::Variable> newMetaVariables; |
|
|
|
std::set_difference(tmpMetaVariables.begin(), tmpMetaVariables.end(), rowMetaVariables.begin(), rowMetaVariables.end(), std::inserter(newMetaVariables, newMetaVariables.begin())); |
|
|
|
|
|
|
|
std::vector<InternalBdd<LibraryType>> columnVariables; |
|
|
|
for (auto const& metaVariable : columnMetaVariables) { |
|
|
|
DdMetaVariable<LibraryType> const& variable = this->getDdManager()->getMetaVariable(metaVariable); |
|
|
|
for (auto const& ddVariable : variable.getDdVariables()) { |
|
|
|
columnVariables.push_back(ddVariable); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return Bdd<LibraryType>(this->getDdManager(), internalBdd.inverseRelationalProduct(relation, columnVariables), newMetaVariables); |
|
|
|
} |
|
|
|
|
|
|
|
template<DdType LibraryType> |
|
|
|
Bdd<LibraryType> Bdd<LibraryType>::swapVariables(std::vector<std::pair<storm::expressions::Variable, storm::expressions::Variable>> const& metaVariablePairs) const { |
|
|
|
std::set<storm::expressions::Variable> newContainedMetaVariables; |
|
|
|