Storm
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
storm::models::symbolic::NondeterministicModel< Type, ValueType > Class Template Reference

Base class for all nondeterministic symbolic models. More...

#include <NondeterministicModel.h>

Inheritance diagram for storm::models::symbolic::NondeterministicModel< Type, ValueType >:
Collaboration diagram for storm::models::symbolic::NondeterministicModel< Type, ValueType >:

Public Types

typedef Model< Type, ValueType >::RewardModelType RewardModelType
 
- Public Types inherited from storm::models::symbolic::Model< Type, CValueType >
typedef CValueType ValueType
 
typedef StandardRewardModel< Type, ValueTypeRewardModelType
 

Public Member Functions

 NondeterministicModel (NondeterministicModel< Type, ValueType > const &other)=default
 
NondeterministicModeloperator= (NondeterministicModel< Type, ValueType > const &other)=default
 
 NondeterministicModel (NondeterministicModel< Type, ValueType > &&other)=default
 
NondeterministicModeloperator= (NondeterministicModel< Type, ValueType > &&other)=default
 
 NondeterministicModel (storm::models::ModelType const &modelType, std::shared_ptr< storm::dd::DdManager< Type > > manager, storm::dd::Bdd< Type > reachableStates, storm::dd::Bdd< Type > initialStates, storm::dd::Bdd< Type > deadlockStates, storm::dd::Add< Type, ValueType > transitionMatrix, std::set< storm::expressions::Variable > const &rowVariables, std::shared_ptr< storm::adapters::AddExpressionAdapter< Type, ValueType > > rowExpressionAdapter, std::set< storm::expressions::Variable > const &columnVariables, std::vector< std::pair< storm::expressions::Variable, storm::expressions::Variable > > const &rowColumnMetaVariablePairs, std::set< storm::expressions::Variable > const &nondeterminismVariables, std::map< std::string, storm::expressions::Expression > labelToExpressionMap=std::map< std::string, storm::expressions::Expression >(), std::unordered_map< std::string, RewardModelType > const &rewardModels=std::unordered_map< std::string, RewardModelType >())
 Constructs a model from the given data.
 
 NondeterministicModel (storm::models::ModelType const &modelType, std::shared_ptr< storm::dd::DdManager< Type > > manager, storm::dd::Bdd< Type > reachableStates, storm::dd::Bdd< Type > initialStates, storm::dd::Bdd< Type > deadlockStates, storm::dd::Add< Type, ValueType > transitionMatrix, std::set< storm::expressions::Variable > const &rowVariables, std::set< storm::expressions::Variable > const &columnVariables, std::vector< std::pair< storm::expressions::Variable, storm::expressions::Variable > > const &rowColumnMetaVariablePairs, std::set< storm::expressions::Variable > const &nondeterminismVariables, std::map< std::string, storm::dd::Bdd< Type > > labelToBddMap=std::map< std::string, storm::dd::Bdd< Type > >(), std::unordered_map< std::string, RewardModelType > const &rewardModels=std::unordered_map< std::string, RewardModelType >())
 Constructs a model from the given data.
 
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.
 
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 storm::dd::Bdd< Type > getQualitativeTransitionMatrix (bool keepNondeterminism=true) const override
 Retrieves the matrix qualitatively (i.e.
 
virtual void printModelInformationToStream (std::ostream &out) const override
 Prints information about the model to the specified stream.
 
virtual void reduceToStateBasedRewards () override
 Converts the transition rewards of all reward models to state-based rewards.
 
- Public Member Functions inherited from storm::models::symbolic::Model< Type, CValueType >
 Model (Model< Type, ValueType > const &other)=default
 
Modeloperator= (Model< Type, ValueType > const &other)=default
 
 Model (Model< Type, ValueType > &&other)=default
 
Modeloperator= (Model< Type, ValueType > &&other)=default
 
 Model (storm::models::ModelType const &modelType, std::shared_ptr< storm::dd::DdManager< Type > > manager, storm::dd::Bdd< Type > reachableStates, storm::dd::Bdd< Type > initialStates, storm::dd::Bdd< Type > deadlockStates, storm::dd::Add< Type, ValueType > transitionMatrix, std::set< storm::expressions::Variable > const &rowVariables, std::shared_ptr< storm::adapters::AddExpressionAdapter< Type, ValueType > > rowExpressionAdapter, std::set< storm::expressions::Variable > const &columnVariables, std::vector< std::pair< storm::expressions::Variable, storm::expressions::Variable > > const &rowColumnMetaVariablePairs, std::map< std::string, storm::expressions::Expression > labelToExpressionMap=std::map< std::string, storm::expressions::Expression >(), std::unordered_map< std::string, RewardModelType > const &rewardModels=std::unordered_map< std::string, RewardModelType >())
 Constructs a model from the given data.
 
 Model (storm::models::ModelType const &modelType, std::shared_ptr< storm::dd::DdManager< Type > > manager, storm::dd::Bdd< Type > reachableStates, storm::dd::Bdd< Type > initialStates, storm::dd::Bdd< Type > deadlockStates, storm::dd::Add< Type, ValueType > transitionMatrix, std::set< storm::expressions::Variable > const &rowVariables, std::set< storm::expressions::Variable > const &columnVariables, std::vector< std::pair< storm::expressions::Variable, storm::expressions::Variable > > const &rowColumnMetaVariablePairs, std::map< std::string, storm::dd::Bdd< Type > > labelToBddMap=std::map< std::string, storm::dd::Bdd< Type > >(), std::unordered_map< std::string, RewardModelType > const &rewardModels=std::unordered_map< std::string, RewardModelType >())
 Constructs a model from the given data.
 
virtual uint_fast64_t getNumberOfStates () const override
 Returns the number of states of the model.
 
virtual uint_fast64_t getNumberOfTransitions () const override
 Returns the number of (non-zero) transitions of the model.
 
storm::dd::DdManager< Type > & getManager () const
 Retrieves the manager responsible for the DDs that represent this model.
 
std::shared_ptr< storm::dd::DdManager< Type > > const & getManagerAsSharedPointer () const
 Retrieves the manager responsible for the DDs that represent this model.
 
storm::dd::Bdd< Type > const & getReachableStates () const
 Retrieves the reachable states of the model.
 
storm::dd::Bdd< Type > const & getInitialStates () const
 Retrieves the initial states of the model.
 
storm::dd::Bdd< Type > const & getDeadlockStates () const
 
virtual storm::dd::Bdd< Type > getStates (std::string const &label) const
 Returns the sets of states labeled with the given label.
 
virtual storm::expressions::Expression getExpression (std::string const &label) const
 Returns the expression for the given label.
 
virtual storm::dd::Bdd< Type > getStates (storm::expressions::Expression const &expression) const
 Returns the set of states labeled satisfying the given expression (that must be of boolean type).
 
virtual bool hasLabel (std::string const &label) const
 Retrieves whether the given label is a valid label in this model.
 
storm::dd::Add< Type, ValueType > const & getTransitionMatrix () const
 Retrieves the matrix representing the transitions of the model.
 
storm::dd::Add< Type, ValueType > & getTransitionMatrix ()
 Retrieves the matrix representing the transitions of the model.
 
std::set< storm::expressions::Variable > const & getRowVariables () const
 Retrieves the meta variables used to encode the rows of the transition matrix and the vector indices.
 
std::set< storm::expressions::Variable > const & getColumnVariables () const
 Retrieves the meta variables used to encode the columns of the transition matrix and the vector indices.
 
std::set< storm::expressions::VariablegetRowAndNondeterminismVariables () const
 Retrieves all meta variables used to encode rows and nondetermism.
 
std::set< storm::expressions::VariablegetColumnAndNondeterminismVariables () const
 Retrieves all meta variables used to encode columns and nondetermism.
 
std::vector< std::pair< storm::expressions::Variable, storm::expressions::Variable > > const & getRowColumnMetaVariablePairs () const
 Retrieves the pairs of row and column meta variables.
 
storm::dd::Add< Type, ValueTypegetRowColumnIdentity () const
 Retrieves an ADD that represents the diagonal of the transition matrix.
 
virtual bool hasRewardModel (std::string const &rewardModelName) const override
 Retrieves whether the model has a reward model with the given name.
 
RewardModelType const & getRewardModel (std::string const &rewardModelName) const
 Retrieves the reward model with the given name, if one exists.
 
RewardModelType const & getUniqueRewardModel () const
 Retrieves the unique reward model, if there exists exactly one.
 
virtual std::string const & getUniqueRewardModelName () const override
 Retrieves the name of the unique reward model, if there exists exactly one.
 
RewardModelTypegetUniqueRewardModel ()
 Retrieves the unique reward model, if there exists exactly one.
 
virtual bool hasUniqueRewardModel () const override
 Retrieves whether the model has a unique reward model.
 
bool hasRewardModel () const
 Retrieves whether the model has at least one reward model.
 
std::unordered_map< std::string, RewardModelType > & getRewardModels ()
 
std::unordered_map< std::string, RewardModelType > const & getRewardModels () const
 
uint_fast64_t getNumberOfRewardModels () const
 Retrieves the number of reward models associated with this model.
 
virtual bool isSymbolicModel () const override
 Checks whether the model is a symbolic model.
 
virtual bool supportsParameters () const override
 Checks whether the model supports parameters.
 
virtual bool hasParameters () const override
 Checks whether the model has parameters.
 
std::vector< std::string > getLabels () const
 
void addParameters (std::set< storm::RationalFunctionVariable > const &parameters)
 
std::set< storm::RationalFunctionVariable > const & getParameters () const
 
template<typename NewValueType >
std::enable_if<!std::is_same< ValueType, NewValueType >::value, std::shared_ptr< Model< Type, NewValueType > > >::type toValueType () const
 
template<typename NewValueType >
std::enable_if< std::is_same< ValueType, NewValueType >::value, std::shared_ptr< Model< Type, NewValueType > > >::type toValueType () const
 
void writeDotToFile (std::string const &filename) const
 
void addParameters (std::set< storm::RationalFunctionVariable > const &parameters)
 
std::set< storm::RationalFunctionVariable > const & getParameters () const
 
- Public Member Functions inherited from storm::models::Model< ValueType >
 Model (ModelType const &modelType)
 Constructs a model of the given type.
 
virtual ~Model ()=default
 
- Public Member Functions inherited from storm::models::ModelBase
 ModelBase (ModelType const &modelType)
 Constructs a model of the given type.
 
virtual ~ModelBase ()
 
template<typename ModelType >
std::shared_ptr< ModelTypeas ()
 Casts the model into the model type given by the template parameter.
 
template<typename ModelType >
std::shared_ptr< ModelType const > as () const
 Casts the model into the model type given by the template parameter.
 
virtual ModelType getType () const
 Return the actual type of the model.
 
virtual bool isSparseModel () const
 Checks whether the model is a sparse model.
 
bool isOfType (storm::models::ModelType const &modelType) const
 Checks whether the model is of the given type.
 
bool isNondeterministicModel () const
 Returns true if the model is a nondeterministic model.
 
bool isDiscreteTimeModel () const
 Returns true if the model is a descrete-time model.
 
virtual bool isExact () const
 Checks whether the model is exact.
 
virtual bool isPartiallyObservable () const
 

Protected Member Functions

virtual void printDdVariableInformationToStream (std::ostream &out) const override
 Prints information about the DD variables to the specified stream.
 
- Protected Member Functions inherited from storm::models::symbolic::Model< Type, CValueType >
void setTransitionMatrix (storm::dd::Add< Type, ValueType > const &transitionMatrix)
 Sets the transition matrix of the model.
 
std::map< std::string, storm::expressions::Expression > const & getLabelToExpressionMap () const
 Retrieves the mapping of labels to their defining expressions.
 
std::map< std::string, storm::dd::Bdd< Type > > const & getLabelToBddMap () const
 Retrieves the mapping of labels to their defining expressions.
 
void printModelInformationHeaderToStream (std::ostream &out) const
 Prints the information header (number of states and transitions) of the model to the specified stream.
 
void printModelInformationFooterToStream (std::ostream &out) const
 Prints the information footer (reward models, labels) of the model to the specified stream.
 
void printRewardModelsInformationToStream (std::ostream &out) const
 Prints information about the reward models to the specified stream.
 
std::shared_ptr< storm::adapters::AddExpressionAdapter< Type, ValueType > > const & getRowExpressionAdapter () const
 Retrieves the expression adapter of this model.
 

Protected Attributes

storm::dd::Bdd< Type > illegalMask
 
- Protected Attributes inherited from storm::models::symbolic::Model< Type, CValueType >
storm::dd::Add< Type, ValueTypetransitionMatrix
 

Additional Inherited Members

- Static Public Attributes inherited from storm::models::symbolic::Model< Type, CValueType >
static const storm::dd::DdType DdType = Type
 
static const storm::models::ModelRepresentation Representation = GetModelRepresentation<DdType>::representation
 

Detailed Description

template<storm::dd::DdType Type, typename ValueType = double>
class storm::models::symbolic::NondeterministicModel< Type, ValueType >

Base class for all nondeterministic symbolic models.

Definition at line 15 of file NondeterministicModel.h.

Member Typedef Documentation

◆ RewardModelType

template<storm::dd::DdType Type, typename ValueType = double>
typedef Model<Type,ValueType>::RewardModelType storm::models::symbolic::NondeterministicModel< Type, ValueType >::RewardModelType

Definition at line 17 of file NondeterministicModel.h.

Constructor & Destructor Documentation

◆ NondeterministicModel() [1/4]

template<storm::dd::DdType Type, typename ValueType = double>
storm::models::symbolic::NondeterministicModel< Type, ValueType >::NondeterministicModel ( NondeterministicModel< Type, ValueType > const &  other)
default

◆ NondeterministicModel() [2/4]

template<storm::dd::DdType Type, typename ValueType = double>
storm::models::symbolic::NondeterministicModel< Type, ValueType >::NondeterministicModel ( NondeterministicModel< Type, ValueType > &&  other)
default

◆ NondeterministicModel() [3/4]

template<storm::dd::DdType Type, typename ValueType >
storm::models::symbolic::NondeterministicModel< Type, ValueType >::NondeterministicModel ( storm::models::ModelType const &  modelType,
std::shared_ptr< storm::dd::DdManager< Type > >  manager,
storm::dd::Bdd< Type >  reachableStates,
storm::dd::Bdd< Type >  initialStates,
storm::dd::Bdd< Type >  deadlockStates,
storm::dd::Add< Type, ValueType transitionMatrix,
std::set< storm::expressions::Variable > const &  rowVariables,
std::shared_ptr< storm::adapters::AddExpressionAdapter< Type, ValueType > >  rowExpressionAdapter,
std::set< storm::expressions::Variable > const &  columnVariables,
std::vector< std::pair< storm::expressions::Variable, storm::expressions::Variable > > const &  rowColumnMetaVariablePairs,
std::set< storm::expressions::Variable > const &  nondeterminismVariables,
std::map< std::string, storm::expressions::Expression labelToExpressionMap = std::map<std::string, storm::expressions::Expression>(),
std::unordered_map< std::string, RewardModelType > const &  rewardModels = std::unordered_map<std::string, RewardModelType>() 
)

Constructs a model from the given data.

Parameters
modelTypeThe type of the model.
managerThe manager responsible for the decision diagrams.
reachableStatesA DD representing the reachable states.
initialStatesA DD representing the initial states of the model.
deadlockStatesA DD representing the deadlock states of the model.
transitionMatrixThe matrix representing the transitions in the model.
rowVariablesThe set of row meta variables used in the DDs.
rowExpressionAdapterAn object that can be used to translate expressions in terms of the row meta variables.
columVariablesThe set of column meta variables used in the DDs.
rowColumnMetaVariablePairsAll pairs of row/column meta variables.
nondeterminismVariablesThe meta variables used to encode the nondeterminism in the model.
labelToExpressionMapA mapping from label names to their defining expressions.
rewardModelsThe reward models associated with the model.

Definition at line 17 of file NondeterministicModel.cpp.

◆ NondeterministicModel() [4/4]

template<storm::dd::DdType Type, typename ValueType >
storm::models::symbolic::NondeterministicModel< Type, ValueType >::NondeterministicModel ( storm::models::ModelType const &  modelType,
std::shared_ptr< storm::dd::DdManager< Type > >  manager,
storm::dd::Bdd< Type >  reachableStates,
storm::dd::Bdd< Type >  initialStates,
storm::dd::Bdd< Type >  deadlockStates,
storm::dd::Add< Type, ValueType transitionMatrix,
std::set< storm::expressions::Variable > const &  rowVariables,
std::set< storm::expressions::Variable > const &  columnVariables,
std::vector< std::pair< storm::expressions::Variable, storm::expressions::Variable > > const &  rowColumnMetaVariablePairs,
std::set< storm::expressions::Variable > const &  nondeterminismVariables,
std::map< std::string, storm::dd::Bdd< Type > >  labelToBddMap = std::map<std::string, storm::dd::Bdd<Type>>(),
std::unordered_map< std::string, RewardModelType > const &  rewardModels = std::unordered_map<std::string, RewardModelType>() 
)

Constructs a model from the given data.

Parameters
modelTypeThe type of the model.
managerThe manager responsible for the decision diagrams.
reachableStatesA DD representing the reachable states.
initialStatesA DD representing the initial states of the model.
deadlockStatesA DD representing the deadlock states of the model.
transitionMatrixThe matrix representing the transitions in the model.
rowVariablesThe set of row meta variables used in the DDs.
columVariablesThe set of column meta variables used in the DDs.
rowColumnMetaVariablePairsAll pairs of row/column meta variables.
nondeterminismVariablesThe meta variables used to encode the nondeterminism in the model.
labelToBddMapA mapping from label names to their defining BDDs.
rewardModelsThe reward models associated with the model.

Definition at line 32 of file NondeterministicModel.cpp.

Member Function Documentation

◆ getIllegalMask()

template<storm::dd::DdType Type, typename ValueType >
storm::dd::Bdd< Type > const & storm::models::symbolic::NondeterministicModel< Type, ValueType >::getIllegalMask ( ) const

Retrieves a BDD characterizing all illegal nondeterminism encodings in the model.

Returns
A BDD characterizing all illegal nondeterminism encodings in the model.

Definition at line 65 of file NondeterministicModel.cpp.

◆ getIllegalSuccessorMask()

template<storm::dd::DdType Type, typename ValueType >
storm::dd::Bdd< Type > storm::models::symbolic::NondeterministicModel< Type, ValueType >::getIllegalSuccessorMask ( ) const

Retrieves a BDD characterizing the illegal successors for each choice.

Returns
A BDD characterizing the illegal successors for each choice.

Definition at line 70 of file NondeterministicModel.cpp.

◆ getNondeterminismVariables()

template<storm::dd::DdType Type, typename ValueType >
std::set< storm::expressions::Variable > const & storm::models::symbolic::NondeterministicModel< Type, ValueType >::getNondeterminismVariables ( ) const
overridevirtual

Retrieves the meta variables used to encode the nondeterminism in the model.

Returns
The meta variables used to encode the nondeterminism in the model.

Reimplemented from storm::models::symbolic::Model< Type, CValueType >.

Definition at line 60 of file NondeterministicModel.cpp.

◆ getNumberOfChoices()

template<storm::dd::DdType Type, typename ValueType >
uint_fast64_t storm::models::symbolic::NondeterministicModel< Type, ValueType >::getNumberOfChoices ( ) const
overridevirtual

Retrieves the number of nondeterministic choices in the model.

Returns
The number of nondeterministic choices in the model.

Reimplemented from storm::models::symbolic::Model< Type, CValueType >.

Definition at line 46 of file NondeterministicModel.cpp.

◆ getQualitativeTransitionMatrix()

template<storm::dd::DdType Type, typename ValueType >
storm::dd::Bdd< Type > storm::models::symbolic::NondeterministicModel< Type, ValueType >::getQualitativeTransitionMatrix ( bool  keepNondeterminism = true) const
overridevirtual

Retrieves the matrix qualitatively (i.e.

without probabilities) representing the transitions of the model.

Parameters
keepNondeterminismIf false, the matrix will abstract from the nondeterminism variables.
Returns
A matrix representing the qualitative transitions of the model.

Reimplemented from storm::models::symbolic::Model< Type, CValueType >.

Definition at line 106 of file NondeterministicModel.cpp.

◆ operator=() [1/2]

template<storm::dd::DdType Type, typename ValueType = double>
NondeterministicModel & storm::models::symbolic::NondeterministicModel< Type, ValueType >::operator= ( NondeterministicModel< Type, ValueType > &&  other)
default

◆ operator=() [2/2]

template<storm::dd::DdType Type, typename ValueType = double>
NondeterministicModel & storm::models::symbolic::NondeterministicModel< Type, ValueType >::operator= ( NondeterministicModel< Type, ValueType > const &  other)
default

◆ printDdVariableInformationToStream()

template<storm::dd::DdType Type, typename ValueType >
void storm::models::symbolic::NondeterministicModel< Type, ValueType >::printDdVariableInformationToStream ( std::ostream &  out) const
overrideprotectedvirtual

Prints information about the DD variables to the specified stream.

Parameters
outThe stream the information is to be printed to.

Reimplemented from storm::models::symbolic::Model< Type, CValueType >.

Definition at line 83 of file NondeterministicModel.cpp.

◆ printModelInformationToStream()

template<storm::dd::DdType Type, typename ValueType >
void storm::models::symbolic::NondeterministicModel< Type, ValueType >::printModelInformationToStream ( std::ostream &  out) const
overridevirtual

Prints information about the model to the specified stream.

Parameters
outThe stream the information is to be printed to.

Reimplemented from storm::models::symbolic::Model< Type, CValueType >.

Definition at line 76 of file NondeterministicModel.cpp.

◆ reduceToStateBasedRewards()

template<storm::dd::DdType Type, typename ValueType >
void storm::models::symbolic::NondeterministicModel< Type, ValueType >::reduceToStateBasedRewards ( )
overridevirtual

Converts the transition rewards of all reward models to state-based rewards.

For deterministic models, this reduces the rewards to state rewards only. For nondeterminstic models, the reward models will contain state rewards and state-action rewards. Note that this transformation does not preserve all properties, but it preserves expected rewards.

Implements storm::models::ModelBase.

Definition at line 93 of file NondeterministicModel.cpp.

Member Data Documentation

◆ illegalMask

template<storm::dd::DdType Type, typename ValueType = double>
storm::dd::Bdd<Type> storm::models::symbolic::NondeterministicModel< Type, ValueType >::illegalMask
protected

Definition at line 124 of file NondeterministicModel.h.


The documentation for this class was generated from the following files: