Storm 1.11.1.1
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
DdMetaVariable.h
Go to the documentation of this file.
1#pragma once
2
3#include <vector>
4
7
8namespace storm {
9namespace dd {
10
11template<DdType LibraryType>
12class DdManager;
13
14template<DdType LibraryType, typename ValueTpe>
15class Add;
16
17// An enumeration for all legal types of meta variables.
19// An enum that expresses the relation of two meta variables relative to each other.
21
22// Declare DdMetaVariable class so we can then specialize it for the different DD types.
23template<DdType LibraryType>
25 public:
26 friend class DdManager<LibraryType>;
27 friend class Bdd<LibraryType>;
28
29 template<DdType LibraryTypePrime, typename ValueTypePrime>
30 friend class Add;
31
32 template<DdType LibraryTypePrime, typename ValueTypePrime>
33 friend class AddIterator;
34
40 std::string const& getName() const;
41
48
54 int_fast64_t getLow() const;
55
61 bool hasHigh() const;
62
68 int_fast64_t getHigh() const;
69
76 bool canRepresent(int_fast64_t value) const;
77
83 std::size_t getNumberOfDdVariables() const;
84
90 Bdd<LibraryType> const& getCube() const;
91
95 uint64_t getLowestIndex() const;
96
100 uint64_t getHighestLevel() const;
101
107 std::vector<uint64_t> getIndices(bool sortedByLevel = true) const;
108
112 std::vector<std::pair<uint64_t, uint64_t>> getIndicesAndLevels() const;
113
114 private:
123 DdMetaVariable(std::string const& name, int_fast64_t low, int_fast64_t high, std::vector<Bdd<LibraryType>> const& ddVariables);
124
131 DdMetaVariable(MetaVariableType const& type, std::string const& name, std::vector<Bdd<LibraryType>> const& ddVariables);
132
136 void precomputeLowestIndex();
137
143 std::vector<Bdd<LibraryType>> const& getDdVariables() const;
144
148 void createCube();
149
150 // The name of the meta variable.
151 std::string name;
152
153 // The type of the variable.
154 MetaVariableType type;
155
156 // The lowest value of the range of the variable.
157 int_fast64_t low;
158
159 // The highest value of the range of the variable.
160 boost::optional<int_fast64_t> high;
161
162 // The vector of variables that are used to encode the meta variable.
163 std::vector<Bdd<LibraryType>> ddVariables;
164
165 // The cube consisting of all variables that encode the meta variable.
166 Bdd<LibraryType> cube;
167
168 // The lowest index of any DD variable of this meta variable.
169 uint64_t lowestIndex;
170};
171} // namespace dd
172} // namespace storm
bool hasHigh() const
Retrieves whether the variable has an upper bound.
int_fast64_t getLow() const
Retrieves the lowest value of the range of the variable.
std::vector< std::pair< uint64_t, uint64_t > > getIndicesAndLevels() const
Retrieves the indices and levels of the DD variables associated with this meta variable.
std::string const & getName() const
Retrieves the name of the meta variable.
std::vector< uint64_t > getIndices(bool sortedByLevel=true) const
Retrieves the indices of the DD variables associated with this meta variable.
std::size_t getNumberOfDdVariables() const
Retrieves the number of DD variables for this meta variable.
bool canRepresent(int_fast64_t value) const
Retrieves whether the meta variable can represent the given value.
int_fast64_t getHigh() const
Retrieves the highest value of the range of the variable.
uint64_t getLowestIndex() const
Retrieves the highest index of all DD variables belonging to this meta variable.
MetaVariableType getType() const
Retrieves the type of the meta variable.
uint64_t getHighestLevel() const
Retrieves the highest level of all DD variables belonging to this meta variable.
Bdd< LibraryType > const & getCube() const
Retrieves the cube of all variables that encode this meta variable.