#ifndef STORM_MODELS_SYMBOLIC_NONDETERMINISTICMODEL_H_ #define STORM_MODELS_SYMBOLIC_NONDETERMINISTICMODEL_H_ #include "storm/models/symbolic/Model.h" #include "storm/utility/OsDetection.h" namespace storm { namespace models { namespace symbolic { /*! * Base class for all nondeterministic symbolic models. */ template class NondeterministicModel : public Model { public: typedef typename Model::RewardModelType RewardModelType; NondeterministicModel(NondeterministicModel const& other) = default; NondeterministicModel& operator=(NondeterministicModel const& other) = default; #ifndef WINDOWS NondeterministicModel(NondeterministicModel&& other) = default; NondeterministicModel& operator=(NondeterministicModel&& other) = default; #endif /*! * Constructs a model from the given data. * * @param modelType The type of the model. * @param manager The manager responsible for the decision diagrams. * @param reachableStates A DD representing the reachable states. * @param initialStates A DD representing the initial states of the model. * @param deadlockStates A DD representing the deadlock states of the model. * @param transitionMatrix The matrix representing the transitions in the model. * @param rowVariables The set of row meta variables used in the DDs. * @param rowExpressionAdapter An object that can be used to translate expressions in terms of the row * meta variables. * @param columVariables The set of column meta variables used in the DDs. * @param rowColumnMetaVariablePairs All pairs of row/column meta variables. * @param nondeterminismVariables The meta variables used to encode the nondeterminism in the model. * @param labelToExpressionMap A mapping from label names to their defining expressions. * @param rewardModels The reward models associated with the model. */ NondeterministicModel(storm::models::ModelType const& modelType, std::shared_ptr> manager, storm::dd::Bdd reachableStates, storm::dd::Bdd initialStates, storm::dd::Bdd deadlockStates, storm::dd::Add transitionMatrix, std::set const& rowVariables, std::shared_ptr> rowExpressionAdapter, std::set const& columnVariables, std::vector> const& rowColumnMetaVariablePairs, std::set const& nondeterminismVariables, std::map labelToExpressionMap = std::map(), std::unordered_map const& rewardModels = std::unordered_map()); /*! * Constructs a model from the given data. * * @param modelType The type of the model. * @param manager The manager responsible for the decision diagrams. * @param reachableStates A DD representing the reachable states. * @param initialStates A DD representing the initial states of the model. * @param deadlockStates A DD representing the deadlock states of the model. * @param transitionMatrix The matrix representing the transitions in the model. * @param rowVariables The set of row meta variables used in the DDs. * @param columVariables The set of column meta variables used in the DDs. * @param rowColumnMetaVariablePairs All pairs of row/column meta variables. * @param nondeterminismVariables The meta variables used to encode the nondeterminism in the model. * @param labelToBddMap A mapping from label names to their defining BDDs. * @param rewardModels The reward models associated with the model. */ NondeterministicModel(storm::models::ModelType const& modelType, std::shared_ptr> manager, storm::dd::Bdd reachableStates, storm::dd::Bdd initialStates, storm::dd::Bdd deadlockStates, storm::dd::Add transitionMatrix, std::set const& rowVariables, std::set const& columnVariables, std::vector> const& rowColumnMetaVariablePairs, std::set const& nondeterminismVariables, std::map> labelToBddMap = std::map>(), std::unordered_map const& rewardModels = std::unordered_map()); /*! * Retrieves the number of nondeterministic choices in the model. * * @return The number of nondeterministic choices in the model. */ uint_fast64_t getNumberOfChoices() const; /*! * Retrieves the meta variables used to encode the nondeterminism in the model. * * @return The meta variables used to encode the nondeterminism in the model. */ virtual std::set const& getNondeterminismVariables() const override; /*! * Retrieves a BDD characterizing all illegal nondeterminism encodings in the model. * * @return A BDD characterizing all illegal nondeterminism encodings in the model. */ storm::dd::Bdd const& getIllegalMask() const; /*! * Retrieves a BDD characterizing the illegal successors for each choice. * * @return A BDD characterizing the illegal successors for each choice. */ storm::dd::Bdd getIllegalSuccessorMask() const; /*! * Retrieves the matrix qualitatively (i.e. without probabilities) representing the transitions of the * model. * * @param keepNondeterminism If false, the matrix will abstract from the nondeterminism variables. * @return A matrix representing the qualitative transitions of the model. */ virtual storm::dd::Bdd getQualitativeTransitionMatrix(bool keepNondeterminism = true) const override; virtual void printModelInformationToStream(std::ostream& out) const override; virtual void reduceToStateBasedRewards() override; protected: virtual void printDdVariableInformationToStream(std::ostream& out) const override; // A mask that characterizes all illegal nondeterministic choices. storm::dd::Bdd illegalMask; private: void createIllegalMask(); // The meta variables encoding the nondeterminism in the model. std::set nondeterminismVariables; }; } // namespace symbolic } // namespace models } // namespace storm #endif /* STORM_MODELS_SYMBOLIC_NONDETERMINISTICMODEL_H_ */