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