16template<storm::dd::DdType DdType>
31template<storm::dd::DdType DdType>
36template<storm::dd::DdType DdType>
42template<storm::dd::DdType DdType>
47template<storm::dd::DdType DdType>
50 for (uint64_t index = 0; index <
predicates.size(); ++index) {
58 std::size_t predicateIndex =
predicates.size();
65 std::stringstream stream;
67 std::pair<storm::expressions::Variable, storm::expressions::Variable> newMetaVariable =
ddManager->addMetaVariable(stream.str());
83 return predicateIndex;
86template<storm::dd::DdType DdType>
88 std::vector<uint_fast64_t> predicateIndices;
92 return predicateIndices;
95template<storm::dd::DdType DdType>
100template<storm::dd::DdType DdType>
105template<storm::dd::DdType DdType>
110template<storm::dd::DdType DdType>
115template<storm::dd::DdType DdType>
120template<storm::dd::DdType DdType>
125template<storm::dd::DdType DdType>
130template<storm::dd::DdType DdType>
135template<storm::dd::DdType DdType>
137 STORM_LOG_ASSERT(predicateValuation.
size() == this->getNumberOfPredicates(),
"Size of predicate valuation does not match number of predicates.");
139 std::vector<storm::expressions::Expression> result;
141 if (predicateValuation[index]) {
151template<storm::dd::DdType DdType>
155 STORM_LOG_ASSERT(predicateValuation.
size() == this->getNumberOfPredicates() + offset,
"Size of predicate valuation does not match number of predicates.");
157 std::vector<storm::expressions::Expression> result;
159 if (predicateValuation[index + offset]) {
169template<storm::dd::DdType DdType>
174template<storm::dd::DdType DdType>
181template<storm::dd::DdType DdType>
186template<storm::dd::DdType DdType>
191template<storm::dd::DdType DdType>
196template<storm::dd::DdType DdType>
199 "Variables have already been created.");
201 for (uint64_t index = 0; index < player1VariableCount; ++index) {
206 STORM_LOG_DEBUG(
"Created " << player1VariableCount <<
" player 1 variables.");
208 for (uint64_t index = 0; index < player2VariableCount; ++index) {
213 STORM_LOG_DEBUG(
"Created " << player2VariableCount <<
" player 2 variables.");
215 for (uint64_t index = 0; index < auxVariableCount; ++index) {
220 STORM_LOG_DEBUG(
"Created " << auxVariableCount <<
" auxiliary variables.");
227template<storm::dd::DdType DdType>
232template<storm::dd::DdType DdType>
237template<storm::dd::DdType DdType>
242template<storm::dd::DdType DdType>
247template<storm::dd::DdType DdType>
252template<storm::dd::DdType DdType>
257template<storm::dd::DdType DdType>
262template<storm::dd::DdType DdType>
267template<storm::dd::DdType DdType>
272template<storm::dd::DdType DdType>
277template<storm::dd::DdType DdType>
282template<storm::dd::DdType DdType>
287template<storm::dd::DdType DdType>
292template<storm::dd::DdType DdType>
297template<storm::dd::DdType DdType>
302template<storm::dd::DdType DdType>
307template<storm::dd::DdType DdType>
312template<storm::dd::DdType DdType>
317template<storm::dd::DdType DdType>
322template<storm::dd::DdType DdType>
326template<storm::dd::DdType DdType>
331template<storm::dd::DdType DdType>
336template<storm::dd::DdType DdType>
341template<storm::dd::DdType DdType>
346template<storm::dd::DdType DdType>
351template<storm::dd::DdType DdType>
357template<storm::dd::DdType DdType>
358std::vector<std::pair<storm::expressions::Variable, storm::expressions::Variable>>
const&
363template<storm::dd::DdType DdType>
372template<storm::dd::DdType DdType>
389template<storm::dd::DdType DdType>
394template<storm::dd::DdType DdType>
399template<storm::dd::DdType DdType>
404template<storm::dd::DdType DdType>
411template<storm::dd::DdType DdType>
413 std::vector<std::pair<storm::expressions::Variable, uint_fast64_t>>
const& oldPredicates, std::set<uint_fast64_t>
const& newPredicates)
const {
414 std::vector<std::pair<storm::expressions::Variable, uint_fast64_t>> result;
416 auto oldIt = oldPredicates.begin();
417 auto oldIte = oldPredicates.end();
418 auto newIt = newPredicates.begin();
419 auto newIte = newPredicates.end();
421 for (; newIt != newIte; ++newIt) {
422 if (oldIt == oldIte || oldIt->second != *newIt) {
423 result.push_back(std::make_pair(
expressionManager.get().declareFreshBooleanVariable(), *newIt));
432template<storm::dd::DdType DdType>
436 for (uint_fast64_t bitIndex = end; bitIndex > start; --bitIndex) {
437 if ((index & 1) != 0) {
438 result &= variables[bitIndex - 1];
440 result &= !variables[bitIndex - 1];
448template<storm::dd::DdType DdType>
450 std::vector<storm::expressions::Variable>
const& variables)
const {
451 uint_fast64_t result = 0;
452 for (uint_fast64_t variableIndex = start; variableIndex < end; ++variableIndex) {
461template<storm::dd::DdType DdType>
468 auto it = add.
begin();
469 auto stateValuePair = *it;
472 if (stateValuePair.first.getBooleanValue(successorVariable)) {
473 statePredicates.
set(index);
477 return statePredicates;
480template<storm::dd::DdType DdType>
481template<
typename ValueType>
484 std::map<uint_fast64_t, std::pair<storm::storage::BitVector, ValueType>> result;
487 for (
auto const& successorValuePair : lowerChoiceAsAdd) {
488 uint_fast64_t updateIndex = this->
decodeAux(successorValuePair.first, 0, this->getAuxVariableCount());
493 if (successorValuePair.first.getBooleanValue(successorVariable)) {
494 successor.
set(index);
498 result[updateIndex] = std::make_pair(successor, successorValuePair.second);
503template<storm::dd::DdType DdType>
504template<
typename ValueType>
509 std::vector<std::map<uint_fast64_t, std::pair<storm::storage::BitVector, ValueType>>> result;
510 for (
auto const& choice : splitChoices) {
517template<storm::dd::DdType DdType>
525 auto it = add.
begin();
526 auto stateValuePair = *it;
527 uint64_t choiceIndex = this->
decodePlayer1Choice(stateValuePair.first, this->getPlayer1VariableCount());
528 uint64_t updateIndex = this->
decodeAux(stateValuePair.first, 0, this->getAuxVariableCount());
532 if (stateValuePair.first.getBooleanValue(successorVariable)) {
533 statePredicates.
set(index);
537 return std::make_tuple(statePredicates, choiceIndex, updateIndex);
540template<storm::dd::DdType DdType>
557template<storm::dd::DdType DdType>
566template<storm::dd::DdType DdType>
571template<storm::dd::DdType DdType>
576template<storm::dd::DdType DdType>
581 return metaVariablePair.first;
583 return metaVariablePair.second;
587template<storm::dd::DdType DdType>
591 result +=
ddManager->getMetaVariable(locationVariableToMetaVariablePair.second.first).getNumberOfDdVariables();
596template<storm::dd::DdType DdType>
601template<storm::dd::DdType DdType>
603 return this->
getDdManager().getEncoding(locationVariable, locationIndex);
609template std::map<uint_fast64_t, std::pair<storm::storage::BitVector, double>>
611template std::map<uint_fast64_t, std::pair<storm::storage::BitVector, double>>
613template std::map<uint_fast64_t, std::pair<storm::storage::BitVector, storm::RationalNumber>>
616template std::vector<std::map<uint_fast64_t, std::pair<storm::storage::BitVector, double>>>
619template std::vector<std::map<uint_fast64_t, std::pair<storm::storage::BitVector, double>>>
622template 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)