Storm
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
InternalSylvanDdManager.h
Go to the documentation of this file.
1#ifndef STORM_STORAGE_DD_SYLVAN_INTERNALSYLVANDDMANAGER_H_
2#define STORM_STORAGE_DD_SYLVAN_INTERNALSYLVANDDMANAGER_H_
3
4#include <boost/optional.hpp>
5
8
11
12#include "storm-config.h"
14
15namespace storm {
16namespace dd {
17template<DdType LibraryType, typename ValueType>
18class InternalAdd;
19
20template<DdType LibraryType>
21class InternalBdd;
22
23template<>
25 public:
26 friend class InternalBdd<DdType::Sylvan>;
27
28 template<DdType LibraryType, typename ValueType>
29 friend class InternalAdd;
30
35
40
46 InternalBdd<DdType::Sylvan> getBddOne() const;
47
53 template<typename ValueType>
54 InternalAdd<DdType::Sylvan, ValueType> getAddOne() const;
55
61 InternalBdd<DdType::Sylvan> getBddZero() const;
62
68 InternalBdd<DdType::Sylvan> getBddEncodingLessOrEqualThan(uint64_t bound, InternalBdd<DdType::Sylvan> const& cube, uint64_t numberOfDdVariables) const;
69
75 template<typename ValueType>
76 InternalAdd<DdType::Sylvan, ValueType> getAddZero() const;
77
83 template<typename ValueType>
84 InternalAdd<DdType::Sylvan, ValueType> getAddUndefined() const;
85
91 template<typename ValueType>
92 InternalAdd<DdType::Sylvan, ValueType> getConstant(ValueType const& value) const;
93
101 std::vector<InternalBdd<DdType::Sylvan>> createDdVariables(uint64_t numberOfLayers, boost::optional<uint_fast64_t> const& position = boost::none);
102
109 bool supportsOrderedInsertion() const;
110
116 void allowDynamicReordering(bool value);
117
123 bool isDynamicReorderingAllowed() const;
124
128 void triggerReordering();
129
133 void debugCheck() const;
134
143 void execute(std::function<void()> const& f) const;
144
150 uint_fast64_t getNumberOfDdVariables() const;
151
152 private:
153 // Helper function to create the BDD whose encodings are below a given bound.
154 BDD getBddEncodingLessOrEqualThanRec(uint64_t minimalValue, uint64_t maximalValue, uint64_t bound, BDD cube, uint64_t remainingDdVariables) const;
155
156 // A counter for the number of instances of this class. This is used to determine when to initialize and
157 // quit the sylvan. This is because Sylvan does not know the concept of managers but implicitly has a
158 // 'global' manager.
159 static uint_fast64_t numberOfInstances;
160
161 // Since the sylvan (more specifically: lace) processes do busy waiting, we suspend them as long as
162 // sylvan is not used. This flag keeps track of whether we are currently suspending.
163 static bool suspended;
164
165 // The index of the next free variable index. This needs to be shared across all instances since the sylvan
166 // manager is implicitly 'global'.
167 static uint_fast64_t nextFreeVariableIndex;
168};
169
170template<>
171InternalAdd<DdType::Sylvan, double> InternalDdManager<DdType::Sylvan>::getAddOne() const;
172
173template<>
174InternalAdd<DdType::Sylvan, uint_fast64_t> InternalDdManager<DdType::Sylvan>::getAddOne() const;
175
176#ifdef STORM_HAVE_CARL
177template<>
178InternalAdd<DdType::Sylvan, storm::RationalFunction> InternalDdManager<DdType::Sylvan>::getAddOne() const;
179#endif
180
181template<>
182InternalAdd<DdType::Sylvan, double> InternalDdManager<DdType::Sylvan>::getAddZero() const;
183
184template<>
185InternalAdd<DdType::Sylvan, uint_fast64_t> InternalDdManager<DdType::Sylvan>::getAddZero() const;
186
187#ifdef STORM_HAVE_CARL
188template<>
189InternalAdd<DdType::Sylvan, storm::RationalFunction> InternalDdManager<DdType::Sylvan>::getAddZero() const;
190#endif
191
192template<>
193InternalAdd<DdType::Sylvan, double> InternalDdManager<DdType::Sylvan>::getConstant(double const& value) const;
194
195template<>
196InternalAdd<DdType::Sylvan, uint_fast64_t> InternalDdManager<DdType::Sylvan>::getConstant(uint_fast64_t const& value) const;
197
198#ifdef STORM_HAVE_CARL
199template<>
200InternalAdd<DdType::Sylvan, storm::RationalFunction> InternalDdManager<DdType::Sylvan>::getConstant(storm::RationalFunction const& value) const;
201#endif
202} // namespace dd
203} // namespace storm
204
205#endif /* STORM_STORAGE_DD_SYLVAN_INTERNALSYLVANDDMANAGER_H_ */
LabParser.cpp.
Definition cli.cpp:18