Storm 1.11.1.1
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
DdManager.cpp
Go to the documentation of this file.
2
3#include <cmath>
4
11
12namespace storm {
13namespace dd {
14template<DdType LibraryType>
15DdManager<LibraryType>::DdManager() : internalDdManager(), metaVariableMap(), manager(new storm::expressions::ExpressionManager()) {
16 // Intentionally left empty.
17}
18
19template<DdType LibraryType>
20std::shared_ptr<DdManager<LibraryType>> DdManager<LibraryType>::asSharedPointer() {
21 return this->shared_from_this();
22}
23
24template<DdType LibraryType>
25std::shared_ptr<DdManager<LibraryType> const> DdManager<LibraryType>::asSharedPointer() const {
26 return this->shared_from_this();
27}
28
29template<DdType LibraryType>
31 return Bdd<LibraryType>(*this, internalDdManager.getBddOne());
32}
33
34template<DdType LibraryType>
35template<typename ValueType>
37 return Add<LibraryType, ValueType>(*this, internalDdManager.template getAddOne<ValueType>());
38}
39
40template<DdType LibraryType>
42 return Bdd<LibraryType>(*this, internalDdManager.getBddZero());
45template<DdType LibraryType>
46template<typename ValueType>
48 return Add<LibraryType, ValueType>(*this, internalDdManager.template getAddZero<ValueType>());
49}
50
51template<DdType LibraryType>
52template<typename ValueType>
54 return Add<LibraryType, ValueType>(*this, internalDdManager.template getAddUndefined<ValueType>());
55}
56
57template<DdType LibraryType>
58template<typename ValueType>
60 return getConstant(storm::utility::infinity<ValueType>());
61}
62
63template<DdType LibraryType>
64template<typename ValueType>
66 return Add<LibraryType, ValueType>(*this, internalDdManager.getConstant(value));
67}
68
69template<DdType LibraryType>
70Bdd<LibraryType> DdManager<LibraryType>::getEncoding(storm::expressions::Variable const& variable, int_fast64_t value, bool mostSignificantBitAtTop) const {
71 DdMetaVariable<LibraryType> const& metaVariable = this->getMetaVariable(variable);
72
73 STORM_LOG_THROW(metaVariable.canRepresent(value), storm::exceptions::InvalidArgumentException,
74 "Illegal value " << value << " for meta variable '" << variable.getName() << "'.");
75
76 // Now compute the encoding relative to the low value of the meta variable.
77 value -= metaVariable.getLow();
78
79 std::vector<Bdd<LibraryType>> const& ddVariables = metaVariable.getDdVariables();
80
81 Bdd<LibraryType> result;
82 if (mostSignificantBitAtTop) {
83 if (value & (1ull << (ddVariables.size() - 1))) {
84 result = ddVariables[0];
85 } else {
86 result = !ddVariables[0];
87 }
88
89 for (std::size_t i = 1; i < ddVariables.size(); ++i) {
90 if (value & (1ull << (ddVariables.size() - i - 1))) {
91 result &= ddVariables[i];
92 } else {
93 result &= !ddVariables[i];
94 }
95 }
96 } else {
97 if (value & 1ull) {
98 result = ddVariables[0];
99 } else {
100 result = !ddVariables[0];
101 }
102 value >>= 1;
103
104 for (std::size_t i = 1; i < ddVariables.size(); ++i) {
105 if (value & 1ull) {
106 result &= ddVariables[i];
107 } else {
108 result &= !ddVariables[i];
109 }
110 value >>= 1;
112 }
113
114 return result;
115}
116
117template<DdType LibraryType>
119 storm::dd::DdMetaVariable<LibraryType> const& metaVariable = this->getMetaVariable(variable);
121 if (metaVariable.hasHigh()) {
122 return Bdd<LibraryType>(*this,
123 internalDdManager.getBddEncodingLessOrEqualThan(static_cast<uint64_t>(metaVariable.getHigh() - metaVariable.getLow()),
124 metaVariable.getCube().getInternalBdd(), metaVariable.getNumberOfDdVariables()),
125 {variable});
126 } else {
127 // If there is no upper bound on this variable, the whole range is valid.
128 Bdd<LibraryType> result = this->getBddOne();
129 result.addMetaVariable(variable);
130 return result;
131 }
132}
133
134template<DdType LibraryType>
135template<typename ValueType>
137 storm::dd::DdMetaVariable<LibraryType> const& metaVariable = this->getMetaVariable(variable);
138 STORM_LOG_THROW(metaVariable.hasHigh(), storm::exceptions::InvalidOperationException, "Cannot create identity for meta variable.");
139
140 Add<LibraryType, ValueType> result = this->getAddZero<ValueType>();
141 for (int_fast64_t value = metaVariable.getLow(); value <= metaVariable.getHigh(); ++value) {
142 result += this->getEncoding(variable, value).template toAdd<ValueType>() * this->getConstant(storm::utility::convertNumber<ValueType>(value));
143 }
144 return result;
145}
146
147template<DdType LibraryType>
148Bdd<LibraryType> DdManager<LibraryType>::getIdentity(std::vector<std::pair<storm::expressions::Variable, storm::expressions::Variable>> const& variablePairs,
149 bool restrictToFirstRange) const {
150 auto result = this->getBddOne();
151 for (auto const& pair : variablePairs) {
152 result &= this->getIdentity(pair.first, pair.second, restrictToFirstRange);
153 }
154 return result;
155}
157template<DdType LibraryType>
159 bool restrictToFirstRange) const {
160 auto const& firstMetaVariable = this->getMetaVariable(first);
161 auto const& secondMetaVariable = this->getMetaVariable(second);
162
163 STORM_LOG_THROW(firstMetaVariable.getNumberOfDdVariables() == secondMetaVariable.getNumberOfDdVariables(), storm::exceptions::InvalidOperationException,
164 "Mismatching sizes of meta variables.");
165
166 auto const& firstDdVariables = firstMetaVariable.getDdVariables();
167 auto const& secondDdVariables = secondMetaVariable.getDdVariables();
168
169 auto result = restrictToFirstRange ? this->getRange(first) : this->getBddOne();
170 for (auto it1 = firstDdVariables.begin(), it2 = secondDdVariables.begin(), ite1 = firstDdVariables.end(); it1 != ite1; ++it1, ++it2) {
171 result &= it1->iff(*it2);
172 }
174 return result;
175}
176
177#pragma GCC diagnostic push
178#pragma GCC diagnostic ignored "-Winfinite-recursion"
179template<DdType LibraryType>
181 return getCube({variable});
182}
183#pragma GCC diagnostic pop
184
185template<DdType LibraryType>
186Bdd<LibraryType> DdManager<LibraryType>::getCube(std::set<storm::expressions::Variable> const& variables) const {
187 Bdd<LibraryType> result = this->getBddOne();
188 for (auto const& variable : variables) {
189 storm::dd::DdMetaVariable<LibraryType> const& metaVariable = this->getMetaVariable(variable);
190 result &= metaVariable.getCube();
191 }
192 return result;
194
195template<DdType LibraryType>
196std::vector<storm::expressions::Variable> DdManager<LibraryType>::cloneVariable(storm::expressions::Variable const& variable,
197 std::string const& newMetaVariableName,
198 boost::optional<uint64_t> const& numberOfLayers) {
199 std::vector<storm::expressions::Variable> newMetaVariables;
200 auto const& ddMetaVariable = this->getMetaVariable(variable);
201 if (ddMetaVariable.getType() == storm::dd::MetaVariableType::Bool) {
202 newMetaVariables = this->addMetaVariable(newMetaVariableName, 3);
203 } else if (ddMetaVariable.getType() == storm::dd::MetaVariableType::Int) {
204 newMetaVariables = this->addMetaVariable(newMetaVariableName, ddMetaVariable.getLow(), ddMetaVariable.getHigh(), 3);
205 } else if (ddMetaVariable.getType() == storm::dd::MetaVariableType::BitVector) {
206 newMetaVariables = this->addBitVectorMetaVariable(newMetaVariableName, ddMetaVariable.getNumberOfDdVariables(), 3);
207 }
208 return newMetaVariables;
209}
210
211template<DdType LibraryType>
212std::pair<storm::expressions::Variable, storm::expressions::Variable> DdManager<LibraryType>::addMetaVariable(
213 std::string const& name, int_fast64_t low, int_fast64_t high,
214 boost::optional<std::pair<MetaVariablePosition, storm::expressions::Variable>> const& position) {
215 std::vector<storm::expressions::Variable> result = addMetaVariable(name, low, high, 2, position);
216 return std::make_pair(result[0], result[1]);
217}
218
219template<DdType LibraryType>
220std::vector<storm::expressions::Variable> DdManager<LibraryType>::addMetaVariable(
221 std::string const& name, int_fast64_t low, int_fast64_t high, uint64_t numberOfLayers,
222 boost::optional<std::pair<MetaVariablePosition, storm::expressions::Variable>> const& position) {
223 return this->addMetaVariableHelper(MetaVariableType::Int, name,
224 std::max(static_cast<uint64_t>(std::ceil(std::log2(high - low + 1))), static_cast<uint64_t>(1)), numberOfLayers,
225 position, std::make_pair(low, high));
226}
227
228template<DdType LibraryType>
229std::vector<storm::expressions::Variable> DdManager<LibraryType>::addBitVectorMetaVariable(
230 std::string const& variableName, uint64_t bits, uint64_t numberOfLayers,
231 boost::optional<std::pair<MetaVariablePosition, storm::expressions::Variable>> const& position) {
232 return this->addMetaVariableHelper(MetaVariableType::BitVector, variableName, bits, numberOfLayers, position);
233}
234
235template<DdType LibraryType>
236std::pair<storm::expressions::Variable, storm::expressions::Variable> DdManager<LibraryType>::addMetaVariable(
237 std::string const& name, boost::optional<std::pair<MetaVariablePosition, storm::expressions::Variable>> const& position) {
238 std::vector<storm::expressions::Variable> result = this->addMetaVariableHelper(MetaVariableType::Bool, name, 1, 2, position);
239 return std::make_pair(result[0], result[1]);
240}
241
242template<DdType LibraryType>
243std::vector<storm::expressions::Variable> DdManager<LibraryType>::addMetaVariable(
244 std::string const& name, uint64_t numberOfLayers, boost::optional<std::pair<MetaVariablePosition, storm::expressions::Variable>> const& position) {
245 return this->addMetaVariableHelper(MetaVariableType::Bool, name, 1, numberOfLayers, position);
246}
247
248template<DdType LibraryType>
249std::vector<storm::expressions::Variable> DdManager<LibraryType>::addMetaVariableHelper(
250 MetaVariableType const& type, std::string const& name, uint64_t numberOfDdVariables, uint64_t numberOfLayers,
251 boost::optional<std::pair<MetaVariablePosition, storm::expressions::Variable>> const& position,
252 boost::optional<std::pair<int_fast64_t, int_fast64_t>> const& bounds) {
253 // Check whether number of layers is legal.
254 STORM_LOG_THROW(numberOfLayers >= 1, storm::exceptions::InvalidArgumentException, "Layers must be at least 1.");
255
256 // Check that the number of DD variables is legal.
257 STORM_LOG_THROW(numberOfDdVariables >= 1, storm::exceptions::InvalidArgumentException, "Illegal number of DD variables.");
258
259 // Check whether the variable name is legal.
260 STORM_LOG_THROW(name != "" && name.back() != '\'', storm::exceptions::InvalidArgumentException, "Illegal name of meta variable: '" << name << "'.");
262 // Check whether a meta variable already exists.
263 STORM_LOG_THROW(!this->hasMetaVariable(name), storm::exceptions::InvalidArgumentException, "A meta variable '" << name << "' already exists.");
264
265 // If a specific position was requested, we compute it now.
266 boost::optional<uint_fast64_t> level;
267 if (position) {
268 storm::dd::DdMetaVariable<LibraryType> beforeVariable = this->getMetaVariable(position.get().second);
269 level = position.get().first == MetaVariablePosition::Above ? std::numeric_limits<uint_fast64_t>::max() : std::numeric_limits<uint_fast64_t>::min();
270 for (auto const& ddVariable : beforeVariable.getDdVariables()) {
271 level = position.get().first == MetaVariablePosition::Above ? std::min(level.get(), ddVariable.getLevel())
272 : std::max(level.get(), ddVariable.getLevel());
273 }
274 if (position.get().first == MetaVariablePosition::Below) {
275 ++level.get();
276 }
277 }
278
279 STORM_LOG_TRACE("Creating meta variable with " << numberOfDdVariables << " bit(s) and " << numberOfLayers << " layer(s).");
281 std::stringstream tmp1;
282 std::vector<storm::expressions::Variable> result;
283 for (uint64_t layer = 0; layer < numberOfLayers; ++layer) {
284 if (type == MetaVariableType::Int) {
285 result.emplace_back(manager->declareIntegerVariable(name + tmp1.str()));
286 } else if (type == MetaVariableType::Bool) {
287 result.emplace_back(manager->declareBooleanVariable(name + tmp1.str()));
288 } else if (type == MetaVariableType::BitVector) {
289 result.emplace_back(manager->declareBitVectorVariable(name + tmp1.str(), numberOfDdVariables));
290 }
291 tmp1 << "'";
292 }
293
294 std::vector<std::vector<Bdd<LibraryType>>> variables(numberOfLayers);
295 for (std::size_t i = 0; i < numberOfDdVariables; ++i) {
296 std::vector<InternalBdd<LibraryType>> ddVariables = internalDdManager.createDdVariables(numberOfLayers, level);
297 for (uint64_t layer = 0; layer < numberOfLayers; ++layer) {
298 variables[layer].emplace_back(Bdd<LibraryType>(*this, ddVariables[layer], {result[layer]}));
299 }
300
301 // If we are inserting the variable at a specific level, we need to prepare the level for the next pair
302 // of variables.
303 if (level) {
304 level.get() += numberOfLayers;
305 }
306 }
307
308 std::stringstream tmp2;
309 for (uint64_t layer = 0; layer < numberOfLayers; ++layer) {
310 if (bounds) {
311 metaVariableMap.emplace(result[layer], DdMetaVariable<LibraryType>(name + tmp2.str(), bounds.get().first, bounds.get().second, variables[layer]));
312 } else {
313 metaVariableMap.emplace(result[layer], DdMetaVariable<LibraryType>(type, name + tmp2.str(), variables[layer]));
314 }
315 tmp2 << "'";
316 }
318 return result;
319}
320
321template<DdType LibraryType>
323 auto const& variablePair = metaVariableMap.find(variable);
325 // Check whether the meta variable exists.
326 STORM_LOG_THROW(variablePair != metaVariableMap.end(), storm::exceptions::InvalidArgumentException,
327 "Unknown meta variable name '" << variable.getName() << "'.");
328
329 return variablePair->second;
330}
331
332template<DdType LibraryType>
334 std::set<std::string> result;
335 for (auto const& variablePair : metaVariableMap) {
336 result.insert(variablePair.first.getName());
337 }
338 return result;
340
341template<DdType LibraryType>
343 return this->metaVariableMap.size();
344}
345
346template<DdType LibraryType>
347bool DdManager<LibraryType>::hasMetaVariable(std::string const& metaVariableName) const {
348 return manager->hasVariable(metaVariableName);
349}
350
351template<DdType LibraryType>
353 // Check whether the meta variable exists.
354 STORM_LOG_THROW(hasMetaVariable(metaVariableName), storm::exceptions::InvalidArgumentException, "Unknown meta variable name '" << metaVariableName << "'.");
355
356 return manager->getVariable(metaVariableName);
357}
358
359template<DdType LibraryType>
361 return internalDdManager.supportsOrderedInsertion();
362}
363
364template<DdType LibraryType>
366 return *manager;
367}
368
369template<DdType LibraryType>
370storm::expressions::ExpressionManager& DdManager<LibraryType>::getExpressionManager() {
371 return *manager;
372}
373
374template<DdType LibraryType>
375std::vector<std::string> DdManager<LibraryType>::getDdVariableNames() const {
376 // First, we initialize a list DD variables and their names.
377 std::vector<std::pair<uint_fast64_t, std::string>> variablePairs;
378 for (auto const& variablePair : this->metaVariableMap) {
379 DdMetaVariable<LibraryType> const& metaVariable = variablePair.second;
380 // If the meta variable is of type bool, we don't need to suffix it with the bit number.
381 if (metaVariable.getType() == MetaVariableType::Bool) {
382 variablePairs.emplace_back(metaVariable.getDdVariables().front().getIndex(), variablePair.first.getName());
383 } else {
384 // For integer-valued meta variables, we, however, have to add the suffix.
385 for (uint_fast64_t variableIndex = 0; variableIndex < metaVariable.getNumberOfDdVariables(); ++variableIndex) {
386 variablePairs.emplace_back(metaVariable.getDdVariables()[variableIndex].getIndex(),
387 variablePair.first.getName() + '.' + std::to_string(variableIndex));
388 }
389 }
390 }
391
392 // Then, we sort this list according to the indices of the ADDs.
393 std::sort(variablePairs.begin(), variablePairs.end(),
394 [](std::pair<uint_fast64_t, std::string> const& a, std::pair<uint_fast64_t, std::string> const& b) { return a.first < b.first; });
395
396 // Now, we project the sorted vector to its second component.
397 std::vector<std::string> result;
398 for (auto const& element : variablePairs) {
399 result.push_back(element.second);
400 }
401
402 return result;
403}
404
405template<DdType LibraryType>
406std::vector<storm::expressions::Variable> DdManager<LibraryType>::getDdVariables() const {
407 // First, we initialize a list DD variables and their names.
408 std::vector<std::pair<uint_fast64_t, storm::expressions::Variable>> variablePairs;
409 for (auto const& variablePair : this->metaVariableMap) {
410 DdMetaVariable<LibraryType> const& metaVariable = variablePair.second;
411 // If the meta variable is of type bool, we don't need to suffix it with the bit number.
412 if (metaVariable.getType() == MetaVariableType::Bool) {
413 variablePairs.emplace_back(metaVariable.getDdVariables().front().getIndex(), variablePair.first);
414 } else {
415 // For integer-valued meta variables, we, however, have to add the suffix.
416 for (uint_fast64_t variableIndex = 0; variableIndex < metaVariable.getNumberOfDdVariables(); ++variableIndex) {
417 variablePairs.emplace_back(metaVariable.getDdVariables()[variableIndex].getIndex(), variablePair.first);
418 }
419 }
420 }
421
422 // Then, we sort this list according to the indices of the ADDs.
423 std::sort(variablePairs.begin(), variablePairs.end(),
424 [](std::pair<uint_fast64_t, storm::expressions::Variable> const& a, std::pair<uint_fast64_t, storm::expressions::Variable> const& b) {
425 return a.first < b.first;
426 });
427
428 // Now, we project the sorted vector to its second component.
429 std::vector<storm::expressions::Variable> result;
430 for (auto const& element : variablePairs) {
431 result.push_back(element.second);
432 }
433
434 return result;
435}
436
437template<DdType LibraryType>
439 internalDdManager.allowDynamicReordering(value);
440}
441
442template<DdType LibraryType>
444 return internalDdManager.isDynamicReorderingAllowed();
445}
446
447template<DdType LibraryType>
449 internalDdManager.triggerReordering();
450}
451
452template<DdType LibraryType>
453std::set<storm::expressions::Variable> DdManager<LibraryType>::getAllMetaVariables() const {
454 std::set<storm::expressions::Variable> result;
455 for (auto const& variable : this->metaVariableMap) {
456 result.insert(variable.first);
457 }
458 return result;
459}
460
461template<DdType LibraryType>
462std::vector<uint_fast64_t> DdManager<LibraryType>::getSortedVariableIndices() const {
463 return this->getSortedVariableIndices(this->getAllMetaVariables());
464}
465
466template<DdType LibraryType>
467std::vector<uint_fast64_t> DdManager<LibraryType>::getSortedVariableIndices(std::set<storm::expressions::Variable> const& metaVariables) const {
468 std::vector<uint_fast64_t> ddVariableIndices;
469 for (auto const& metaVariable : metaVariables) {
470 for (auto const& ddVariable : metaVariableMap.at(metaVariable).getDdVariables()) {
471 ddVariableIndices.push_back(ddVariable.getIndex());
472 }
473 }
474
475 // Next, we need to sort them, since they may be arbitrarily ordered otherwise.
476 std::ranges::sort(ddVariableIndices);
477 return ddVariableIndices;
478}
479
480template<DdType LibraryType>
484
485template<DdType LibraryType>
487 return internalDdManager;
488}
489
490template<DdType LibraryType>
492 return &internalDdManager;
493}
494
495template<DdType LibraryType>
496InternalDdManager<LibraryType> const* DdManager<LibraryType>::getInternalDdManagerPointer() const {
497 return &internalDdManager;
498}
499
500template<DdType LibraryType>
502 internalDdManager.debugCheck();
503}
504
505template<DdType LibraryType>
506void DdManager<LibraryType>::execute(std::function<void()> const& f) const {
507 internalDdManager.execute(f);
508}
509
510template class DdManager<DdType::CUDD>;
511
515
519
522
523template Add<DdType::CUDD, double> DdManager<DdType::CUDD>::getConstant(double const& value) const;
524template Add<DdType::CUDD, uint_fast64_t> DdManager<DdType::CUDD>::getConstant(uint_fast64_t const& value) const;
525template Add<DdType::CUDD, storm::RationalNumber> DdManager<DdType::CUDD>::getConstant(storm::RationalNumber const& value) const;
526
529
530template class DdManager<DdType::Sylvan>;
531
536
541
546
551
553template Add<DdType::Sylvan, uint_fast64_t> DdManager<DdType::Sylvan>::getConstant(uint_fast64_t const& value) const;
554template Add<DdType::Sylvan, storm::RationalNumber> DdManager<DdType::Sylvan>::getConstant(storm::RationalNumber const& value) const;
556
561} // namespace dd
562} // namespace storm
void addMetaVariable(storm::expressions::Variable const &metaVariable)
Adds the given meta variable to the set of meta variables that are contained in this DD.
Definition Dd.cpp:51
storm::expressions::Variable getMetaVariable(std::string const &variableName) const
Retrieves the given meta variable by name.
Add< LibraryType, ValueType > getAddOne() const
Retrieves an ADD representing the constant one function.
Definition DdManager.cpp:36
bool hasMetaVariable(std::string const &variableName) const
Retrieves whether the given meta variable name is already in use.
std::shared_ptr< DdManager< LibraryType > > asSharedPointer()
Definition DdManager.cpp:20
Add< LibraryType, ValueType > getAddZero() const
Retrieves an ADD representing the constant zero function.
Definition DdManager.cpp:47
std::vector< uint_fast64_t > getSortedVariableIndices() const
Retrieves the (sorted) list of the variable indices of the DD variables given by the meta variable se...
std::set< storm::expressions::Variable > getAllMetaVariables() const
Retrieves the set of meta variables contained in the DD.
InternalDdManager< LibraryType > & getInternalDdManager()
Retrieves the internal DD manager.
Bdd< LibraryType > getCube(storm::expressions::Variable const &variable) const
Retrieves a BDD that is the cube of the variables representing the given meta variable.
Add< LibraryType, ValueType > getInfinity() const
Retrieves an ADD representing the constant infinity function.
Definition DdManager.cpp:59
void execute(std::function< void()> const &f) const
All code that manipulates DDs shall be called through this function.
Bdd< LibraryType > getBddOne() const
Retrieves a BDD representing the constant one function.
Definition DdManager.cpp:30
DdManager()
Creates an empty manager without any meta variables.
Definition DdManager.cpp:15
std::set< std::string > getAllMetaVariableNames() const
Retrieves the names of all meta variables that have been added to the manager.
Bdd< LibraryType > getBddZero() const
Retrieves a BDD representing the constant zero function.
Definition DdManager.cpp:41
void triggerReordering()
Triggers a reordering of the DDs managed by this manager (if supported).
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 e...
Definition DdManager.cpp:70
bool isDynamicReorderingAllowed() const
Retrieves whether dynamic reordering is currently allowed (if supported).
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.
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 lega...
Add< LibraryType, ValueType > getAddUndefined() const
Retrieves an ADD representing an undefined value.
Definition DdManager.cpp:53
bool supportsOrderedInsertion() const
Checks whether this manager supports the ordered insertion of variables, i.e.
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 v...
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).
Add< LibraryType, ValueType > getConstant(ValueType const &value) const
Retrieves an ADD representing the constant function with the given value.
Definition DdManager.cpp:65
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.
void allowDynamicReordering(bool value)
Sets whether dynamic reordering is allowed for the DDs managed by this manager (if supported).
void debugCheck() const
Performs a debug check if available.
std::size_t getNumberOfMetaVariables() const
Retrieves the number of meta variables that are contained in this manager.
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::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.
Bdd< LibraryType > const & getCube() const
Retrieves the cube of all variables that encode this meta variable.
This class is responsible for managing a set of typed variables and all expressions using these varia...
std::string const & getName() const
Retrieves the name of the variable.
Definition Variable.cpp:46
#define STORM_LOG_TRACE(message)
Definition logging.h:12
#define STORM_LOG_THROW(cond, exception, message)
Definition macros.h:30