9#include "storm-config.h"
16template<storm::dd::DdType Type,
typename ValueType>
21 std::set<storm::expressions::Variable>
const& columnVariables,
22 std::vector<std::pair<storm::expressions::Variable, storm::expressions::Variable>>
const& rowColumnMetaVariablePairs,
23 std::set<storm::expressions::Variable>
const& nondeterminismVariables, std::map<std::string, storm::expressions::Expression> labelToExpressionMap,
24 std::unordered_map<std::string, RewardModelType>
const& rewardModels)
25 :
Model<Type,
ValueType>(modelType, manager, reachableStates, initialStates, deadlockStates, transitionMatrix, rowVariables, rowExpressionAdapter,
26 columnVariables, rowColumnMetaVariablePairs, labelToExpressionMap, rewardModels),
27 nondeterminismVariables(nondeterminismVariables) {
31template<storm::dd::DdType Type,
typename ValueType>
35 std::set<storm::expressions::Variable>
const& rowVariables, std::set<storm::expressions::Variable>
const& columnVariables,
36 std::vector<std::pair<storm::expressions::Variable, storm::expressions::Variable>>
const& rowColumnMetaVariablePairs,
37 std::set<storm::expressions::Variable>
const& nondeterminismVariables, std::map<std::string,
storm::dd::Bdd<Type>> labelToBddMap,
38 std::unordered_map<std::string, RewardModelType>
const& rewardModels)
39 :
Model<Type,
ValueType>(modelType, manager, reachableStates, initialStates, deadlockStates, transitionMatrix, rowVariables, columnVariables,
40 rowColumnMetaVariablePairs, labelToBddMap, rewardModels),
41 nondeterminismVariables(nondeterminismVariables) {
45template<storm::dd::DdType Type,
typename ValueType>
47 std::set<storm::expressions::Variable> rowAndNondeterminismVariables;
48 std::set_union(this->getNondeterminismVariables().begin(), this->getNondeterminismVariables().end(), this->getRowVariables().begin(),
49 this->getRowVariables().end(), std::inserter(rowAndNondeterminismVariables, rowAndNondeterminismVariables.begin()));
53 .existsAbstract(this->getColumnVariables())
54 .template toAdd<uint_fast64_t>()
55 .sumAbstract(rowAndNondeterminismVariables);
59template<storm::dd::DdType Type,
typename ValueType>
61 return nondeterminismVariables;
64template<storm::dd::DdType Type,
typename ValueType>
69template<storm::dd::DdType Type,
typename ValueType>
72 return !transitionMatrixBdd && transitionMatrixBdd.
existsAbstract(this->getColumnVariables());
75template<storm::dd::DdType Type,
typename ValueType>
77 this->printModelInformationHeaderToStream(out);
78 out <<
"Choices: \t" << this->getNumberOfChoices() <<
'\n';
79 this->printModelInformationFooterToStream(out);
82template<storm::dd::DdType Type,
typename ValueType>
84 uint_fast64_t nondeterminismVariableCount = 0;
85 for (
auto const& metaVariable : this->getNondeterminismVariables()) {
86 nondeterminismVariableCount += this->getManager().getMetaVariable(metaVariable).getNumberOfDdVariables();
89 out <<
", nondeterminism: " << this->getNondeterminismVariables().size() <<
" meta variables (" << nondeterminismVariableCount <<
" DD variables)";
92template<storm::dd::DdType Type,
typename ValueType>
94 for (
auto& rewardModel : this->getRewardModels()) {
95 rewardModel.second.reduceToStateBasedRewards(this->getTransitionMatrix(), this->getRowVariables(), this->getColumnVariables(),
false);
99template<storm::dd::DdType Type,
typename ValueType>
102 illegalMask = !(this->getTransitionMatrix().notZero().existsAbstract(this->getColumnVariables())) && this->getReachableStates();
105template<storm::dd::DdType Type,
typename ValueType>
107 if (!keepNondeterminism) {
108 return this->getTransitionMatrix().notZero().
existsAbstract(this->getNondeterminismVariables());
118#ifdef STORM_HAVE_CARL
ValueType getValue(std::map< storm::expressions::Variable, int_fast64_t > const &metaVariableToValueMap=std::map< storm::expressions::Variable, int_fast64_t >()) const
Retrieves the value of the function when all meta variables are assigned the values of the given mapp...
Bdd< LibraryType > notZero() const
Computes a BDD that represents the function in which all assignments with a function value unequal to...
Bdd< LibraryType > existsAbstract(std::set< storm::expressions::Variable > const &metaVariables) const
Existentially abstracts from the given meta variables.
Base class for all symbolic models.
virtual void printDdVariableInformationToStream(std::ostream &out) const
Prints information about the DD variables to the specified stream.
virtual storm::dd::Bdd< Type > getQualitativeTransitionMatrix(bool keepNondeterminism=true) const
Retrieves the matrix qualitatively (i.e.
Base class for all nondeterministic symbolic models.
virtual uint_fast64_t getNumberOfChoices() const override
Retrieves the number of nondeterministic choices in the model.
virtual std::set< storm::expressions::Variable > const & getNondeterminismVariables() const override
Retrieves the meta variables used to encode the nondeterminism in the model.
virtual void printModelInformationToStream(std::ostream &out) const override
Prints information about the model to the specified stream.
storm::dd::Bdd< Type > const & getIllegalMask() const
Retrieves a BDD characterizing all illegal nondeterminism encodings in the model.
storm::dd::Bdd< Type > getIllegalSuccessorMask() const
Retrieves a BDD characterizing the illegal successors for each choice.
virtual void reduceToStateBasedRewards() override
Converts the transition rewards of all reward models to state-based rewards.
virtual void printDdVariableInformationToStream(std::ostream &out) const override
Prints information about the DD variables to the specified stream.
NondeterministicModel(NondeterministicModel< Type, ValueType > const &other)=default
virtual storm::dd::Bdd< Type > getQualitativeTransitionMatrix(bool keepNondeterminism=true) const override
Retrieves the matrix qualitatively (i.e.