Storm
A Modern Probabilistic Model Checker
|
#include <DdManager.h>
Public Member Functions | |
DdManager () | |
Creates an empty manager without any meta variables. | |
DdManager (DdManager< LibraryType > const &other)=delete | |
DdManager< LibraryType > & | operator= (DdManager< LibraryType > const &other)=delete |
DdManager (DdManager< LibraryType > &&other)=default | |
DdManager< LibraryType > & | operator= (DdManager< LibraryType > &&other)=default |
std::shared_ptr< DdManager< LibraryType > > | asSharedPointer () |
std::shared_ptr< DdManager< LibraryType > const > | asSharedPointer () const |
Bdd< LibraryType > | getBddOne () const |
Retrieves a BDD representing the constant one function. | |
template<typename ValueType > | |
Add< LibraryType, ValueType > | getAddOne () const |
Retrieves an ADD representing the constant one function. | |
Bdd< LibraryType > | getBddZero () const |
Retrieves a BDD representing the constant zero function. | |
template<typename ValueType > | |
Add< LibraryType, ValueType > | getAddZero () const |
Retrieves an ADD representing the constant zero function. | |
template<typename ValueType > | |
Add< LibraryType, ValueType > | getAddUndefined () const |
Retrieves an ADD representing an undefined value. | |
template<typename ValueType > | |
Add< LibraryType, ValueType > | getInfinity () const |
Retrieves an ADD representing the constant infinity function. | |
template<typename ValueType > | |
Add< LibraryType, ValueType > | getConstant (ValueType const &value) const |
Retrieves an ADD representing the constant function with the given value. | |
Bdd< LibraryType > | getEncoding (storm::expressions::Variable const &variable, int_fast64_t value, bool mostSignificantBitAtTop=true) const |
Retrieves the BDD representing the function that maps all inputs which have the given meta variable equal to the given value one. | |
Bdd< LibraryType > | getRange (storm::expressions::Variable const &variable) const |
Retrieves the BDD representing the range of the meta variable, i.e., a function that maps all legal values of the range of the meta variable to one. | |
template<typename ValueType > | |
Add< LibraryType, ValueType > | getIdentity (storm::expressions::Variable const &variable) const |
Retrieves the ADD representing the identity of the meta variable, i.e., a function that maps all legal values of the range of the meta variable to the values themselves. | |
Bdd< LibraryType > | getIdentity (std::vector< std::pair< storm::expressions::Variable, storm::expressions::Variable > > const &variablePairs, bool restrictToFirstRange=true) const |
Retrieves a BDD in which an encoding is mapped to true iff the meta variables of each pair encode the same value. | |
Bdd< LibraryType > | getIdentity (storm::expressions::Variable const &first, storm::expressions::Variable const &second, bool restrictToFirstRange=true) const |
Retrieves a BDD in which an encoding is mapped to true iff the two meta variables encode the same value. | |
Bdd< LibraryType > | getCube (storm::expressions::Variable const &variable) const |
Retrieves a BDD that is the cube of the variables representing the given meta variable. | |
Bdd< LibraryType > | getCube (std::set< storm::expressions::Variable > const &variables) const |
Retrieves a BDD that is the cube of the variables representing the given meta variables. | |
std::vector< storm::expressions::Variable > | cloneVariable (storm::expressions::Variable const &variable, std::string const &newVariableName, boost::optional< uint64_t > const &numberOfLayers=boost::none) |
Clones the given meta variable and optionally changes the number of layers of the variable. | |
std::pair< storm::expressions::Variable, storm::expressions::Variable > | addMetaVariable (std::string const &variableName, int_fast64_t low, int_fast64_t high, boost::optional< std::pair< MetaVariablePosition, storm::expressions::Variable > > const &position=boost::none) |
Adds an integer meta variable with the given range with two layers (a 'normal' and a 'primed' one). | |
std::vector< storm::expressions::Variable > | addMetaVariable (std::string const &variableName, int_fast64_t low, int_fast64_t high, uint64_t numberOfLayers, boost::optional< std::pair< MetaVariablePosition, storm::expressions::Variable > > const &position=boost::none) |
Creates a meta variable with the given number of layers. | |
std::vector< storm::expressions::Variable > | addBitVectorMetaVariable (std::string const &variableName, uint64_t bits, uint64_t numberOfLayers, boost::optional< std::pair< MetaVariablePosition, storm::expressions::Variable > > const &position=boost::none) |
Creates a meta variable with the given number of layers. | |
std::pair< storm::expressions::Variable, storm::expressions::Variable > | addMetaVariable (std::string const &variableName, boost::optional< std::pair< MetaVariablePosition, storm::expressions::Variable > > const &position=boost::none) |
Adds a boolean meta variable with two layers (a 'normal' and a 'primed' one). | |
std::vector< storm::expressions::Variable > | addMetaVariable (std::string const &variableName, uint64_t numberOfLayers, boost::optional< std::pair< MetaVariablePosition, storm::expressions::Variable > > const &position=boost::none) |
Creates a meta variable with the given number of layers. | |
std::set< std::string > | getAllMetaVariableNames () const |
Retrieves the names of all meta variables that have been added to the manager. | |
std::size_t | getNumberOfMetaVariables () const |
Retrieves the number of meta variables that are contained in this manager. | |
bool | hasMetaVariable (std::string const &variableName) const |
Retrieves whether the given meta variable name is already in use. | |
storm::expressions::Variable | getMetaVariable (std::string const &variableName) const |
Retrieves the given meta variable by name. | |
bool | supportsOrderedInsertion () const |
Checks whether this manager supports the ordered insertion of variables, i.e. | |
void | allowDynamicReordering (bool value) |
Sets whether or not dynamic reordering is allowed for the DDs managed by this manager (if supported). | |
bool | isDynamicReorderingAllowed () const |
Retrieves whether dynamic reordering is currently allowed (if supported). | |
void | triggerReordering () |
Triggers a reordering of the DDs managed by this manager (if supported). | |
DdMetaVariable< LibraryType > const & | getMetaVariable (storm::expressions::Variable const &variable) const |
Retrieves the meta variable with the given name if it exists. | |
std::set< storm::expressions::Variable > | getAllMetaVariables () const |
Retrieves the set of meta variables contained in the DD. | |
std::vector< uint_fast64_t > | getSortedVariableIndices () const |
Retrieves the (sorted) list of the variable indices of the DD variables given by the meta variable set. | |
std::vector< uint_fast64_t > | getSortedVariableIndices (std::set< storm::expressions::Variable > const &metaVariables) const |
Retrieves the (sorted) list of the variable indices of the DD variables given by the meta variable set. | |
InternalDdManager< LibraryType > & | getInternalDdManager () |
Retrieves the internal DD manager. | |
InternalDdManager< LibraryType > const & | getInternalDdManager () const |
Retrieves the internal DD manager. | |
void | debugCheck () const |
Performs a debug check if available. | |
void | execute (std::function< void()> const &f) const |
All code that manipulates DDs shall be called through this function. | |
Friends | |
class | Bdd< LibraryType > |
template<DdType LibraryTypePrime, typename ValueType > | |
class | Add |
template<DdType LibraryTypePrime, typename ValueType > | |
class | AddIterator |
Definition at line 25 of file DdManager.h.
storm::dd::DdManager< LibraryType >::DdManager | ( | ) |
Creates an empty manager without any meta variables.
Definition at line 21 of file DdManager.cpp.
|
delete |
|
default |
std::vector< storm::expressions::Variable > storm::dd::DdManager< LibraryType >::addBitVectorMetaVariable | ( | std::string const & | variableName, |
uint64_t | bits, | ||
uint64_t | numberOfLayers, | ||
boost::optional< std::pair< MetaVariablePosition, storm::expressions::Variable > > const & | position = boost::none |
||
) |
Creates a meta variable with the given number of layers.
variableName | The name of the variable. |
numberOfLayers | The number of layers of this variable (must be greater or equal 1). |
Definition at line 241 of file DdManager.cpp.
std::pair< storm::expressions::Variable, storm::expressions::Variable > storm::dd::DdManager< LibraryType >::addMetaVariable | ( | std::string const & | variableName, |
boost::optional< std::pair< MetaVariablePosition, storm::expressions::Variable > > const & | position = boost::none |
||
) |
Adds a boolean meta variable with two layers (a 'normal' and a 'primed' one).
variableName | The name of the new variable. |
Definition at line 248 of file DdManager.cpp.
std::pair< storm::expressions::Variable, storm::expressions::Variable > storm::dd::DdManager< LibraryType >::addMetaVariable | ( | std::string const & | variableName, |
int_fast64_t | low, | ||
int_fast64_t | high, | ||
boost::optional< std::pair< MetaVariablePosition, storm::expressions::Variable > > const & | position = boost::none |
||
) |
Adds an integer meta variable with the given range with two layers (a 'normal' and a 'primed' one).
variableName | The name of the new variable. |
low | The lowest value of the range of the variable. |
high | The highest value of the range of the variable. |
Definition at line 224 of file DdManager.cpp.
std::vector< storm::expressions::Variable > storm::dd::DdManager< LibraryType >::addMetaVariable | ( | std::string const & | variableName, |
int_fast64_t | low, | ||
int_fast64_t | high, | ||
uint64_t | numberOfLayers, | ||
boost::optional< std::pair< MetaVariablePosition, storm::expressions::Variable > > const & | position = boost::none |
||
) |
Creates a meta variable with the given number of layers.
variableName | The name of the variable. |
numberOfLayers | The number of layers of this variable (must be greater or equal 1). |
Definition at line 232 of file DdManager.cpp.
std::vector< storm::expressions::Variable > storm::dd::DdManager< LibraryType >::addMetaVariable | ( | std::string const & | variableName, |
uint64_t | numberOfLayers, | ||
boost::optional< std::pair< MetaVariablePosition, storm::expressions::Variable > > const & | position = boost::none |
||
) |
Creates a meta variable with the given number of layers.
variableName | The name of the variable. |
numberOfLayers | The number of layers of this variable (must be greater or equal 1). |
Definition at line 255 of file DdManager.cpp.
void storm::dd::DdManager< LibraryType >::allowDynamicReordering | ( | bool | value | ) |
Sets whether or not dynamic reordering is allowed for the DDs managed by this manager (if supported).
value | If set to true, dynamic reordering is allowed and forbidden otherwise. |
Definition at line 450 of file DdManager.cpp.
std::shared_ptr< DdManager< LibraryType > > storm::dd::DdManager< LibraryType >::asSharedPointer | ( | ) |
Definition at line 26 of file DdManager.cpp.
std::shared_ptr< DdManager< LibraryType > const > storm::dd::DdManager< LibraryType >::asSharedPointer | ( | ) | const |
Definition at line 31 of file DdManager.cpp.
std::vector< storm::expressions::Variable > storm::dd::DdManager< LibraryType >::cloneVariable | ( | storm::expressions::Variable const & | variable, |
std::string const & | newVariableName, | ||
boost::optional< uint64_t > const & | numberOfLayers = boost::none |
||
) |
Clones the given meta variable and optionally changes the number of layers of the variable.
variable | The variable to clone. |
newVariableName | The name of the variable to create. |
numberOfLayers | The number of layers of the variable to create. |
Definition at line 208 of file DdManager.cpp.
void storm::dd::DdManager< LibraryType >::debugCheck | ( | ) | const |
Performs a debug check if available.
Definition at line 513 of file DdManager.cpp.
void storm::dd::DdManager< LibraryType >::execute | ( | std::function< void()> const & | f | ) | const |
All code that manipulates DDs shall be called through this function.
This is generally needed to set-up the correct context. Specifically for sylvan, this is required to make sure that DD-manipulating code is executed as a LACE task. Example usage: manager->execute([&]() { bar = foo(arg1,arg2); }
f | the function that is executed |
Definition at line 518 of file DdManager.cpp.
template Add< DdType::Sylvan, uint_fast64_t > storm::dd::DdManager< LibraryType >::getAddOne | ( | ) | const |
Retrieves an ADD representing the constant one function.
Definition at line 42 of file DdManager.cpp.
template Add< DdType::Sylvan, uint_fast64_t > storm::dd::DdManager< LibraryType >::getAddUndefined | ( | ) | const |
Retrieves an ADD representing an undefined value.
Definition at line 59 of file DdManager.cpp.
template Add< DdType::Sylvan, uint_fast64_t > storm::dd::DdManager< LibraryType >::getAddZero | ( | ) | const |
Retrieves an ADD representing the constant zero function.
Definition at line 53 of file DdManager.cpp.
std::set< std::string > storm::dd::DdManager< LibraryType >::getAllMetaVariableNames | ( | ) | const |
Retrieves the names of all meta variables that have been added to the manager.
Definition at line 345 of file DdManager.cpp.
std::set< storm::expressions::Variable > storm::dd::DdManager< LibraryType >::getAllMetaVariables | ( | ) | const |
Retrieves the set of meta variables contained in the DD.
Definition at line 465 of file DdManager.cpp.
Bdd< LibraryType > storm::dd::DdManager< LibraryType >::getBddOne | ( | ) | const |
Retrieves a BDD representing the constant one function.
Definition at line 36 of file DdManager.cpp.
Bdd< LibraryType > storm::dd::DdManager< LibraryType >::getBddZero | ( | ) | const |
Retrieves a BDD representing the constant zero function.
Definition at line 47 of file DdManager.cpp.
template Add< DdType::Sylvan, uint_fast64_t > storm::dd::DdManager< LibraryType >::getConstant | ( | ValueType const & | value | ) | const |
Retrieves an ADD representing the constant function with the given value.
Definition at line 71 of file DdManager.cpp.
Bdd< LibraryType > storm::dd::DdManager< LibraryType >::getCube | ( | std::set< storm::expressions::Variable > const & | variables | ) | const |
Retrieves a BDD that is the cube of the variables representing the given meta variables.
variables | The expression variables associated with the meta variables. |
Definition at line 198 of file DdManager.cpp.
Bdd< LibraryType > storm::dd::DdManager< LibraryType >::getCube | ( | storm::expressions::Variable const & | variable | ) | const |
Retrieves a BDD that is the cube of the variables representing the given meta variable.
variable | The expression variable associated with the meta variable. |
Definition at line 189 of file DdManager.cpp.
Bdd< LibraryType > storm::dd::DdManager< LibraryType >::getEncoding | ( | storm::expressions::Variable const & | variable, |
int_fast64_t | value, | ||
bool | mostSignificantBitAtTop = true |
||
) | const |
Retrieves the BDD representing the function that maps all inputs which have the given meta variable equal to the given value one.
variable | The expression variable associated with the meta variable. |
value | The value the meta variable is supposed to have. |
mostSignificantBitAtTop | A flag indicating whether the most significant bit of the value is to be encoded with the topmost variable or the bottommost. |
Definition at line 76 of file DdManager.cpp.
Bdd< LibraryType > storm::dd::DdManager< LibraryType >::getIdentity | ( | std::vector< std::pair< storm::expressions::Variable, storm::expressions::Variable > > const & | variablePairs, |
bool | restrictToFirstRange = true |
||
) | const |
Retrieves a BDD in which an encoding is mapped to true iff the meta variables of each pair encode the same value.
variablePairs | The variable pairs for which to compute the identity. |
restrictToFirstRange | If set, the identity will be restricted to the legal range of the first variable. |
Definition at line 154 of file DdManager.cpp.
Bdd< LibraryType > storm::dd::DdManager< LibraryType >::getIdentity | ( | storm::expressions::Variable const & | first, |
storm::expressions::Variable const & | second, | ||
bool | restrictToFirstRange = true |
||
) | const |
Retrieves a BDD in which an encoding is mapped to true iff the two meta variables encode the same value.
first | The first meta variable in the identity. |
second | The second meta variable in the identity. |
restrictToFirstRange | If set, the identity will be restricted to the legal range of the first variable. |
Definition at line 164 of file DdManager.cpp.
template Add< DdType::Sylvan, uint_fast64_t > storm::dd::DdManager< LibraryType >::getIdentity | ( | storm::expressions::Variable const & | variable | ) | const |
Retrieves the ADD representing the identity of the meta variable, i.e., a function that maps all legal values of the range of the meta variable to the values themselves.
variable | The expression variable associated with the meta variable. |
Definition at line 142 of file DdManager.cpp.
template Add< DdType::Sylvan, uint_fast64_t > storm::dd::DdManager< LibraryType >::getInfinity< uint_fast64_t > | ( | ) | const |
Retrieves an ADD representing the constant infinity function.
Definition at line 65 of file DdManager.cpp.
InternalDdManager< LibraryType > & storm::dd::DdManager< LibraryType >::getInternalDdManager | ( | ) |
Retrieves the internal DD manager.
Definition at line 493 of file DdManager.cpp.
InternalDdManager< LibraryType > const & storm::dd::DdManager< LibraryType >::getInternalDdManager | ( | ) | const |
Retrieves the internal DD manager.
Definition at line 498 of file DdManager.cpp.
storm::expressions::Variable storm::dd::DdManager< LibraryType >::getMetaVariable | ( | std::string const & | variableName | ) | const |
Retrieves the given meta variable by name.
variableName | The name of the variable. |
Definition at line 364 of file DdManager.cpp.
DdMetaVariable< LibraryType > const & storm::dd::DdManager< LibraryType >::getMetaVariable | ( | storm::expressions::Variable const & | variable | ) | const |
Retrieves the meta variable with the given name if it exists.
variable | The expression variable associated with the meta variable. |
Definition at line 334 of file DdManager.cpp.
std::size_t storm::dd::DdManager< LibraryType >::getNumberOfMetaVariables | ( | ) | const |
Retrieves the number of meta variables that are contained in this manager.
Definition at line 354 of file DdManager.cpp.
Bdd< LibraryType > storm::dd::DdManager< LibraryType >::getRange | ( | storm::expressions::Variable const & | variable | ) | const |
Retrieves the BDD representing the range of the meta variable, i.e., a function that maps all legal values of the range of the meta variable to one.
variable | The expression variable associated with the meta variable. |
Definition at line 124 of file DdManager.cpp.
std::vector< uint_fast64_t > storm::dd::DdManager< LibraryType >::getSortedVariableIndices | ( | ) | const |
Retrieves the (sorted) list of the variable indices of the DD variables given by the meta variable set.
manager | The manager responsible for the DD. |
metaVariable | The set of meta variables for which to retrieve the index list. |
Definition at line 474 of file DdManager.cpp.
std::vector< uint_fast64_t > storm::dd::DdManager< LibraryType >::getSortedVariableIndices | ( | std::set< storm::expressions::Variable > const & | metaVariables | ) | const |
Retrieves the (sorted) list of the variable indices of the DD variables given by the meta variable set.
manager | The manager responsible for the DD. |
metaVariable | The set of meta variables for which to retrieve the index list. |
Definition at line 479 of file DdManager.cpp.
bool storm::dd::DdManager< LibraryType >::hasMetaVariable | ( | std::string const & | variableName | ) | const |
Retrieves whether the given meta variable name is already in use.
variableName | The name of the variable. |
Definition at line 359 of file DdManager.cpp.
bool storm::dd::DdManager< LibraryType >::isDynamicReorderingAllowed | ( | ) | const |
Retrieves whether dynamic reordering is currently allowed (if supported).
Definition at line 455 of file DdManager.cpp.
|
default |
|
delete |
bool storm::dd::DdManager< LibraryType >::supportsOrderedInsertion | ( | ) | const |
Checks whether this manager supports the ordered insertion of variables, i.e.
inserting variables at positions between already existing variables.
Definition at line 372 of file DdManager.cpp.
void storm::dd::DdManager< LibraryType >::triggerReordering | ( | ) |
Triggers a reordering of the DDs managed by this manager (if supported).
Definition at line 460 of file DdManager.cpp.
|
friend |
Definition at line 30 of file DdManager.h.
|
friend |
Definition at line 33 of file DdManager.h.
Definition at line 1 of file DdManager.h.