Storm 1.11.1.1
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
InternalCuddDdManager.h
Go to the documentation of this file.
1#pragma once
2
3#include <boost/optional.hpp>
4#include <functional>
5
6#include "storm-config.h"
11
12#ifdef STORM_HAVE_CUDD
13#include "cuddObj.hh"
14#endif
15
16namespace storm {
17namespace dd {
18template<DdType LibraryType, typename ValueType>
19class InternalAdd;
20
21template<DdType LibraryType>
22class InternalBdd;
23
24template<>
26 public:
27 friend class InternalBdd<DdType::CUDD>;
28
29 template<DdType LibraryType, typename ValueType>
30 friend class InternalAdd;
31
36
41
47 InternalBdd<DdType::CUDD> getBddOne() const;
48
54 template<typename ValueType>
55 InternalAdd<DdType::CUDD, ValueType> getAddOne() const;
56
62 InternalBdd<DdType::CUDD> getBddZero() const;
63
69 InternalBdd<DdType::CUDD> getBddEncodingLessOrEqualThan(uint64_t bound, InternalBdd<DdType::CUDD> const& cube, uint64_t numberOfDdVariables) const;
70
76 template<typename ValueType>
77 InternalAdd<DdType::CUDD, ValueType> getAddZero() const;
78
84 template<typename ValueType>
85 InternalAdd<DdType::CUDD, ValueType> getAddUndefined() const;
86
92 template<typename ValueType>
93 InternalAdd<DdType::CUDD, ValueType> getConstant(ValueType const& value) const;
94
102 std::vector<InternalBdd<DdType::CUDD>> createDdVariables(uint64_t numberOfLayers, boost::optional<uint_fast64_t> const& position = boost::none);
103
110 bool supportsOrderedInsertion() const;
111
117 void allowDynamicReordering(bool value);
118
124 bool isDynamicReorderingAllowed() const;
125
129 void triggerReordering();
130
134 void debugCheck() const;
135
143 void execute(std::function<void()> const& f) const;
144
150 uint_fast64_t getNumberOfDdVariables() const;
151
152#ifdef STORM_HAVE_CUDD
158 cudd::Cudd& getCuddManager();
159
165 cudd::Cudd const& getCuddManager() const;
166#endif
167
168 private:
169#ifdef STORM_HAVE_CUDD
170 // Helper function to create the BDD whose encodings are below a given bound.
171 DdNodePtr getBddEncodingLessOrEqualThanRec(uint64_t minimalValue, uint64_t maximalValue, uint64_t bound, DdNodePtr cube,
172 uint64_t remainingDdVariables) const;
173
174 // The manager responsible for the DDs created/modified with this DdManager.
175 cudd::Cudd cuddManager;
176
177 // The technique that is used for dynamic reordering.
178 Cudd_ReorderingType reorderingTechnique;
179
180 // Keeps track of the number of registered DD variables.
181 uint_fast64_t numberOfDdVariables;
182#endif
183};
184} // namespace dd
185} // namespace storm