13#ifdef STORM_HAVE_SYLVAN
14#pragma GCC diagnostic push
15#pragma GCC diagnostic ignored "-Wpedantic"
16#pragma clang diagnostic push
17#pragma clang diagnostic ignored "-Wc99-extensions"
18#pragma clang diagnostic ignored "-Wused-but-marked-unused"
19#pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant"
20#pragma clang diagnostic ignored "-Wzero-length-array"
23VOID_TASK_0(gc_start) {
32VOID_TASK_2(execute_sylvan, std::function<
void()>
const*, f, std::exception_ptr*, e) {
35 }
catch (std::exception&) {
36 *e = std::current_exception();
40#pragma clang diagnostic pop
41#pragma GCC diagnostic pop
50uint_fast64_t findLargestPowerOfTwoFitting(uint_fast64_t number) {
51 for (uint_fast64_t index = 0; index < 64; ++index) {
52 if ((number & (1ull << (63 - index))) != 0) {
60 if (numberOfInstances == 0) {
61 size_t const task_deque_size =
size_t{1024} * 1024;
63 lace_set_stacksize(
size_t{1024} * 1024 * 16);
68 sylvan_init_package();
70 sylvan::Sylvan::initBdd();
71 sylvan::Sylvan::initMtbdd();
72 sylvan::Sylvan::initCustomMtbdd();
75 sylvan_gc_hook_pregc(TASK(gc_start));
76 sylvan_gc_hook_postgc(TASK(gc_end));
87 if (numberOfInstances == 0) {
93 sylvan::Sylvan::quitPackage();
128 uint64_t numberOfDdVariables)
const {
129 return InternalBdd<DdType::Sylvan>(
this, sylvan::Bdd(this->getBddEncodingLessOrEqualThanRec(0, (1ull << numberOfDdVariables) - 1, bound,
130 cube.getSylvanBdd().GetBDD(), numberOfDdVariables)));
134 uint64_t remainingDdVariables)
const {
135 if (maximalValue <= bound) {
137 }
else if (minimalValue > bound) {
141 STORM_LOG_ASSERT(remainingDdVariables > 0,
"Expected more remaining DD variables.");
142 uint64_t newRemainingDdVariables = remainingDdVariables - 1;
144 getBddEncodingLessOrEqualThanRec(minimalValue, maximalValue & ~(1ull << newRemainingDdVariables), bound, sylvan_high(cube), newRemainingDdVariables);
145 bdd_refs_push(elseResult);
147 getBddEncodingLessOrEqualThanRec(minimalValue | (1ull << newRemainingDdVariables), maximalValue, bound, sylvan_high(cube), newRemainingDdVariables);
148 bdd_refs_push(elseResult);
149 BDD result = sylvan_makenode(sylvan_var(cube), elseResult, thenResult);
175template<
typename ValueType>
201 boost::optional<uint_fast64_t>
const& position) {
202 STORM_LOG_THROW(!position, storm::exceptions::NotSupportedException,
"The manager does not support ordered insertion.");
204 std::vector<InternalBdd<DdType::Sylvan>> result;
206 for (uint64_t layer = 0; layer < numberOfLayers; ++layer) {
208 ++nextFreeVariableIndex;
219 STORM_LOG_THROW(
false, storm::exceptions::NotSupportedException,
"Operation is not supported by sylvan.");
223 STORM_LOG_THROW(
false, storm::exceptions::NotSupportedException,
"Operation is not supported by sylvan.");
227 STORM_LOG_THROW(
false, storm::exceptions::NotSupportedException,
"Operation is not supported by sylvan.");
231 STORM_LOG_THROW(
false, storm::exceptions::NotSupportedException,
"Operation is not supported by sylvan.");
236 std::exception_ptr e =
nullptr;
240#pragma clang diagnostic push
241#pragma clang diagnostic ignored "-Wused-but-marked-unused"
242 RUN(execute_sylvan, &f, &e);
243#pragma clang diagnostic pop
248#pragma clang diagnostic push
249#pragma clang diagnostic ignored "-Wused-but-marked-unused"
250 RUN(execute_sylvan, &f, &e);
251#pragma clang diagnostic pop
254 std::rethrow_exception(e);
259 return nextFreeVariableIndex;
264 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
265 "version of Storm with Sylvan support.");
272 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
273 "version of Storm with Sylvan support.");
276template<
typename ValueType>
279 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
280 "version of Storm with Sylvan support.");
285 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
286 "version of Storm with Sylvan support.");
290 uint64_t numberOfDdVariables)
const {
292 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
293 "version of Storm with Sylvan support.");
296template<
typename ValueType>
299 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
300 "version of Storm with Sylvan support.");
303template<
typename ValueType>
306 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
307 "version of Storm with Sylvan support.");
310template<
typename ValueType>
313 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
314 "version of Storm with Sylvan support.");
318 boost::optional<uint_fast64_t>
const& position) {
320 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
321 "version of Storm with Sylvan support.");
326 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
327 "version of Storm with Sylvan support.");
332 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
333 "version of Storm with Sylvan support.");
338 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
339 "version of Storm with Sylvan support.");
344 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
345 "version of Storm with Sylvan support.");
350 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
351 "version of Storm with Sylvan support.");
356 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
357 "version of Storm with Sylvan support.");
362 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
363 "version of Storm with Sylvan support.");
367#ifndef STORM_HAVE_SYLVAN
uint64_t getMaximalMemory() const
Retrieves the maximal amount of memory (in megabytes) that Sylvan can occupy.
uint64_t getNumberOfThreads() const
Retrieves the number of threads used by Sylvan.
InternalDdManager(storm::SylvanDdManagerEnvironment const &environment)
Creates a new internal manager for Sylvan DDs.
#define STORM_LOG_TRACE(message)
#define STORM_LOG_ASSERT(cond, message)
#define STORM_LOG_THROW(cond, exception, message)
carl::RationalFunction< Polynomial, true > RationalFunction