Storm 1.11.1.1
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
InternalSylvanDdManager.h
Go to the documentation of this file.
1#pragma once
2
3#include <boost/optional.hpp>
4
5#include "storm-config.h"
11
12namespace storm {
13namespace dd {
14template<DdType LibraryType, typename ValueType>
15class InternalAdd;
16
17template<DdType LibraryType>
18class InternalBdd;
19
20template<>
22 public:
23 friend class InternalBdd<DdType::Sylvan>;
24
25 template<DdType LibraryType, typename ValueType>
26 friend class InternalAdd;
27
32
37
43 InternalBdd<DdType::Sylvan> getBddOne() const;
44
50 template<typename ValueType>
51 InternalAdd<DdType::Sylvan, ValueType> getAddOne() const;
52
58 InternalBdd<DdType::Sylvan> getBddZero() const;
59
65 InternalBdd<DdType::Sylvan> getBddEncodingLessOrEqualThan(uint64_t bound, InternalBdd<DdType::Sylvan> const& cube, uint64_t numberOfDdVariables) const;
66
72 template<typename ValueType>
73 InternalAdd<DdType::Sylvan, ValueType> getAddZero() const;
74
80 template<typename ValueType>
81 InternalAdd<DdType::Sylvan, ValueType> getAddUndefined() const;
82
88 template<typename ValueType>
89 InternalAdd<DdType::Sylvan, ValueType> getConstant(ValueType const& value) const;
90
98 std::vector<InternalBdd<DdType::Sylvan>> createDdVariables(uint64_t numberOfLayers, boost::optional<uint_fast64_t> const& position = boost::none);
99
106 bool supportsOrderedInsertion() const;
107
113 void allowDynamicReordering(bool value);
114
120 bool isDynamicReorderingAllowed() const;
121
125 void triggerReordering();
126
130 void debugCheck() const;
131
140 void execute(std::function<void()> const& f) const;
141
147 uint_fast64_t getNumberOfDdVariables() const;
148
149 private:
150#ifdef STORM_HAVE_SYLVAN
151
152 // Helper function to create the BDD whose encodings are below a given bound.
153 BDD getBddEncodingLessOrEqualThanRec(uint64_t minimalValue, uint64_t maximalValue, uint64_t bound, BDD cube, uint64_t remainingDdVariables) const;
154
155 // A counter for the number of instances of this class. This is used to determine when to initialize and
156 // quit the sylvan. This is because Sylvan does not know the concept of managers but implicitly has a
157 // 'global' manager.
158 static uint_fast64_t numberOfInstances;
159
160 // Since the sylvan (more specifically: lace) processes do busy waiting, we suspend them as long as
161 // sylvan is not used. This flag keeps track of whether we are currently suspending.
162 static bool suspended;
163
164 // The index of the next free variable index. This needs to be shared across all instances since the sylvan
165 // manager is implicitly 'global'.
166 static uint_fast64_t nextFreeVariableIndex;
167#endif
168};
169
170} // namespace dd
171} // namespace storm