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