15#ifdef STORM_HAVE_SYLVAN
17#pragma clang diagnostic push
18#pragma clang diagnostic ignored "-Wzero-length-array"
19#pragma clang diagnostic ignored "-Wc99-extensions"
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();
41#pragma clang diagnostic pop
51uint_fast64_t findLargestPowerOfTwoFitting(uint_fast64_t number) {
52 for (uint_fast64_t index = 0; index < 64; ++index) {
53 if ((number & (1ull << (63 - index))) != 0) {
61 if (numberOfInstances == 0) {
63 size_t const task_deque_size = 1024 * 1024;
65 lace_set_stacksize(1024 * 1024 * 16);
70 sylvan_init_package();
72 sylvan::Sylvan::initBdd();
73 sylvan::Sylvan::initMtbdd();
74 sylvan::Sylvan::initCustomMtbdd();
77 sylvan_gc_hook_pregc(TASK(gc_start));
78 sylvan_gc_hook_postgc(TASK(gc_end));
89 if (numberOfInstances == 0) {
95 sylvan::Sylvan::quitPackage();
130 uint64_t numberOfDdVariables)
const {
131 return InternalBdd<DdType::Sylvan>(
this, sylvan::Bdd(this->getBddEncodingLessOrEqualThanRec(0, (1ull << numberOfDdVariables) - 1, bound,
132 cube.getSylvanBdd().GetBDD(), numberOfDdVariables)));
136 uint64_t remainingDdVariables)
const {
137 if (maximalValue <= bound) {
139 }
else if (minimalValue > bound) {
143 STORM_LOG_ASSERT(remainingDdVariables > 0,
"Expected more remaining DD variables.");
144 uint64_t newRemainingDdVariables = remainingDdVariables - 1;
146 getBddEncodingLessOrEqualThanRec(minimalValue, maximalValue & ~(1ull << newRemainingDdVariables), bound, sylvan_high(cube), newRemainingDdVariables);
147 bdd_refs_push(elseResult);
149 getBddEncodingLessOrEqualThanRec(minimalValue | (1ull << newRemainingDdVariables), maximalValue, bound, sylvan_high(cube), newRemainingDdVariables);
150 bdd_refs_push(elseResult);
151 BDD result = sylvan_makenode(sylvan_var(cube), elseResult, thenResult);
177template<
typename ValueType>
203 boost::optional<uint_fast64_t>
const& position) {
204 STORM_LOG_THROW(!position, storm::exceptions::NotSupportedException,
"The manager does not support ordered insertion.");
206 std::vector<InternalBdd<DdType::Sylvan>> result;
208 for (uint64_t layer = 0; layer < numberOfLayers; ++layer) {
210 ++nextFreeVariableIndex;
221 STORM_LOG_THROW(
false, storm::exceptions::NotSupportedException,
"Operation is not supported by sylvan.");
225 STORM_LOG_THROW(
false, storm::exceptions::NotSupportedException,
"Operation is not supported by sylvan.");
229 STORM_LOG_THROW(
false, storm::exceptions::NotSupportedException,
"Operation is not supported by sylvan.");
233 STORM_LOG_THROW(
false, storm::exceptions::NotSupportedException,
"Operation is not supported by sylvan.");
238 std::exception_ptr e =
nullptr;
242 RUN(execute_sylvan, &f, &e);
247 RUN(execute_sylvan, &f, &e);
250 std::rethrow_exception(e);
255 return nextFreeVariableIndex;
260 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
261 "version of Storm with Sylvan support.");
268 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
269 "version of Storm with Sylvan support.");
272template<
typename ValueType>
275 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
276 "version of Storm with Sylvan support.");
281 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
282 "version of Storm with Sylvan support.");
286 uint64_t numberOfDdVariables)
const {
288 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
289 "version of Storm with Sylvan support.");
292template<
typename ValueType>
295 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
296 "version of Storm with Sylvan support.");
299template<
typename ValueType>
302 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
303 "version of Storm with Sylvan support.");
306template<
typename ValueType>
309 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
310 "version of Storm with Sylvan support.");
314 boost::optional<uint_fast64_t>
const& position) {
316 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
317 "version of Storm with Sylvan support.");
322 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
323 "version of Storm with Sylvan support.");
328 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
329 "version of Storm with Sylvan support.");
334 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
335 "version of Storm with Sylvan support.");
340 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
341 "version of Storm with Sylvan support.");
346 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
347 "version of Storm with Sylvan support.");
352 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
353 "version of Storm with Sylvan support.");
358 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
359 "version of Storm with Sylvan support.");
363#ifndef STORM_HAVE_SYLVAN
InternalDdManager()
Creates a new internal manager for Sylvan DDs.
uint64_t getNumberOfThreads() const
Retrieves the amount of threads available to Sylvan.
#define STORM_LOG_TRACE(message)
#define STORM_LOG_ASSERT(cond, message)
#define STORM_LOG_THROW(cond, exception, message)
SettingsType const & getModule()
Get module.
carl::RationalFunction< Polynomial, true > RationalFunction