Storm
A Modern Probabilistic Model Checker
|
#include <Bdd.h>
Public Member Functions | |
Bdd (DdManager< LibraryType > const &ddManager, InternalBdd< LibraryType > const &internalBdd, std::set< storm::expressions::Variable > const &containedMetaVariables=std::set< storm::expressions::Variable >()) | |
Creates a DD that encapsulates the given internal BDD. | |
Bdd ()=default | |
Bdd (Bdd< LibraryType > const &other)=default | |
Bdd & | operator= (Bdd< LibraryType > const &other)=default |
Bdd (Bdd< LibraryType > &&other)=default | |
Bdd & | operator= (Bdd< LibraryType > &&other)=default |
bool | operator== (Bdd< LibraryType > const &other) const |
Retrieves whether the two BDDs represent the same function. | |
bool | operator!= (Bdd< LibraryType > const &other) const |
Retrieves whether the two BDDs represent different functions. | |
Bdd< LibraryType > | ite (Bdd< LibraryType > const &thenBdd, Bdd< LibraryType > const &elseBdd) const |
Performs an if-then-else with the given operands, i.e. | |
template<typename ValueType > | |
Add< LibraryType, ValueType > | ite (Add< LibraryType, ValueType > const &thenAdd, Add< LibraryType, ValueType > const &elseAdd) const |
Performs an if-then-else with the given operands, i.e. | |
Bdd< LibraryType > | operator|| (Bdd< LibraryType > const &other) const |
Performs a logical or of the current and the given BDD. | |
Bdd< LibraryType > & | operator|= (Bdd< LibraryType > const &other) |
Performs a logical or of the current and the given BDD and assigns it to the current BDD. | |
Bdd< LibraryType > | operator&& (Bdd< LibraryType > const &other) const |
Performs a logical and of the current and the given BDD. | |
Bdd< LibraryType > & | operator&= (Bdd< LibraryType > const &other) |
Performs a logical and of the current and the given BDD and assigns it to the current BDD. | |
Bdd< LibraryType > | iff (Bdd< LibraryType > const &other) const |
Performs a logical iff of the current and the given BDD. | |
Bdd< LibraryType > | exclusiveOr (Bdd< LibraryType > const &other) const |
Performs a logical exclusive-or of the current and the given BDD. | |
Bdd< LibraryType > | implies (Bdd< LibraryType > const &other) const |
Performs a logical implication of the current and the given BDD. | |
Bdd< LibraryType > | operator! () const |
Logically inverts the current BDD. | |
Bdd< LibraryType > & | complement () |
Logically complements the current BDD. | |
Bdd< LibraryType > | existsAbstract (std::set< storm::expressions::Variable > const &metaVariables) const |
Existentially abstracts from the given meta variables. | |
Bdd< LibraryType > | existsAbstractRepresentative (std::set< storm::expressions::Variable > const &metaVariables) const |
Similar to existsAbstract , but does not abstract from the variables but rather picks a valuation of each of the meta variables "to abstract from" such that for this valuation, there exists a valuation (of the other variables) that that make the function evaluate to true. | |
Bdd< LibraryType > | universalAbstract (std::set< storm::expressions::Variable > const &metaVariables) const |
Universally abstracts from the given meta variables. | |
Bdd< LibraryType > | andExists (Bdd< LibraryType > const &other, std::set< storm::expressions::Variable > const &existentialVariables) const |
Computes the logical and of the current and the given BDD and existentially abstracts from the given set of variables. | |
Bdd< LibraryType > | constrain (Bdd< LibraryType > const &constraint) const |
Computes the constraint of the current BDD with the given constraint. | |
Bdd< LibraryType > | restrict (Bdd< LibraryType > const &constraint) const |
Computes the restriction of the current BDD with the given constraint. | |
Bdd< LibraryType > | relationalProduct (Bdd< LibraryType > const &relation, std::set< storm::expressions::Variable > const &rowMetaVariables, std::set< storm::expressions::Variable > const &columnMetaVariables) const |
Computes the relational product of the current BDD and the given BDD representing a relation. | |
Bdd< LibraryType > | inverseRelationalProduct (Bdd< LibraryType > const &relation, std::set< storm::expressions::Variable > const &rowMetaVariables, std::set< storm::expressions::Variable > const &columnMetaVariables) const |
Computes the inverse relational product of the current BDD and the given BDD representing a relation. | |
Bdd< LibraryType > | inverseRelationalProductWithExtendedRelation (Bdd< LibraryType > const &relation, std::set< storm::expressions::Variable > const &rowMetaVariables, std::set< storm::expressions::Variable > const &columnMetaVariables) const |
Computes the inverse relational product of the current BDD and the given BDD representing a relation that contains more variables than just the row and column variables. | |
Bdd< LibraryType > | swapVariables (std::vector< std::pair< storm::expressions::Variable, storm::expressions::Variable > > const &metaVariablePairs) const |
Swaps the given pairs of meta variables in the BDD. | |
Bdd< LibraryType > | renameVariables (std::set< storm::expressions::Variable > const &from, std::set< storm::expressions::Variable > const &to) const |
Renames the given meta variables in the BDD. | |
Bdd< LibraryType > | renameVariablesAbstract (std::set< storm::expressions::Variable > const &from, std::set< storm::expressions::Variable > const &to) const |
Renames the given meta variables in the BDD. | |
Bdd< LibraryType > | renameVariablesConcretize (std::set< storm::expressions::Variable > const &from, std::set< storm::expressions::Variable > const &to) const |
Renames the given meta variables in the BDD. | |
bool | isOne () const |
Retrieves whether this DD represents the constant one function. | |
bool | isZero () const |
Retrieves whether this DD represents the constant zero function. | |
template<typename ValueType > | |
Add< LibraryType, ValueType > | toAdd () const |
Converts a BDD to an equivalent ADD. | |
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). | |
storm::storage::BitVector | toVector (storm::dd::Odd const &rowOdd) const |
Converts the BDD to a bit vector. | |
std::pair< std::vector< storm::expressions::Expression >, std::unordered_map< uint_fast64_t, storm::expressions::Variable > > | toExpression (storm::expressions::ExpressionManager &manager) const |
Translates the function the BDD is representing to a set of expressions that characterize the function. | |
virtual Bdd< LibraryType > | getSupport () const override |
Retrieves the support of the current DD. | |
virtual uint_fast64_t | getNonZeroCount () const override |
Retrieves the number of encodings that are mapped to a non-zero value. | |
virtual uint_fast64_t | getLeafCount () const override |
Retrieves the number of leaves of the DD. | |
virtual uint_fast64_t | getNodeCount () const override |
Retrieves the number of nodes necessary to represent the DD. | |
virtual uint_fast64_t | getIndex () const override |
Retrieves the index of the topmost variable in the DD. | |
virtual uint_fast64_t | getLevel () const override |
Retrieves the level of the topmost variable in the DD. | |
virtual void | exportToDot (std::string const &filename, bool showVariablesIfPossible=true) const override |
Exports the DD to the given file in the dot format. | |
virtual void | exportToText (std::string const &filename) const override |
Exports the DD to the given file in the dot format. | |
Odd | createOdd () const |
Creates an ODD based on the current BDD. | |
template<typename ValueType > | |
std::vector< ValueType > | filterExplicitVector (Odd const &odd, std::vector< ValueType > const &values) const |
Filters the given explicit vector using the symbolic representation of which values to select. | |
storm::storage::BitVector | filterExplicitVector (Odd const &odd, storm::storage::BitVector const &values) const |
Filters the given explicit vector using the symbolic representation of which values to select. | |
InternalBdd< LibraryType > const & | getInternalBdd () const |
Retrieves the internal BDD. | |
![]() | |
Dd ()=default | |
Dd (Dd< LibraryType > const &other)=default | |
Dd & | operator= (Dd< LibraryType > const &other)=default |
Dd (Dd< LibraryType > &&other)=default | |
Dd & | operator= (Dd< LibraryType > &&other)=default |
virtual | ~Dd ()=default |
bool | containsMetaVariable (storm::expressions::Variable const &metaVariable) const |
Retrieves whether the given meta variable is contained in the DD. | |
bool | containsMetaVariables (std::set< storm::expressions::Variable > const &metaVariables) const |
Retrieves whether the given meta variables are all contained in the DD. | |
std::set< storm::expressions::Variable > const & | getContainedMetaVariables () const |
Retrieves the set of all meta variables contained in the DD. | |
DdManager< LibraryType > & | getDdManager () const |
Retrieves the manager that is responsible for this DD. | |
std::set< storm::expressions::Variable > & | getContainedMetaVariables () |
Retrieves the set of all meta variables contained in the DD. | |
void | addMetaVariables (std::set< storm::expressions::Variable > const &metaVariables) |
Adds the given set of meta variables to the DD. | |
void | addMetaVariable (storm::expressions::Variable const &metaVariable) |
Adds the given meta variable to the set of meta variables that are contained in this DD. | |
void | removeMetaVariable (storm::expressions::Variable const &metaVariable) |
Removes the given meta variable to the set of meta variables that are contained in this DD. | |
void | removeMetaVariables (std::set< storm::expressions::Variable > const &metaVariables) |
Removes the given set of meta variables from the DD. | |
Static Public Member Functions | |
static Bdd< LibraryType > | getEncoding (DdManager< LibraryType > const &ddManager, uint64_t targetOffset, storm::dd::Odd const &odd, std::set< storm::expressions::Variable > const &metaVariables) |
Constructs the BDD representation of the encoding with the given offset. | |
static Bdd< LibraryType > | fromVector (DdManager< LibraryType > const &ddManager, storm::storage::BitVector const &truthValues, storm::dd::Odd const &odd, std::set< storm::expressions::Variable > const &metaVariables) |
Constructs a BDD representation of all encodings whose value is true in the given list of truth values. | |
template<typename ValueType > | |
static Bdd< LibraryType > | fromVector (DdManager< LibraryType > const &ddManager, std::vector< ValueType > const &explicitValues, storm::dd::Odd const &odd, std::set< storm::expressions::Variable > const &metaVariables, storm::logic::ComparisonType comparisonType, ValueType value) |
Constructs a BDD representation of all encodings that are in the requested relation with the given value. | |
static Bdd< LibraryType > | getCube (DdManager< LibraryType > const &manager, std::set< storm::expressions::Variable > const &metaVariables) |
Retrieves the cube of all given meta variables. | |
Friends | |
class | DdManager< LibraryType > |
template<DdType LibraryTypePrime, typename ValueTypePrime > | |
class | Add |
struct | std::hash< storm::dd::Bdd< LibraryType > > |
template<DdType LibraryTypePrime, typename ValueType > | |
struct | FromVectorHelper |
Additional Inherited Members | |
![]() | |
std::vector< uint_fast64_t > | getSortedVariableIndices () const |
Retrieves the (sorted) list of the variable indices of DD variables contained in this DD. | |
Dd (DdManager< LibraryType > const &ddManager, std::set< storm::expressions::Variable > const &containedMetaVariables=std::set< storm::expressions::Variable >()) | |
Creates a DD with the given manager and meta variables. | |
![]() | |
static std::set< storm::expressions::Variable > | joinMetaVariables (storm::dd::Dd< LibraryType > const &first, storm::dd::Dd< LibraryType > const &second) |
Retrieves the set of meta variables contained in both DDs. | |
static std::set< storm::expressions::Variable > | subtractMetaVariables (storm::dd::Dd< LibraryType > const &first, storm::dd::Dd< LibraryType > const &second) |
Retrieves the set of meta variables that are contained in the first but not the second DD. | |
storm::dd::Bdd< LibraryType >::Bdd | ( | DdManager< LibraryType > const & | ddManager, |
InternalBdd< LibraryType > const & | internalBdd, | ||
std::set< storm::expressions::Variable > const & | containedMetaVariables = std::set<storm::expressions::Variable>() |
||
) |
|
default |
|
default |
|
default |
Bdd< LibraryType > storm::dd::Bdd< LibraryType >::andExists | ( | Bdd< LibraryType > const & | other, |
std::set< storm::expressions::Variable > const & | existentialVariables | ||
) | const |
Computes the logical and of the current and the given BDD and existentially abstracts from the given set of variables.
other | The second BDD for the logical and. |
existentialVariables | The variables from which to existentially abstract. |
Bdd< LibraryType > & storm::dd::Bdd< LibraryType >::complement | ( | ) |
Bdd< LibraryType > storm::dd::Bdd< LibraryType >::constrain | ( | Bdd< LibraryType > const & | constraint | ) | const |
Computes the constraint of the current BDD with the given constraint.
That is, the function value of the resulting BDD will be the same as the current ones for all assignments mapping to one in the constraint and may be different otherwise.
constraint | The constraint to use for the operation. |
Odd storm::dd::Bdd< LibraryType >::createOdd | ( | ) | const |
Bdd< LibraryType > storm::dd::Bdd< LibraryType >::exclusiveOr | ( | Bdd< LibraryType > const & | other | ) | const |
Bdd< LibraryType > storm::dd::Bdd< LibraryType >::existsAbstract | ( | std::set< storm::expressions::Variable > const & | metaVariables | ) | const |
Bdd< LibraryType > storm::dd::Bdd< LibraryType >::existsAbstractRepresentative | ( | std::set< storm::expressions::Variable > const & | metaVariables | ) | const |
Similar to existsAbstract
, but does not abstract from the variables but rather picks a valuation of each of the meta variables "to abstract from" such that for this valuation, there exists a valuation (of the other variables) that that make the function evaluate to true.
metaVariables | The meta variables from which to abstract. |
|
overridevirtual |
Exports the DD to the given file in the dot format.
filename | The name of the file to which the DD is to be exported. |
Implements storm::dd::Dd< LibraryType >.
|
overridevirtual |
Exports the DD to the given file in the dot format.
filename | The name of the file to which the DD is to be exported. |
Implements storm::dd::Dd< LibraryType >.
std::vector< ValueType > storm::dd::Bdd< LibraryType >::filterExplicitVector | ( | Odd const & | odd, |
std::vector< ValueType > const & | values | ||
) | const |
storm::storage::BitVector storm::dd::Bdd< LibraryType >::filterExplicitVector | ( | Odd const & | odd, |
storm::storage::BitVector const & | values | ||
) | const |
|
static |
Constructs a BDD representation of all encodings that are in the requested relation with the given value.
ddManager | The DD manager responsible for the resulting BDD. |
explicitValues | The explicit values to compare to the given value. |
odd | The ODD used for the translation from the explicit representation to a symbolic one. |
metaVariables | The meta variables to use for the symbolic encoding. |
comparisonType | The relation that needs to hold for the values (wrt. to the given value). |
value | The value to compare with. |
|
static |
Constructs a BDD representation of all encodings whose value is true in the given list of truth values.
ddManager | The DD manager responsible for the resulting BDD. |
truthValues | The truth values. |
odd | The ODD used for the translation from the explicit representation to a symbolic one. |
metaVariables | The meta variables to use for the symbolic encoding. |
|
static |
|
static |
Constructs the BDD representation of the encoding with the given offset.
ddManager | The DD manager responsible for the resulting BDD. |
targetOffset | The offset to encode (interpreted within the ODD). |
odd | The ODD used for the translation from the explicit representation to a symbolic one. |
metaVariables | The meta variables to use for the symbolic encoding. |
|
overridevirtual |
Retrieves the index of the topmost variable in the DD.
Implements storm::dd::Dd< LibraryType >.
InternalBdd< LibraryType > const & storm::dd::Bdd< LibraryType >::getInternalBdd | ( | ) | const |
|
overridevirtual |
Retrieves the number of leaves of the DD.
Implements storm::dd::Dd< LibraryType >.
|
overridevirtual |
Retrieves the level of the topmost variable in the DD.
Implements storm::dd::Dd< LibraryType >.
|
overridevirtual |
Retrieves the number of nodes necessary to represent the DD.
Implements storm::dd::Dd< LibraryType >.
|
overridevirtual |
Retrieves the number of encodings that are mapped to a non-zero value.
Implements storm::dd::Dd< LibraryType >.
|
overridevirtual |
Retrieves the support of the current DD.
Implements storm::dd::Dd< LibraryType >.
Bdd< LibraryType > storm::dd::Bdd< LibraryType >::iff | ( | Bdd< LibraryType > const & | other | ) | const |
Bdd< LibraryType > storm::dd::Bdd< LibraryType >::implies | ( | Bdd< LibraryType > const & | other | ) | const |
Bdd< LibraryType > storm::dd::Bdd< LibraryType >::inverseRelationalProduct | ( | Bdd< LibraryType > const & | relation, |
std::set< storm::expressions::Variable > const & | rowMetaVariables, | ||
std::set< storm::expressions::Variable > const & | columnMetaVariables | ||
) | const |
Computes the inverse relational product of the current BDD and the given BDD representing a relation.
Note that this operation assumes that the row and column variables are interleaved and that the relation only contains the row and column variables.
relation | The relation to use. |
rowMetaVariables | The row meta variables used in the relation. |
columnMetaVariables | The row meta variables used in the relation. |
Bdd< LibraryType > storm::dd::Bdd< LibraryType >::inverseRelationalProductWithExtendedRelation | ( | Bdd< LibraryType > const & | relation, |
std::set< storm::expressions::Variable > const & | rowMetaVariables, | ||
std::set< storm::expressions::Variable > const & | columnMetaVariables | ||
) | const |
Computes the inverse relational product of the current BDD and the given BDD representing a relation that contains more variables than just the row and column variables.
Note that this operation assumes that the row and column variables are interleaved.
relation | The relation to use. |
rowMetaVariables | The row meta variables used in the relation. |
columnMetaVariables | The row meta variables used in the relation. |
bool storm::dd::Bdd< LibraryType >::isOne | ( | ) | const |
bool storm::dd::Bdd< LibraryType >::isZero | ( | ) | const |
Add< LibraryType, ValueType > storm::dd::Bdd< LibraryType >::ite | ( | Add< LibraryType, ValueType > const & | thenAdd, |
Add< LibraryType, ValueType > const & | elseAdd | ||
) | const |
Performs an if-then-else with the given operands, i.e.
maps all valuations that are mapped to true to the function values specified by the first DD and all others to the function values specified by the second DD.
thenAdd | The ADD defining the 'then' part. |
elseAdd | The ADD defining the 'else' part. |
Bdd< LibraryType > storm::dd::Bdd< LibraryType >::ite | ( | Bdd< LibraryType > const & | thenBdd, |
Bdd< LibraryType > const & | elseBdd | ||
) | const |
Performs an if-then-else with the given operands, i.e.
maps all valuations that are mapped to a non-zero function value to the function values specified by the first DD and all others to the function values specified by the second DD.
thenBdd | The BDD defining the 'then' part. |
elseBdd | The BDD defining the 'else' part. |
Bdd< LibraryType > storm::dd::Bdd< LibraryType >::operator! | ( | ) | const |
bool storm::dd::Bdd< LibraryType >::operator!= | ( | Bdd< LibraryType > const & | other | ) | const |
Bdd< LibraryType > storm::dd::Bdd< LibraryType >::operator&& | ( | Bdd< LibraryType > const & | other | ) | const |
Bdd< LibraryType > & storm::dd::Bdd< LibraryType >::operator&= | ( | Bdd< LibraryType > const & | other | ) |
|
default |
|
default |
bool storm::dd::Bdd< LibraryType >::operator== | ( | Bdd< LibraryType > const & | other | ) | const |
Bdd< LibraryType > & storm::dd::Bdd< LibraryType >::operator|= | ( | Bdd< LibraryType > const & | other | ) |
Bdd< LibraryType > storm::dd::Bdd< LibraryType >::operator|| | ( | Bdd< LibraryType > const & | other | ) | const |
Bdd< LibraryType > storm::dd::Bdd< LibraryType >::relationalProduct | ( | Bdd< LibraryType > const & | relation, |
std::set< storm::expressions::Variable > const & | rowMetaVariables, | ||
std::set< storm::expressions::Variable > const & | columnMetaVariables | ||
) | const |
Computes the relational product of the current BDD and the given BDD representing a relation.
Note that this operation assumes that the row and column variables are interleaved and that the relation only contains the row and column variables.
relation | The relation to use. |
rowMetaVariables | The row meta variables used in the relation. |
columnMetaVariables | The row meta variables used in the relation. |
Bdd< LibraryType > storm::dd::Bdd< LibraryType >::renameVariables | ( | std::set< storm::expressions::Variable > const & | from, |
std::set< storm::expressions::Variable > const & | to | ||
) | const |
Renames the given meta variables in the BDD.
The number of the underlying DD variables of the both meta variable sets needs to agree.
from | The meta variables to be renamed. The current BDD needs to contain all these meta variables. |
to | The meta variables that are the target of the renaming process. The current BDD must not contain any of these meta variables. |
Bdd< LibraryType > storm::dd::Bdd< LibraryType >::renameVariablesAbstract | ( | std::set< storm::expressions::Variable > const & | from, |
std::set< storm::expressions::Variable > const & | to | ||
) | const |
Renames the given meta variables in the BDD.
The number of the underlying DD variables of the from meta variable set needs to be at least as large as the to meta variable set. If the amount of variables coincide, this operation coincides with renameVariables. Otherwise, it first abstracts from the superfluous variables and then performs the renaming.
from | The meta variables to be renamed. The current ADD needs to contain all these meta variables. |
to | The meta variables that are the target of the renaming process. The current ADD must not contain any of these meta variables. |
Bdd< LibraryType > storm::dd::Bdd< LibraryType >::renameVariablesConcretize | ( | std::set< storm::expressions::Variable > const & | from, |
std::set< storm::expressions::Variable > const & | to | ||
) | const |
Renames the given meta variables in the BDD.
The number of the underlying DD variables of the from meta variable set needs to be at most as large as the to meta variable set. If the amount of variables coincide, this operation coincides with renameVariables. Otherwise, it first adds a unique encoding in terms of the superfluous variables and then performs the renaming.
from | The meta variables to be renamed. The current ADD needs to contain all these meta variables. |
to | The meta variables that are the target of the renaming process. The current ADD must not contain any of these meta variables. |
Bdd< LibraryType > storm::dd::Bdd< LibraryType >::restrict | ( | Bdd< LibraryType > const & | constraint | ) | const |
Computes the restriction of the current BDD with the given constraint.
That is, the function value of the resulting DD will be the same as the current ones for all assignments mapping to one in the constraint and may be different otherwise.
constraint | The constraint to use for the operation. |
std::vector< Bdd< LibraryType > > storm::dd::Bdd< LibraryType >::split | ( | std::set< storm::expressions::Variable > const & | variables | ) | const |
Bdd< LibraryType > storm::dd::Bdd< LibraryType >::swapVariables | ( | std::vector< std::pair< storm::expressions::Variable, storm::expressions::Variable > > const & | metaVariablePairs | ) | const |
Swaps the given pairs of meta variables in the BDD.
The pairs of meta variables must be guaranteed to have the same number of underlying BDD variables.
metaVariablePairs | A vector of meta variable pairs that are to be swapped for one another. |
template Add< DdType::Sylvan, uint_fast64_t > storm::dd::Bdd< LibraryType >::toAdd | ( | ) | const |
std::pair< std::vector< storm::expressions::Expression >, std::unordered_map< uint_fast64_t, storm::expressions::Variable > > storm::dd::Bdd< LibraryType >::toExpression | ( | storm::expressions::ExpressionManager & | manager | ) | const |
Translates the function the BDD is representing to a set of expressions that characterize the function.
manager | The manager that is used to build the expression and, in particular, create new variables in. |
storm::storage::BitVector storm::dd::Bdd< LibraryType >::toVector | ( | storm::dd::Odd const & | rowOdd | ) | const |
Bdd< LibraryType > storm::dd::Bdd< LibraryType >::universalAbstract | ( | std::set< storm::expressions::Variable > const & | metaVariables | ) | const |
|
friend |
|
friend |