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