16template<storm::dd::DdType DdType>
32template<storm::dd::DdType DdType>
37template<storm::dd::DdType DdType>
43template<storm::dd::DdType DdType>
48template<storm::dd::DdType DdType>
51 for (uint64_t index = 0; index <
predicates.size(); ++index) {
59 std::size_t predicateIndex =
predicates.size();
66 std::stringstream stream;
68 std::pair<storm::expressions::Variable, storm::expressions::Variable> newMetaVariable =
ddManager->addMetaVariable(stream.str());
84 return predicateIndex;
87template<storm::dd::DdType DdType>
89 std::vector<uint_fast64_t> predicateIndices;
93 return predicateIndices;
96template<storm::dd::DdType DdType>
101template<storm::dd::DdType DdType>
106template<storm::dd::DdType DdType>
111template<storm::dd::DdType DdType>
116template<storm::dd::DdType DdType>
121template<storm::dd::DdType DdType>
126template<storm::dd::DdType DdType>
131template<storm::dd::DdType DdType>
136template<storm::dd::DdType DdType>
138 STORM_LOG_ASSERT(predicateValuation.
size() == this->getNumberOfPredicates(),
"Size of predicate valuation does not match number of predicates.");
140 std::vector<storm::expressions::Expression> result;
142 if (predicateValuation[index]) {
152template<storm::dd::DdType DdType>
156 STORM_LOG_ASSERT(predicateValuation.
size() == this->getNumberOfPredicates() + offset,
"Size of predicate valuation does not match number of predicates.");
158 std::vector<storm::expressions::Expression> result;
160 if (predicateValuation[index + offset]) {
170template<storm::dd::DdType DdType>
175template<storm::dd::DdType DdType>
182template<storm::dd::DdType DdType>
187template<storm::dd::DdType DdType>
192template<storm::dd::DdType DdType>
197template<storm::dd::DdType DdType>
200 "Variables have already been created.");
202 for (uint64_t index = 0; index < player1VariableCount; ++index) {
207 STORM_LOG_DEBUG(
"Created " << player1VariableCount <<
" player 1 variables.");
209 for (uint64_t index = 0; index < player2VariableCount; ++index) {
214 STORM_LOG_DEBUG(
"Created " << player2VariableCount <<
" player 2 variables.");
216 for (uint64_t index = 0; index < auxVariableCount; ++index) {
221 STORM_LOG_DEBUG(
"Created " << auxVariableCount <<
" auxiliary variables.");
228template<storm::dd::DdType DdType>
233template<storm::dd::DdType DdType>
238template<storm::dd::DdType DdType>
243template<storm::dd::DdType DdType>
248template<storm::dd::DdType DdType>
253template<storm::dd::DdType DdType>
258template<storm::dd::DdType DdType>
263template<storm::dd::DdType DdType>
268template<storm::dd::DdType DdType>
273template<storm::dd::DdType DdType>
278template<storm::dd::DdType DdType>
283template<storm::dd::DdType DdType>
288template<storm::dd::DdType DdType>
293template<storm::dd::DdType DdType>
298template<storm::dd::DdType DdType>
303template<storm::dd::DdType DdType>
308template<storm::dd::DdType DdType>
313template<storm::dd::DdType DdType>
318template<storm::dd::DdType DdType>
323template<storm::dd::DdType DdType>
327template<storm::dd::DdType DdType>
332template<storm::dd::DdType DdType>
337template<storm::dd::DdType DdType>
342template<storm::dd::DdType DdType>
347template<storm::dd::DdType DdType>
352template<storm::dd::DdType DdType>
358template<storm::dd::DdType DdType>
359std::vector<std::pair<storm::expressions::Variable, storm::expressions::Variable>>
const&
364template<storm::dd::DdType DdType>
373template<storm::dd::DdType DdType>
390template<storm::dd::DdType DdType>
395template<storm::dd::DdType DdType>
400template<storm::dd::DdType DdType>
405template<storm::dd::DdType DdType>
412template<storm::dd::DdType DdType>
414 std::vector<std::pair<storm::expressions::Variable, uint_fast64_t>>
const& oldPredicates, std::set<uint_fast64_t>
const& newPredicates)
const {
415 std::vector<std::pair<storm::expressions::Variable, uint_fast64_t>> result;
417 auto oldIt = oldPredicates.begin();
418 auto oldIte = oldPredicates.end();
419 auto newIt = newPredicates.begin();
420 auto newIte = newPredicates.end();
422 for (; newIt != newIte; ++newIt) {
423 if (oldIt == oldIte || oldIt->second != *newIt) {
424 result.push_back(std::make_pair(
expressionManager.get().declareFreshBooleanVariable(), *newIt));
433template<storm::dd::DdType DdType>
437 for (uint_fast64_t bitIndex = end; bitIndex > start; --bitIndex) {
438 if ((index & 1) != 0) {
439 result &= variables[bitIndex - 1];
441 result &= !variables[bitIndex - 1];
449template<storm::dd::DdType DdType>
451 std::vector<storm::expressions::Variable>
const& variables)
const {
452 uint_fast64_t result = 0;
453 for (uint_fast64_t variableIndex = start; variableIndex < end; ++variableIndex) {
462template<storm::dd::DdType DdType>
469 auto it = add.
begin();
470 auto stateValuePair = *it;
473 if (stateValuePair.first.getBooleanValue(successorVariable)) {
474 statePredicates.
set(index);
478 return statePredicates;
481template<storm::dd::DdType DdType>
482template<
typename ValueType>
485 std::map<uint_fast64_t, std::pair<storm::storage::BitVector, ValueType>> result;
488 for (
auto const& successorValuePair : lowerChoiceAsAdd) {
489 uint_fast64_t updateIndex = this->
decodeAux(successorValuePair.first, 0, this->getAuxVariableCount());
494 if (successorValuePair.first.getBooleanValue(successorVariable)) {
495 successor.
set(index);
499 result[updateIndex] = std::make_pair(successor, successorValuePair.second);
504template<storm::dd::DdType DdType>
505template<
typename ValueType>
510 std::vector<std::map<uint_fast64_t, std::pair<storm::storage::BitVector, ValueType>>> result;
511 for (
auto const& choice : splitChoices) {
518template<storm::dd::DdType DdType>
526 auto it = add.
begin();
527 auto stateValuePair = *it;
528 uint64_t choiceIndex = this->
decodePlayer1Choice(stateValuePair.first, this->getPlayer1VariableCount());
529 uint64_t updateIndex = this->
decodeAux(stateValuePair.first, 0, this->getAuxVariableCount());
533 if (stateValuePair.first.getBooleanValue(successorVariable)) {
534 statePredicates.
set(index);
538 return std::make_tuple(statePredicates, choiceIndex, updateIndex);
541template<storm::dd::DdType DdType>
558template<storm::dd::DdType DdType>
567template<storm::dd::DdType DdType>
572template<storm::dd::DdType DdType>
577template<storm::dd::DdType DdType>
582 return metaVariablePair.first;
584 return metaVariablePair.second;
588template<storm::dd::DdType DdType>
592 result +=
ddManager->getMetaVariable(locationVariableToMetaVariablePair.second.first).getNumberOfDdVariables();
597template<storm::dd::DdType DdType>
602template<storm::dd::DdType DdType>
604 return this->
getDdManager().getEncoding(locationVariable, locationIndex);
610template std::map<uint_fast64_t, std::pair<storm::storage::BitVector, double>>
612template std::map<uint_fast64_t, std::pair<storm::storage::BitVector, double>>
614template std::map<uint_fast64_t, std::pair<storm::storage::BitVector, storm::RationalNumber>>
617template std::vector<std::map<uint_fast64_t, std::pair<storm::storage::BitVector, double>>>
620template std::vector<std::map<uint_fast64_t, std::pair<storm::storage::BitVector, double>>>
623template std::vector<std::map<uint_fast64_t, std::pair<storm::storage::BitVector, storm::RationalNumber>>>
AddIterator< LibraryType, ValueType > begin(bool enumerateDontCareMetaVariables=true) const
Retrieves an iterator that points to the first meta variable assignment with a non-zero function valu...
bool isZero() const
Retrieves whether this DD represents the constant zero function.
virtual uint_fast64_t getNonZeroCount() const override
Retrieves the number of encodings that are mapped to a non-zero value.
std::vector< Bdd< LibraryType > > split(std::set< storm::expressions::Variable > const &variables) const
Splits the BDD along the given variables (must be at the top).
This class is responsible for managing a set of typed variables and all expressions using these varia...
The base class of all valuations of variables.
virtual bool getBooleanValue(Variable const &booleanVariable) const =0
Retrieves the value of the given boolean variable.
A bit vector that is internally represented as a vector of 64-bit values.
void set(uint64_t index, bool value=true)
Sets the given truth value at the given index.
size_t size() const
Retrieves the number of bits this bit vector can store.
#define STORM_LOG_DEBUG(message)
#define STORM_LOG_ASSERT(cond, message)
#define STORM_LOG_THROW(cond, exception, message)