18#ifdef STORM_HAVE_SYLVAN
19template<
typename ValueType>
24template<
typename ValueType>
25InternalAdd<DdType::Sylvan, ValueType>::InternalAdd(InternalDdManager<DdType::Sylvan>
const* ddManager, sylvan::Mtbdd
const& sylvanMtbdd)
26 : ddManager(ddManager), sylvanMtbdd(sylvanMtbdd) {
30template<
typename ValueType>
31ValueType InternalAdd<DdType::Sylvan, ValueType>::getValue(MTBDD
const& node) {
32 STORM_LOG_ASSERT(mtbdd_isleaf(node),
"Expected leaf, but got variable " << mtbdd_getvar(node) <<
".");
34 bool negated = mtbdd_hascomp(node);
35 MTBDD n = mtbdd_regular(node);
37 if (std::is_same<ValueType, double>::value) {
39 return negated ? -mtbdd_getdouble(n) : mtbdd_getdouble(n);
40 }
else if (std::is_same<ValueType, uint_fast64_t>::value) {
42 return negated ? -mtbdd_getint64(node) : mtbdd_getint64(node);
43 }
else if (std::is_same<ValueType, storm::RationalFunction>::value) {
44 STORM_LOG_ASSERT(
false,
"Non-specialized version of getValue() called for storm::RationalFunction value.");
51storm::RationalNumber InternalAdd<DdType::Sylvan, storm::RationalNumber>::getValue(MTBDD
const& node) {
52 STORM_LOG_ASSERT(mtbdd_isleaf(node),
"Expected leaf, but got variable " << mtbdd_getvar(node) <<
".");
54 bool negated = mtbdd_hascomp(node);
56 STORM_LOG_ASSERT(mtbdd_gettype(node) == sylvan_storm_rational_number_get_type(),
"Expected a storm::RationalNumber value.");
57 storm_rational_number_ptr ptr = (storm_rational_number_ptr)mtbdd_getstorm_rational_number_ptr(node);
58 storm::RationalNumber* rationalNumber = (storm::RationalNumber*)(ptr);
60 return negated ? -(*rationalNumber) : (*rationalNumber);
65 STORM_LOG_ASSERT(mtbdd_isleaf(node),
"Expected leaf, but got variable " << mtbdd_getvar(node) <<
".");
67 bool negated = mtbdd_hascomp(node);
69 STORM_LOG_ASSERT(mtbdd_gettype(node) == sylvan_storm_rational_function_get_type(),
"Expected a storm::RationalFunction value.");
70 uint64_t value = mtbdd_getvalue(node);
71 storm_rational_function_ptr ptr = (storm_rational_function_ptr)value;
75 return negated ? -(*rationalFunction) : (*rationalFunction);
78template<
typename ValueType>
79bool InternalAdd<DdType::Sylvan, ValueType>::operator==(InternalAdd<DdType::Sylvan, ValueType>
const& other)
const {
80 return this->sylvanMtbdd == other.sylvanMtbdd;
83template<
typename ValueType>
84bool InternalAdd<DdType::Sylvan, ValueType>::operator!=(InternalAdd<DdType::Sylvan, ValueType>
const& other)
const {
85 return this->sylvanMtbdd != other.sylvanMtbdd;
88template<
typename ValueType>
89InternalAdd<DdType::Sylvan, ValueType> InternalAdd<DdType::Sylvan, ValueType>::operator+(InternalAdd<DdType::Sylvan, ValueType>
const& other)
const {
90 return InternalAdd<DdType::Sylvan, ValueType>(ddManager, this->sylvanMtbdd.Plus(other.sylvanMtbdd));
94InternalAdd<DdType::Sylvan, storm::RationalNumber> InternalAdd<DdType::Sylvan, storm::RationalNumber>::operator+(
95 InternalAdd<DdType::Sylvan, storm::RationalNumber>
const& other)
const {
96 return InternalAdd<DdType::Sylvan, storm::RationalNumber>(ddManager, this->sylvanMtbdd.PlusRN(other.sylvanMtbdd));
100InternalAdd<DdType::Sylvan, storm::RationalFunction> InternalAdd<DdType::Sylvan, storm::RationalFunction>::operator+(
101 InternalAdd<DdType::Sylvan, storm::RationalFunction>
const& other)
const {
102 return InternalAdd<DdType::Sylvan, storm::RationalFunction>(ddManager, this->sylvanMtbdd.PlusRF(other.sylvanMtbdd));
105template<
typename ValueType>
106InternalAdd<DdType::Sylvan, ValueType>& InternalAdd<DdType::Sylvan, ValueType>::operator+=(InternalAdd<DdType::Sylvan, ValueType>
const& other) {
107 this->sylvanMtbdd = this->sylvanMtbdd.Plus(other.sylvanMtbdd);
112InternalAdd<DdType::Sylvan, storm::RationalNumber>& InternalAdd<DdType::Sylvan, storm::RationalNumber>::operator+=(
113 InternalAdd<DdType::Sylvan, storm::RationalNumber>
const& other) {
114 this->sylvanMtbdd = this->sylvanMtbdd.PlusRN(other.sylvanMtbdd);
119InternalAdd<DdType::Sylvan, storm::RationalFunction>& InternalAdd<DdType::Sylvan, storm::RationalFunction>::operator+=(
120 InternalAdd<DdType::Sylvan, storm::RationalFunction>
const& other) {
121 this->sylvanMtbdd = this->sylvanMtbdd.PlusRF(other.sylvanMtbdd);
125template<
typename ValueType>
126InternalAdd<DdType::Sylvan, ValueType> InternalAdd<DdType::Sylvan, ValueType>::operator*(InternalAdd<DdType::Sylvan, ValueType>
const& other)
const {
127 return InternalAdd<DdType::Sylvan, ValueType>(ddManager, this->sylvanMtbdd.Times(other.sylvanMtbdd));
131InternalAdd<DdType::Sylvan, storm::RationalNumber> InternalAdd<DdType::Sylvan, storm::RationalNumber>::operator*(
132 InternalAdd<DdType::Sylvan, storm::RationalNumber>
const& other)
const {
133 return InternalAdd<DdType::Sylvan, storm::RationalNumber>(ddManager, this->sylvanMtbdd.TimesRN(other.sylvanMtbdd));
137InternalAdd<DdType::Sylvan, storm::RationalFunction> InternalAdd<DdType::Sylvan, storm::RationalFunction>::operator*(
138 InternalAdd<DdType::Sylvan, storm::RationalFunction>
const& other)
const {
139 return InternalAdd<DdType::Sylvan, storm::RationalFunction>(ddManager, this->sylvanMtbdd.TimesRF(other.sylvanMtbdd));
142template<
typename ValueType>
143InternalAdd<DdType::Sylvan, ValueType>& InternalAdd<DdType::Sylvan, ValueType>::operator*=(InternalAdd<DdType::Sylvan, ValueType>
const& other) {
144 this->sylvanMtbdd = this->sylvanMtbdd.Times(other.sylvanMtbdd);
149InternalAdd<DdType::Sylvan, storm::RationalNumber>& InternalAdd<DdType::Sylvan, storm::RationalNumber>::operator*=(
150 InternalAdd<DdType::Sylvan, storm::RationalNumber>
const& other) {
151 this->sylvanMtbdd = this->sylvanMtbdd.TimesRN(other.sylvanMtbdd);
156InternalAdd<DdType::Sylvan, storm::RationalFunction>& InternalAdd<DdType::Sylvan, storm::RationalFunction>::operator*=(
157 InternalAdd<DdType::Sylvan, storm::RationalFunction>
const& other) {
158 this->sylvanMtbdd = this->sylvanMtbdd.TimesRF(other.sylvanMtbdd);
162template<
typename ValueType>
163InternalAdd<DdType::Sylvan, ValueType> InternalAdd<DdType::Sylvan, ValueType>::operator-(InternalAdd<DdType::Sylvan, ValueType>
const& other)
const {
164 return InternalAdd<DdType::Sylvan, ValueType>(ddManager, this->sylvanMtbdd.Minus(other.sylvanMtbdd));
168InternalAdd<DdType::Sylvan, storm::RationalNumber> InternalAdd<DdType::Sylvan, storm::RationalNumber>::operator-(
169 InternalAdd<DdType::Sylvan, storm::RationalNumber>
const& other)
const {
170 return InternalAdd<DdType::Sylvan, storm::RationalNumber>(ddManager, this->sylvanMtbdd.MinusRN(other.sylvanMtbdd));
174InternalAdd<DdType::Sylvan, storm::RationalFunction> InternalAdd<DdType::Sylvan, storm::RationalFunction>::operator-(
175 InternalAdd<DdType::Sylvan, storm::RationalFunction>
const& other)
const {
176 return InternalAdd<DdType::Sylvan, storm::RationalFunction>(ddManager, this->sylvanMtbdd.MinusRF(other.sylvanMtbdd));
179template<
typename ValueType>
180InternalAdd<DdType::Sylvan, ValueType>& InternalAdd<DdType::Sylvan, ValueType>::operator-=(InternalAdd<DdType::Sylvan, ValueType>
const& other) {
181 this->sylvanMtbdd = this->sylvanMtbdd.Minus(other.sylvanMtbdd);
186InternalAdd<DdType::Sylvan, storm::RationalNumber>& InternalAdd<DdType::Sylvan, storm::RationalNumber>::operator-=(
187 InternalAdd<DdType::Sylvan, storm::RationalNumber>
const& other) {
188 this->sylvanMtbdd = this->sylvanMtbdd.MinusRN(other.sylvanMtbdd);
193InternalAdd<DdType::Sylvan, storm::RationalFunction>& InternalAdd<DdType::Sylvan, storm::RationalFunction>::operator-=(
194 InternalAdd<DdType::Sylvan, storm::RationalFunction>
const& other) {
195 this->sylvanMtbdd = this->sylvanMtbdd.MinusRF(other.sylvanMtbdd);
199template<
typename ValueType>
200InternalAdd<DdType::Sylvan, ValueType> InternalAdd<DdType::Sylvan, ValueType>::operator/(InternalAdd<DdType::Sylvan, ValueType>
const& other)
const {
201 return InternalAdd<DdType::Sylvan, ValueType>(ddManager, this->sylvanMtbdd.Divide(other.sylvanMtbdd));
205InternalAdd<DdType::Sylvan, storm::RationalNumber> InternalAdd<DdType::Sylvan, storm::RationalNumber>::operator/(
206 InternalAdd<DdType::Sylvan, storm::RationalNumber>
const& other)
const {
207 return InternalAdd<DdType::Sylvan, storm::RationalNumber>(ddManager, this->sylvanMtbdd.DivideRN(other.sylvanMtbdd));
211InternalAdd<DdType::Sylvan, storm::RationalFunction> InternalAdd<DdType::Sylvan, storm::RationalFunction>::operator/(
212 InternalAdd<DdType::Sylvan, storm::RationalFunction>
const& other)
const {
213 return InternalAdd<DdType::Sylvan, storm::RationalFunction>(ddManager, this->sylvanMtbdd.DivideRF(other.sylvanMtbdd));
216template<
typename ValueType>
217InternalAdd<DdType::Sylvan, ValueType>& InternalAdd<DdType::Sylvan, ValueType>::operator/=(InternalAdd<DdType::Sylvan, ValueType>
const& other) {
218 this->sylvanMtbdd = this->sylvanMtbdd.Divide(other.sylvanMtbdd);
223InternalAdd<DdType::Sylvan, storm::RationalNumber>& InternalAdd<DdType::Sylvan, storm::RationalNumber>::operator/=(
224 InternalAdd<DdType::Sylvan, storm::RationalNumber>
const& other) {
225 this->sylvanMtbdd = this->sylvanMtbdd.DivideRN(other.sylvanMtbdd);
230InternalAdd<DdType::Sylvan, storm::RationalFunction>& InternalAdd<DdType::Sylvan, storm::RationalFunction>::operator/=(
231 InternalAdd<DdType::Sylvan, storm::RationalFunction>
const& other) {
232 this->sylvanMtbdd = this->sylvanMtbdd.DivideRF(other.sylvanMtbdd);
236template<
typename ValueType>
237InternalBdd<DdType::Sylvan> InternalAdd<DdType::Sylvan, ValueType>::equals(InternalAdd<DdType::Sylvan, ValueType>
const& other)
const {
238 return InternalBdd<DdType::Sylvan>(ddManager, this->sylvanMtbdd.Equals(other.sylvanMtbdd));
242InternalBdd<DdType::Sylvan> InternalAdd<DdType::Sylvan, storm::RationalNumber>::equals(InternalAdd<DdType::Sylvan, storm::RationalNumber>
const& other)
const {
243 return InternalBdd<DdType::Sylvan>(ddManager, this->sylvanMtbdd.EqualsRN(other.sylvanMtbdd));
247InternalBdd<DdType::Sylvan> InternalAdd<DdType::Sylvan, storm::RationalFunction>::equals(
248 InternalAdd<DdType::Sylvan, storm::RationalFunction>
const& other)
const {
249 return InternalBdd<DdType::Sylvan>(ddManager, this->sylvanMtbdd.EqualsRF(other.sylvanMtbdd));
252template<
typename ValueType>
253InternalBdd<DdType::Sylvan> InternalAdd<DdType::Sylvan, ValueType>::notEquals(InternalAdd<DdType::Sylvan, ValueType>
const& other)
const {
254 return !this->equals(other);
257template<
typename ValueType>
258InternalBdd<DdType::Sylvan> InternalAdd<DdType::Sylvan, ValueType>::less(InternalAdd<DdType::Sylvan, ValueType>
const& other)
const {
259 return InternalBdd<DdType::Sylvan>(ddManager, this->sylvanMtbdd.Less(other.sylvanMtbdd));
263InternalBdd<DdType::Sylvan> InternalAdd<DdType::Sylvan, storm::RationalNumber>::less(InternalAdd<DdType::Sylvan, storm::RationalNumber>
const& other)
const {
264 return InternalBdd<DdType::Sylvan>(ddManager, this->sylvanMtbdd.LessRN(other.sylvanMtbdd));
268InternalBdd<DdType::Sylvan> InternalAdd<DdType::Sylvan, storm::RationalFunction>::less(
269 InternalAdd<DdType::Sylvan, storm::RationalFunction>
const& other)
const {
270 return InternalBdd<DdType::Sylvan>(ddManager, this->sylvanMtbdd.LessRF(other.sylvanMtbdd));
273template<
typename ValueType>
274InternalBdd<DdType::Sylvan> InternalAdd<DdType::Sylvan, ValueType>::lessOrEqual(InternalAdd<DdType::Sylvan, ValueType>
const& other)
const {
275 return InternalBdd<DdType::Sylvan>(ddManager, this->sylvanMtbdd.LessOrEqual(other.sylvanMtbdd));
279InternalBdd<DdType::Sylvan> InternalAdd<DdType::Sylvan, storm::RationalNumber>::lessOrEqual(
280 InternalAdd<DdType::Sylvan, storm::RationalNumber>
const& other)
const {
281 return InternalBdd<DdType::Sylvan>(ddManager, this->sylvanMtbdd.LessOrEqualRN(other.sylvanMtbdd));
285InternalBdd<DdType::Sylvan> InternalAdd<DdType::Sylvan, storm::RationalFunction>::lessOrEqual(
286 InternalAdd<DdType::Sylvan, storm::RationalFunction>
const& other)
const {
287 return InternalBdd<DdType::Sylvan>(ddManager, this->sylvanMtbdd.LessOrEqualRF(other.sylvanMtbdd));
290template<
typename ValueType>
291InternalBdd<DdType::Sylvan> InternalAdd<DdType::Sylvan, ValueType>::greater(InternalAdd<DdType::Sylvan, ValueType>
const& other)
const {
292 return !this->lessOrEqual(other);
295template<
typename ValueType>
296InternalBdd<DdType::Sylvan> InternalAdd<DdType::Sylvan, ValueType>::greaterOrEqual(InternalAdd<DdType::Sylvan, ValueType>
const& other)
const {
297 return !this->less(other);
300template<
typename ValueType>
301InternalAdd<DdType::Sylvan, ValueType> InternalAdd<DdType::Sylvan, ValueType>::pow(InternalAdd<DdType::Sylvan, ValueType>
const& other)
const {
302 return InternalAdd<DdType::Sylvan, ValueType>(ddManager, this->sylvanMtbdd.Pow(other.sylvanMtbdd));
306InternalAdd<DdType::Sylvan, storm::RationalNumber> InternalAdd<DdType::Sylvan, storm::RationalNumber>::pow(
307 InternalAdd<DdType::Sylvan, storm::RationalNumber>
const& other)
const {
308 return InternalAdd<DdType::Sylvan, storm::RationalNumber>(ddManager, this->sylvanMtbdd.PowRN(other.sylvanMtbdd));
312InternalAdd<DdType::Sylvan, storm::RationalFunction> InternalAdd<DdType::Sylvan, storm::RationalFunction>::pow(
313 InternalAdd<DdType::Sylvan, storm::RationalFunction>
const& other)
const {
314 return InternalAdd<DdType::Sylvan, storm::RationalFunction>(ddManager, this->sylvanMtbdd.PowRF(other.sylvanMtbdd));
317template<
typename ValueType>
318InternalAdd<DdType::Sylvan, ValueType> InternalAdd<DdType::Sylvan, ValueType>::mod(InternalAdd<DdType::Sylvan, ValueType>
const& other)
const {
319 return InternalAdd<DdType::Sylvan, ValueType>(ddManager, this->sylvanMtbdd.Mod(other.sylvanMtbdd));
323InternalAdd<DdType::Sylvan, storm::RationalNumber> InternalAdd<DdType::Sylvan, storm::RationalNumber>::mod(
324 InternalAdd<DdType::Sylvan, storm::RationalNumber>
const& other)
const {
325 return InternalAdd<DdType::Sylvan, storm::RationalNumber>(ddManager, this->sylvanMtbdd.ModRN(other.sylvanMtbdd));
329InternalAdd<DdType::Sylvan, storm::RationalFunction> InternalAdd<DdType::Sylvan, storm::RationalFunction>::mod(
330 InternalAdd<DdType::Sylvan, storm::RationalFunction>
const&)
const {
331 STORM_LOG_THROW(
false, storm::exceptions::InvalidOperationException,
"Operation (mod) not supported by rational functions.");
334template<
typename ValueType>
335InternalAdd<DdType::Sylvan, ValueType> InternalAdd<DdType::Sylvan, ValueType>::logxy(InternalAdd<DdType::Sylvan, ValueType>
const& other)
const {
336 return InternalAdd<DdType::Sylvan, ValueType>(ddManager, this->sylvanMtbdd.Logxy(other.sylvanMtbdd));
340InternalAdd<DdType::Sylvan, storm::RationalNumber> InternalAdd<DdType::Sylvan, storm::RationalNumber>::logxy(
341 InternalAdd<DdType::Sylvan, storm::RationalNumber>
const&)
const {
342 STORM_LOG_THROW(
false, storm::exceptions::InvalidOperationException,
"Operation (logxy) not supported by rational numbers.");
346InternalAdd<DdType::Sylvan, storm::RationalFunction> InternalAdd<DdType::Sylvan, storm::RationalFunction>::logxy(
347 InternalAdd<DdType::Sylvan, storm::RationalFunction>
const&)
const {
348 STORM_LOG_THROW(
false, storm::exceptions::InvalidOperationException,
"Operation (logxy) not supported by rational functions.");
351template<
typename ValueType>
352InternalAdd<DdType::Sylvan, ValueType> InternalAdd<DdType::Sylvan, ValueType>::floor()
const {
353 return InternalAdd<DdType::Sylvan, ValueType>(ddManager, this->sylvanMtbdd.Floor());
357InternalAdd<DdType::Sylvan, storm::RationalNumber> InternalAdd<DdType::Sylvan, storm::RationalNumber>::floor()
const {
358 return InternalAdd<DdType::Sylvan, storm::RationalNumber>(ddManager, this->sylvanMtbdd.FloorRN());
362InternalAdd<DdType::Sylvan, storm::RationalFunction> InternalAdd<DdType::Sylvan, storm::RationalFunction>::floor()
const {
363 return InternalAdd<DdType::Sylvan, storm::RationalFunction>(ddManager, this->sylvanMtbdd.FloorRF());
366template<
typename ValueType>
367InternalAdd<DdType::Sylvan, ValueType> InternalAdd<DdType::Sylvan, ValueType>::ceil()
const {
368 return InternalAdd<DdType::Sylvan, ValueType>(ddManager, this->sylvanMtbdd.Ceil());
372InternalAdd<DdType::Sylvan, storm::RationalNumber> InternalAdd<DdType::Sylvan, storm::RationalNumber>::ceil()
const {
373 return InternalAdd<DdType::Sylvan, storm::RationalNumber>(ddManager, this->sylvanMtbdd.CeilRN());
377InternalAdd<DdType::Sylvan, storm::RationalFunction> InternalAdd<DdType::Sylvan, storm::RationalFunction>::ceil()
const {
378 return InternalAdd<DdType::Sylvan, storm::RationalFunction>(ddManager, this->sylvanMtbdd.CeilRF());
381template<
typename ValueType>
382InternalAdd<DdType::Sylvan, storm::RationalNumber> InternalAdd<DdType::Sylvan, ValueType>::sharpenKwekMehlhorn(
size_t precision)
const {
383 return InternalAdd<DdType::Sylvan, storm::RationalNumber>(ddManager, this->sylvanMtbdd.SharpenKwekMehlhorn(precision));
387InternalAdd<DdType::Sylvan, storm::RationalNumber> InternalAdd<DdType::Sylvan, storm::RationalFunction>::sharpenKwekMehlhorn(
size_t )
const {
388 STORM_LOG_THROW(
false, storm::exceptions::NotSupportedException,
"Operation not supported.");
391template<
typename ValueType>
392InternalAdd<DdType::Sylvan, ValueType> InternalAdd<DdType::Sylvan, ValueType>::minimum(InternalAdd<DdType::Sylvan, ValueType>
const& other)
const {
393 return InternalAdd<DdType::Sylvan, ValueType>(ddManager, this->sylvanMtbdd.Min(other.sylvanMtbdd));
397InternalAdd<DdType::Sylvan, storm::RationalNumber> InternalAdd<DdType::Sylvan, storm::RationalNumber>::minimum(
398 InternalAdd<DdType::Sylvan, storm::RationalNumber>
const& other)
const {
399 return InternalAdd<DdType::Sylvan, storm::RationalNumber>(ddManager, this->sylvanMtbdd.MinRN(other.sylvanMtbdd));
403InternalAdd<DdType::Sylvan, storm::RationalFunction> InternalAdd<DdType::Sylvan, storm::RationalFunction>::minimum(
404 InternalAdd<DdType::Sylvan, storm::RationalFunction>
const& other)
const {
405 return InternalAdd<DdType::Sylvan, storm::RationalFunction>(ddManager, this->sylvanMtbdd.MinRF(other.sylvanMtbdd));
408template<
typename ValueType>
409InternalAdd<DdType::Sylvan, ValueType> InternalAdd<DdType::Sylvan, ValueType>::maximum(InternalAdd<DdType::Sylvan, ValueType>
const& other)
const {
410 return InternalAdd<DdType::Sylvan, ValueType>(ddManager, this->sylvanMtbdd.Max(other.sylvanMtbdd));
414InternalAdd<DdType::Sylvan, storm::RationalNumber> InternalAdd<DdType::Sylvan, storm::RationalNumber>::maximum(
415 InternalAdd<DdType::Sylvan, storm::RationalNumber>
const& other)
const {
416 return InternalAdd<DdType::Sylvan, storm::RationalNumber>(ddManager, this->sylvanMtbdd.MaxRN(other.sylvanMtbdd));
420InternalAdd<DdType::Sylvan, storm::RationalFunction> InternalAdd<DdType::Sylvan, storm::RationalFunction>::maximum(
421 InternalAdd<DdType::Sylvan, storm::RationalFunction>
const& other)
const {
422 return InternalAdd<DdType::Sylvan, storm::RationalFunction>(ddManager, this->sylvanMtbdd.MaxRF(other.sylvanMtbdd));
425template<
typename ValueType>
426template<
typename TargetValueType>
427InternalAdd<DdType::Sylvan, TargetValueType> InternalAdd<DdType::Sylvan, ValueType>::toValueType()
const {
428 if (std::is_same<TargetValueType, ValueType>::value) {
431 STORM_LOG_THROW(
false, storm::exceptions::InvalidOperationException,
"Cannot convert this ADD to the target type.");
436InternalAdd<DdType::Sylvan, double> InternalAdd<DdType::Sylvan, storm::RationalNumber>::toValueType()
const {
437 return InternalAdd<DdType::Sylvan, double>(ddManager, this->sylvanMtbdd.ToDoubleRN());
442InternalAdd<DdType::Sylvan, storm::RationalNumber> InternalAdd<DdType::Sylvan, double>::toValueType()
const {
443 return InternalAdd<DdType::Sylvan, storm::RationalNumber>(ddManager, this->sylvanMtbdd.ToRationalNumber());
448InternalAdd<DdType::Sylvan, double> InternalAdd<DdType::Sylvan, storm::RationalFunction>::toValueType()
const {
449 return InternalAdd<DdType::Sylvan, double>(ddManager, this->sylvanMtbdd.ToDoubleRF());
452template<
typename ValueType>
453InternalAdd<DdType::Sylvan, ValueType> InternalAdd<DdType::Sylvan, ValueType>::sumAbstract(InternalBdd<DdType::Sylvan>
const& cube)
const {
454 return InternalAdd<DdType::Sylvan, ValueType>(ddManager, this->sylvanMtbdd.AbstractPlus(cube.sylvanBdd));
458InternalAdd<DdType::Sylvan, storm::RationalNumber> InternalAdd<DdType::Sylvan, storm::RationalNumber>::sumAbstract(
459 InternalBdd<DdType::Sylvan>
const& cube)
const {
460 return InternalAdd<DdType::Sylvan, storm::RationalNumber>(ddManager, this->sylvanMtbdd.AbstractPlusRN(cube.sylvanBdd));
464InternalAdd<DdType::Sylvan, storm::RationalFunction> InternalAdd<DdType::Sylvan, storm::RationalFunction>::sumAbstract(
465 InternalBdd<DdType::Sylvan>
const& cube)
const {
466 return InternalAdd<DdType::Sylvan, storm::RationalFunction>(ddManager, this->sylvanMtbdd.AbstractPlusRF(cube.sylvanBdd));
469template<
typename ValueType>
470InternalAdd<DdType::Sylvan, ValueType> InternalAdd<DdType::Sylvan, ValueType>::minAbstract(InternalBdd<DdType::Sylvan>
const& cube)
const {
471 return InternalAdd<DdType::Sylvan, ValueType>(ddManager, this->sylvanMtbdd.AbstractMin(cube.sylvanBdd));
474template<
typename ValueType>
475InternalBdd<DdType::Sylvan> InternalAdd<DdType::Sylvan, ValueType>::minAbstractRepresentative(InternalBdd<DdType::Sylvan>
const& cube)
const {
476 return InternalBdd<DdType::Sylvan>(ddManager, this->sylvanMtbdd.AbstractMinRepresentative(cube.sylvanBdd));
480InternalBdd<DdType::Sylvan> InternalAdd<DdType::Sylvan, storm::RationalNumber>::minAbstractRepresentative(InternalBdd<DdType::Sylvan>
const& cube)
const {
481 return InternalBdd<DdType::Sylvan>(ddManager, this->sylvanMtbdd.AbstractMinRepresentativeRN(cube.sylvanBdd));
485InternalAdd<DdType::Sylvan, storm::RationalNumber> InternalAdd<DdType::Sylvan, storm::RationalNumber>::minAbstract(
486 InternalBdd<DdType::Sylvan>
const& cube)
const {
487 return InternalAdd<DdType::Sylvan, storm::RationalNumber>(ddManager, this->sylvanMtbdd.AbstractMinRN(cube.sylvanBdd));
491InternalAdd<DdType::Sylvan, storm::RationalFunction> InternalAdd<DdType::Sylvan, storm::RationalFunction>::minAbstract(
492 InternalBdd<DdType::Sylvan>
const& cube)
const {
493 return InternalAdd<DdType::Sylvan, storm::RationalFunction>(ddManager, this->sylvanMtbdd.AbstractMinRF(cube.sylvanBdd));
496template<
typename ValueType>
497InternalAdd<DdType::Sylvan, ValueType> InternalAdd<DdType::Sylvan, ValueType>::maxAbstract(InternalBdd<DdType::Sylvan>
const& cube)
const {
498 return InternalAdd<DdType::Sylvan, ValueType>(ddManager, this->sylvanMtbdd.AbstractMax(cube.sylvanBdd));
501template<
typename ValueType>
502InternalBdd<DdType::Sylvan> InternalAdd<DdType::Sylvan, ValueType>::maxAbstractRepresentative(InternalBdd<DdType::Sylvan>
const& cube)
const {
503 return InternalBdd<DdType::Sylvan>(ddManager, this->sylvanMtbdd.AbstractMaxRepresentative(cube.sylvanBdd));
507InternalBdd<DdType::Sylvan> InternalAdd<DdType::Sylvan, storm::RationalNumber>::maxAbstractRepresentative(InternalBdd<DdType::Sylvan>
const& cube)
const {
508 return InternalBdd<DdType::Sylvan>(ddManager, this->sylvanMtbdd.AbstractMaxRepresentativeRN(cube.sylvanBdd));
512InternalAdd<DdType::Sylvan, storm::RationalNumber> InternalAdd<DdType::Sylvan, storm::RationalNumber>::maxAbstract(
513 InternalBdd<DdType::Sylvan>
const& cube)
const {
514 return InternalAdd<DdType::Sylvan, storm::RationalNumber>(ddManager, this->sylvanMtbdd.AbstractMaxRN(cube.sylvanBdd));
518InternalAdd<DdType::Sylvan, storm::RationalFunction> InternalAdd<DdType::Sylvan, storm::RationalFunction>::maxAbstract(
519 InternalBdd<DdType::Sylvan>
const& cube)
const {
520 return InternalAdd<DdType::Sylvan, storm::RationalFunction>(ddManager, this->sylvanMtbdd.AbstractMaxRF(cube.sylvanBdd));
523template<
typename ValueType>
524bool InternalAdd<DdType::Sylvan, ValueType>::equalModuloPrecision(InternalAdd<DdType::Sylvan, ValueType>
const& other, ValueType
const& precision,
525 bool relative)
const {
527 return this->sylvanMtbdd.EqualNormRel(other.sylvanMtbdd, precision);
529 return this->sylvanMtbdd.EqualNorm(other.sylvanMtbdd, precision);
534bool InternalAdd<DdType::Sylvan, storm::RationalNumber>::equalModuloPrecision(InternalAdd<DdType::Sylvan, storm::RationalNumber>
const& other,
535 storm::RationalNumber
const& precision,
bool relative)
const {
537 return this->sylvanMtbdd.EqualNormRelRN(other.sylvanMtbdd, precision);
539 return this->sylvanMtbdd.EqualNormRN(other.sylvanMtbdd, precision);
544bool InternalAdd<DdType::Sylvan, storm::RationalFunction>::equalModuloPrecision(InternalAdd<DdType::Sylvan, storm::RationalFunction>
const& other,
547 return this->sylvanMtbdd.EqualNormRelRF(other.sylvanMtbdd, precision);
549 return this->sylvanMtbdd.EqualNormRF(other.sylvanMtbdd, precision);
553template<
typename ValueType>
554InternalAdd<DdType::Sylvan, ValueType> InternalAdd<DdType::Sylvan, ValueType>::swapVariables(std::vector<InternalBdd<DdType::Sylvan>>
const& from,
555 std::vector<InternalBdd<DdType::Sylvan>>
const& to)
const {
556 std::vector<uint32_t> fromIndices;
557 std::vector<uint32_t> toIndices;
558 for (
auto it1 = from.begin(), ite1 = from.end(), it2 = to.begin(); it1 != ite1; ++it1, ++it2) {
559 fromIndices.push_back(it1->getIndex());
560 fromIndices.push_back(it2->getIndex());
561 toIndices.push_back(it2->getIndex());
562 toIndices.push_back(it1->getIndex());
564 return InternalAdd<DdType::Sylvan, ValueType>(ddManager, this->sylvanMtbdd.Permute(fromIndices, toIndices));
567template<
typename ValueType>
568InternalAdd<DdType::Sylvan, ValueType> InternalAdd<DdType::Sylvan, ValueType>::permuteVariables(std::vector<InternalBdd<DdType::Sylvan>>
const& from,
569 std::vector<InternalBdd<DdType::Sylvan>>
const& to)
const {
570 std::vector<uint32_t> fromIndices;
571 std::vector<uint32_t> toIndices;
572 for (
auto it1 = from.begin(), ite1 = from.end(), it2 = to.begin(); it1 != ite1; ++it1, ++it2) {
573 fromIndices.push_back(it1->getIndex());
574 toIndices.push_back(it2->getIndex());
576 return InternalAdd<DdType::Sylvan, ValueType>(ddManager, this->sylvanMtbdd.Permute(fromIndices, toIndices));
579template<
typename ValueType>
580InternalAdd<DdType::Sylvan, ValueType> InternalAdd<DdType::Sylvan, ValueType>::multiplyMatrix(
581 InternalAdd<DdType::Sylvan, ValueType>
const& otherMatrix, std::vector<InternalBdd<DdType::Sylvan>>
const& summationDdVariables)
const {
582 InternalBdd<DdType::Sylvan> summationVariables = ddManager->getBddOne();
583 for (
auto const& ddVariable : summationDdVariables) {
584 summationVariables &= ddVariable;
587 return InternalAdd<DdType::Sylvan, ValueType>(ddManager, this->sylvanMtbdd.AndExists(otherMatrix.sylvanMtbdd, summationVariables.getSylvanBdd()));
591InternalAdd<DdType::Sylvan, storm::RationalFunction> InternalAdd<DdType::Sylvan, storm::RationalFunction>::multiplyMatrix(
592 InternalAdd<DdType::Sylvan, storm::RationalFunction>
const& otherMatrix, std::vector<InternalBdd<DdType::Sylvan>>
const& summationDdVariables)
const {
593 InternalBdd<DdType::Sylvan> summationVariables = ddManager->getBddOne();
594 for (
auto const& ddVariable : summationDdVariables) {
595 summationVariables &= ddVariable;
598 return InternalAdd<DdType::Sylvan, storm::RationalFunction>(ddManager,
599 this->sylvanMtbdd.AndExistsRF(otherMatrix.sylvanMtbdd, summationVariables.getSylvanBdd()));
603InternalAdd<DdType::Sylvan, storm::RationalNumber> InternalAdd<DdType::Sylvan, storm::RationalNumber>::multiplyMatrix(
604 InternalAdd<DdType::Sylvan, storm::RationalNumber>
const& otherMatrix, std::vector<InternalBdd<DdType::Sylvan>>
const& summationDdVariables)
const {
605 InternalBdd<DdType::Sylvan> summationVariables = ddManager->getBddOne();
606 for (
auto const& ddVariable : summationDdVariables) {
607 summationVariables &= ddVariable;
610 return InternalAdd<DdType::Sylvan, storm::RationalNumber>(ddManager,
611 this->sylvanMtbdd.AndExistsRN(otherMatrix.sylvanMtbdd, summationVariables.getSylvanBdd()));
614template<
typename ValueType>
615InternalAdd<DdType::Sylvan, ValueType> InternalAdd<DdType::Sylvan, ValueType>::multiplyMatrix(
616 InternalBdd<DdType::Sylvan>
const& otherMatrix, std::vector<InternalBdd<DdType::Sylvan>>
const& summationDdVariables)
const {
617 InternalBdd<DdType::Sylvan> summationVariables = ddManager->getBddOne();
618 for (
auto const& ddVariable : summationDdVariables) {
619 summationVariables &= ddVariable;
622 return InternalAdd<DdType::Sylvan, ValueType>(
623 ddManager, this->sylvanMtbdd.AndExists(sylvan::Bdd(otherMatrix.getSylvanBdd().GetBDD()), summationVariables.getSylvanBdd()));
627InternalAdd<DdType::Sylvan, storm::RationalFunction> InternalAdd<DdType::Sylvan, storm::RationalFunction>::multiplyMatrix(
628 InternalBdd<DdType::Sylvan>
const& otherMatrix, std::vector<InternalBdd<DdType::Sylvan>>
const& summationDdVariables)
const {
629 InternalBdd<DdType::Sylvan> summationVariables = ddManager->getBddOne();
630 for (
auto const& ddVariable : summationDdVariables) {
631 summationVariables &= ddVariable;
634 return InternalAdd<DdType::Sylvan, storm::RationalFunction>(
635 ddManager, this->sylvanMtbdd.AndExistsRF(sylvan::Bdd(otherMatrix.getSylvanBdd().GetBDD()), summationVariables.getSylvanBdd()));
639InternalAdd<DdType::Sylvan, storm::RationalNumber> InternalAdd<DdType::Sylvan, storm::RationalNumber>::multiplyMatrix(
640 InternalBdd<DdType::Sylvan>
const& otherMatrix, std::vector<InternalBdd<DdType::Sylvan>>
const& summationDdVariables)
const {
641 InternalBdd<DdType::Sylvan> summationVariables = ddManager->getBddOne();
642 for (
auto const& ddVariable : summationDdVariables) {
643 summationVariables &= ddVariable;
646 return InternalAdd<DdType::Sylvan, storm::RationalNumber>(
647 ddManager, this->sylvanMtbdd.AndExistsRN(sylvan::Bdd(otherMatrix.getSylvanBdd().GetBDD()), summationVariables.getSylvanBdd()));
650template<
typename ValueType>
651InternalBdd<DdType::Sylvan> InternalAdd<DdType::Sylvan, ValueType>::greater(ValueType
const& value)
const {
652 return InternalBdd<DdType::Sylvan>(ddManager, this->sylvanMtbdd.BddStrictThreshold(value));
656InternalBdd<DdType::Sylvan> InternalAdd<DdType::Sylvan, storm::RationalNumber>::greater(storm::RationalNumber
const& value)
const {
657 return InternalBdd<DdType::Sylvan>(ddManager, this->sylvanMtbdd.BddStrictThresholdRN(value));
661InternalBdd<DdType::Sylvan> InternalAdd<DdType::Sylvan, storm::RationalFunction>::greater(
storm::RationalFunction const& value)
const {
662 return InternalBdd<DdType::Sylvan>(ddManager, this->sylvanMtbdd.BddStrictThresholdRF(value));
665template<
typename ValueType>
666InternalBdd<DdType::Sylvan> InternalAdd<DdType::Sylvan, ValueType>::greaterOrEqual(ValueType
const& value)
const {
667 return InternalBdd<DdType::Sylvan>(ddManager, this->sylvanMtbdd.BddThreshold(value));
671InternalBdd<DdType::Sylvan> InternalAdd<DdType::Sylvan, storm::RationalNumber>::greaterOrEqual(storm::RationalNumber
const& value)
const {
672 return InternalBdd<DdType::Sylvan>(ddManager, this->sylvanMtbdd.BddThresholdRN(value));
676InternalBdd<DdType::Sylvan> InternalAdd<DdType::Sylvan, storm::RationalFunction>::greaterOrEqual(
storm::RationalFunction const& value)
const {
677 return InternalBdd<DdType::Sylvan>(ddManager, this->sylvanMtbdd.BddThresholdRF(value));
680template<
typename ValueType>
681InternalBdd<DdType::Sylvan> InternalAdd<DdType::Sylvan, ValueType>::less(ValueType
const& value)
const {
682 return !this->greaterOrEqual(value);
685template<
typename ValueType>
686InternalBdd<DdType::Sylvan> InternalAdd<DdType::Sylvan, ValueType>::lessOrEqual(ValueType
const& value)
const {
687 return !this->greater(value);
690template<
typename ValueType>
691InternalBdd<DdType::Sylvan> InternalAdd<DdType::Sylvan, ValueType>::notZero()
const {
692 return InternalBdd<DdType::Sylvan>(ddManager, this->sylvanMtbdd.NotZero());
695template<
typename ValueType>
696InternalAdd<DdType::Sylvan, ValueType> InternalAdd<DdType::Sylvan, ValueType>::constrain(InternalAdd<DdType::Sylvan, ValueType>
const&)
const {
697 STORM_LOG_THROW(
false, storm::exceptions::NotImplementedException,
"Operation (constrain) not yet implemented.");
700template<
typename ValueType>
701InternalAdd<DdType::Sylvan, ValueType> InternalAdd<DdType::Sylvan, ValueType>::restrict(InternalAdd<DdType::Sylvan, ValueType>
const&)
const {
702 STORM_LOG_THROW(
false, storm::exceptions::NotImplementedException,
"Operation (restrict) not yet implemented.");
705template<
typename ValueType>
706InternalBdd<DdType::Sylvan> InternalAdd<DdType::Sylvan, ValueType>::getSupport()
const {
707 return InternalBdd<DdType::Sylvan>(ddManager, sylvan::Bdd(
static_cast<BDD
>(this->sylvanMtbdd.Support().GetMTBDD())));
710template<
typename ValueType>
711uint_fast64_t InternalAdd<DdType::Sylvan, ValueType>::getNonZeroCount(uint_fast64_t numberOfDdVariables)
const {
712 if (numberOfDdVariables == 0) {
715 return static_cast<uint_fast64_t
>(this->sylvanMtbdd.NonZeroCount(numberOfDdVariables));
718template<
typename ValueType>
719uint_fast64_t InternalAdd<DdType::Sylvan, ValueType>::getLeafCount()
const {
720 return static_cast<uint_fast64_t
>(this->sylvanMtbdd.CountLeaves());
723template<
typename ValueType>
724uint_fast64_t InternalAdd<DdType::Sylvan, ValueType>::getNodeCount()
const {
725 return static_cast<uint_fast64_t
>(this->sylvanMtbdd.NodeCount());
728template<
typename ValueType>
729ValueType InternalAdd<DdType::Sylvan, ValueType>::getMin()
const {
730 return getValue(this->sylvanMtbdd.Minimum().GetMTBDD());
734storm::RationalNumber InternalAdd<DdType::Sylvan, storm::RationalNumber>::getMin()
const {
735 return getValue(this->sylvanMtbdd.MinimumRN().GetMTBDD());
740 return getValue(this->sylvanMtbdd.MinimumRF().GetMTBDD());
743template<
typename ValueType>
744ValueType InternalAdd<DdType::Sylvan, ValueType>::getMax()
const {
745 return getValue(this->sylvanMtbdd.Maximum().GetMTBDD());
749storm::RationalNumber InternalAdd<DdType::Sylvan, storm::RationalNumber>::getMax()
const {
750 return getValue(this->sylvanMtbdd.MaximumRN().GetMTBDD());
755 return getValue(this->sylvanMtbdd.MaximumRF().GetMTBDD());
758template<
typename ValueType>
759ValueType InternalAdd<DdType::Sylvan, ValueType>::getValue()
const {
760 return getValue(this->sylvanMtbdd.GetMTBDD());
763template<
typename ValueType>
764bool InternalAdd<DdType::Sylvan, ValueType>::isOne()
const {
765 return *
this == ddManager->getAddOne<
ValueType>();
768template<
typename ValueType>
769bool InternalAdd<DdType::Sylvan, ValueType>::isZero()
const {
770 return *
this == ddManager->getAddZero<
ValueType>();
773template<
typename ValueType>
774bool InternalAdd<DdType::Sylvan, ValueType>::isConstant()
const {
775 return this->sylvanMtbdd.isTerminal();
778template<
typename ValueType>
779uint_fast64_t InternalAdd<DdType::Sylvan, ValueType>::getIndex()
const {
780 return static_cast<uint_fast64_t
>(this->sylvanMtbdd.TopVar());
783template<
typename ValueType>
784uint_fast64_t InternalAdd<DdType::Sylvan, ValueType>::getLevel()
const {
785 return this->getIndex();
788template<
typename ValueType>
789void InternalAdd<DdType::Sylvan, ValueType>::exportToDot(std::string
const& filename, std::vector<std::string>
const&,
bool)
const {
791 FILE* filePointer = fopen(filename.c_str(),
"a+");
793 if (filePointer ==
nullptr) {
796 this->sylvanMtbdd.PrintDot(filePointer);
801template<
typename ValueType>
802void InternalAdd<DdType::Sylvan, ValueType>::exportToText(std::string
const& filename)
const {
804 FILE* filePointer = fopen(filename.c_str(),
"a+");
806 if (filePointer ==
nullptr) {
809 this->sylvanMtbdd.PrintText(filePointer);
814template<
typename ValueType>
815AddIterator<DdType::Sylvan, ValueType> InternalAdd<DdType::Sylvan, ValueType>::begin(DdManager<DdType::Sylvan>
const& fullDdManager,
816 InternalBdd<DdType::Sylvan>
const& variableCube,
817 uint_fast64_t numberOfDdVariables,
818 std::set<storm::expressions::Variable>
const& metaVariables,
819 bool enumerateDontCareMetaVariables)
const {
820 return AddIterator<DdType::Sylvan, ValueType>::createBeginIterator(fullDdManager, this->getSylvanMtbdd(), variableCube.getSylvanBdd(), numberOfDdVariables,
821 &metaVariables, enumerateDontCareMetaVariables);
824template<
typename ValueType>
825AddIterator<DdType::Sylvan, ValueType> InternalAdd<DdType::Sylvan, ValueType>::end(DdManager<DdType::Sylvan>
const& fullDdManager)
const {
826 return AddIterator<DdType::Sylvan, ValueType>::createEndIterator(fullDdManager);
829template<
typename ValueType>
830Odd InternalAdd<DdType::Sylvan, ValueType>::createOdd(std::vector<uint_fast64_t>
const& ddVariableIndices)
const {
832 std::vector<std::unordered_map<BDD, std::shared_ptr<Odd>>> uniqueTableForLevels(ddVariableIndices.size() + 1);
835 std::shared_ptr<Odd> rootOdd =
836 createOddRec(mtbdd_regular(this->getSylvanMtbdd().GetMTBDD()), 0, ddVariableIndices.size(), ddVariableIndices, uniqueTableForLevels);
839 return Odd(*rootOdd);
842template<
typename ValueType>
843std::shared_ptr<Odd> InternalAdd<DdType::Sylvan, ValueType>::createOddRec(BDD dd, uint_fast64_t currentLevel, uint_fast64_t maxLevel,
844 std::vector<uint_fast64_t>
const& ddVariableIndices,
845 std::vector<std::unordered_map<BDD, std::shared_ptr<Odd>>>& uniqueTableForLevels) {
847 auto const& iterator = uniqueTableForLevels[currentLevel].find(dd);
848 if (iterator != uniqueTableForLevels[currentLevel].end()) {
849 return iterator->second;
855 if (currentLevel == maxLevel) {
856 uint_fast64_t elseOffset = 0;
857 uint_fast64_t thenOffset = 0;
862 if (!mtbdd_iszero(dd)) {
866 auto oddNode = std::make_shared<Odd>(
nullptr, elseOffset,
nullptr, thenOffset);
867 uniqueTableForLevels[currentLevel].emplace(dd, oddNode);
869 }
else if (mtbdd_isleaf(dd) || ddVariableIndices[currentLevel] < mtbdd_getvar(dd)) {
872 std::shared_ptr<Odd> elseNode = createOddRec(dd, currentLevel + 1, maxLevel, ddVariableIndices, uniqueTableForLevels);
873 std::shared_ptr<Odd> thenNode = elseNode;
874 auto oddNode = std::make_shared<Odd>(elseNode, elseNode->getElseOffset() + elseNode->getThenOffset(), thenNode,
875 thenNode->getElseOffset() + thenNode->getThenOffset());
876 uniqueTableForLevels[currentLevel].emplace(dd, oddNode);
880 std::shared_ptr<Odd> elseNode = createOddRec(mtbdd_regular(mtbdd_getlow(dd)), currentLevel + 1, maxLevel, ddVariableIndices, uniqueTableForLevels);
881 std::shared_ptr<Odd> thenNode = createOddRec(mtbdd_regular(mtbdd_gethigh(dd)), currentLevel + 1, maxLevel, ddVariableIndices, uniqueTableForLevels);
883 uint_fast64_t totalElseOffset = elseNode->getElseOffset() + elseNode->getThenOffset();
884 uint_fast64_t totalThenOffset = thenNode->getElseOffset() + thenNode->getThenOffset();
886 auto oddNode = std::make_shared<Odd>(elseNode, totalElseOffset, thenNode, totalThenOffset);
887 uniqueTableForLevels[currentLevel].emplace(dd, oddNode);
893template<
typename ValueType>
894InternalDdManager<DdType::Sylvan>
const& InternalAdd<DdType::Sylvan, ValueType>::getInternalDdManager()
const {
898template<
typename ValueType>
899void InternalAdd<DdType::Sylvan, ValueType>::composeWithExplicitVector(
storm::dd::Odd const& odd, std::vector<uint_fast64_t>
const& ddVariableIndices,
900 std::vector<ValueType>& targetVector,
901 std::function<
ValueType(ValueType
const&, ValueType
const&)>
const& function)
const {
902 forEachRec(this->getSylvanMtbdd().GetMTBDD(), 0, ddVariableIndices.size(), 0, odd, ddVariableIndices,
903 [&function, &targetVector](uint64_t
const& offset, ValueType
const& value) { targetVector[offset] = function(targetVector[offset], value); });
906template<
typename ValueType>
907void InternalAdd<DdType::Sylvan, ValueType>::composeWithExplicitVector(
storm::dd::Odd const& odd, std::vector<uint_fast64_t>
const& ddVariableIndices,
908 std::vector<uint_fast64_t>
const& offsets, std::vector<ValueType>& targetVector,
909 std::function<
ValueType(ValueType
const&, ValueType
const&)>
const& function)
const {
910 forEachRec(this->getSylvanMtbdd().GetMTBDD(), 0, ddVariableIndices.size(), 0, odd, ddVariableIndices,
911 [&function, &targetVector, &offsets](uint64_t
const& offset, ValueType
const& value) {
912 ValueType& targetValue = targetVector[offsets[offset]];
913 targetValue = function(targetValue, value);
917template<
typename ValueType>
918void InternalAdd<DdType::Sylvan, ValueType>::forEach(Odd
const& odd, std::vector<uint_fast64_t>
const& ddVariableIndices,
919 std::function<
void(uint64_t
const&, ValueType
const&)>
const& function)
const {
920 forEachRec(this->getSylvanMtbdd().GetMTBDD(), 0, ddVariableIndices.size(), 0, odd, ddVariableIndices, function);
923template<
typename ValueType>
924void InternalAdd<DdType::Sylvan, ValueType>::forEachRec(MTBDD dd, uint_fast64_t currentLevel, uint_fast64_t maxLevel, uint_fast64_t currentOffset,
925 Odd
const& odd, std::vector<uint_fast64_t>
const& ddVariableIndices,
926 std::function<
void(uint64_t
const&, ValueType
const&)>
const& function)
const {
928 if (mtbdd_isleaf(dd) && mtbdd_iszero(dd)) {
933 if (currentLevel == maxLevel) {
934 function(currentOffset, getValue(dd));
935 }
else if (mtbdd_isleaf(dd) || ddVariableIndices[currentLevel] < mtbdd_getvar(dd)) {
938 forEachRec(dd, currentLevel + 1, maxLevel, currentOffset, odd.getElseSuccessor(), ddVariableIndices, function);
939 forEachRec(dd, currentLevel + 1, maxLevel, currentOffset + odd.getElseOffset(), odd.getThenSuccessor(), ddVariableIndices, function);
942 MTBDD thenNode = mtbdd_gethigh(dd);
943 MTBDD elseNode = mtbdd_getlow(dd);
945 forEachRec(elseNode, currentLevel + 1, maxLevel, currentOffset, odd.getElseSuccessor(), ddVariableIndices, function);
946 forEachRec(thenNode, currentLevel + 1, maxLevel, currentOffset + odd.getElseOffset(), odd.getThenSuccessor(), ddVariableIndices, function);
950template<
typename ValueType>
951std::vector<uint64_t> InternalAdd<DdType::Sylvan, ValueType>::decodeGroupLabels(std::vector<uint_fast64_t>
const& ddGroupVariableIndices,
953 std::vector<uint64_t> result;
954 decodeGroupLabelsRec(mtbdd_regular(this->getSylvanMtbdd().GetMTBDD()), result, ddGroupVariableIndices, ddLabelVariableIndices, 0,
955 ddGroupVariableIndices.size(), 0);
959template<
typename ValueType>
960void InternalAdd<DdType::Sylvan, ValueType>::decodeGroupLabelsRec(MTBDD dd, std::vector<uint64_t>& labels,
961 std::vector<uint_fast64_t>
const& ddGroupVariableIndices,
963 uint_fast64_t maxLevel, uint64_t label)
const {
965 if (mtbdd_isleaf(dd) && mtbdd_iszero(dd)) {
969 if (currentLevel == maxLevel) {
970 labels.push_back(label);
972 uint64_t elseLabel = label;
973 uint64_t thenLabel = label;
975 if (ddLabelVariableIndices.
get(currentLevel)) {
977 thenLabel = (thenLabel << 1) | 1;
980 if (mtbdd_isleaf(dd) || ddGroupVariableIndices[currentLevel] < mtbdd_getvar(dd)) {
981 decodeGroupLabelsRec(dd, labels, ddGroupVariableIndices, ddLabelVariableIndices, currentLevel + 1, maxLevel, elseLabel);
982 decodeGroupLabelsRec(dd, labels, ddGroupVariableIndices, ddLabelVariableIndices, currentLevel + 1, maxLevel, thenLabel);
985 MTBDD thenDdNode = mtbdd_gethigh(dd);
986 MTBDD elseDdNode = mtbdd_getlow(dd);
988 decodeGroupLabelsRec(mtbdd_regular(elseDdNode), labels, ddGroupVariableIndices, ddLabelVariableIndices, currentLevel + 1, maxLevel, elseLabel);
989 decodeGroupLabelsRec(mtbdd_regular(thenDdNode), labels, ddGroupVariableIndices, ddLabelVariableIndices, currentLevel + 1, maxLevel, thenLabel);
994template<
typename ValueType>
995std::vector<InternalAdd<DdType::Sylvan, ValueType>> InternalAdd<DdType::Sylvan, ValueType>::splitIntoGroups(
996 std::vector<uint_fast64_t>
const& ddGroupVariableIndices)
const {
997 std::vector<InternalAdd<DdType::Sylvan, ValueType>> result;
998 splitIntoGroupsRec(mtbdd_regular(this->getSylvanMtbdd().GetMTBDD()), mtbdd_hascomp(this->getSylvanMtbdd().GetMTBDD()), result, ddGroupVariableIndices, 0,
999 ddGroupVariableIndices.size());
1003template<
typename ValueType>
1004std::vector<std::pair<InternalAdd<DdType::Sylvan, ValueType>, InternalAdd<DdType::Sylvan, ValueType>>> InternalAdd<DdType::Sylvan, ValueType>::splitIntoGroups(
1005 InternalAdd<DdType::Sylvan, ValueType> vector, std::vector<uint_fast64_t>
const& ddGroupVariableIndices)
const {
1006 std::vector<std::pair<InternalAdd<DdType::Sylvan, ValueType>, InternalAdd<DdType::Sylvan, ValueType>>> result;
1007 splitIntoGroupsRec(mtbdd_regular(this->getSylvanMtbdd().GetMTBDD()), mtbdd_hascomp(this->getSylvanMtbdd().GetMTBDD()),
1008 mtbdd_regular(vector.getSylvanMtbdd().GetMTBDD()), mtbdd_hascomp(vector.getSylvanMtbdd().GetMTBDD()), result, ddGroupVariableIndices, 0,
1009 ddGroupVariableIndices.size());
1013template<
typename ValueType>
1014std::vector<std::vector<InternalAdd<DdType::Sylvan, ValueType>>> InternalAdd<DdType::Sylvan, ValueType>::splitIntoGroups(
1015 std::vector<InternalAdd<DdType::Sylvan, ValueType>>
const& vectors, std::vector<uint_fast64_t>
const& ddGroupVariableIndices)
const {
1016 std::vector<std::vector<InternalAdd<DdType::Sylvan, ValueType>>> result;
1017 std::vector<MTBDD> dds;
1019 for (
auto const& vector : vectors) {
1020 negatedDds.set(dds.size(), mtbdd_hascomp(vector.getSylvanMtbdd().GetMTBDD()));
1021 dds.push_back(mtbdd_regular(vector.getSylvanMtbdd().GetMTBDD()));
1023 dds.push_back(this->getSylvanMtbdd().GetMTBDD());
1024 negatedDds.set(vectors.size(), mtbdd_hascomp(this->getSylvanMtbdd().GetMTBDD()));
1026 splitIntoGroupsRec(dds, negatedDds, result, ddGroupVariableIndices, 0, ddGroupVariableIndices.size());
1030template<
typename ValueType>
1031void InternalAdd<DdType::Sylvan, ValueType>::splitIntoGroupsRec(MTBDD dd,
bool negated, std::vector<InternalAdd<DdType::Sylvan, ValueType>>& groups,
1032 std::vector<uint_fast64_t>
const& ddGroupVariableIndices, uint_fast64_t currentLevel,
1033 uint_fast64_t maxLevel)
const {
1035 if (mtbdd_isleaf(dd) && mtbdd_iszero(dd)) {
1039 if (currentLevel == maxLevel) {
1040 groups.push_back(InternalAdd<DdType::Sylvan, ValueType>(ddManager, negated ? sylvan::Mtbdd(dd).Negate() : sylvan::Mtbdd(dd)));
1041 }
else if (mtbdd_isleaf(dd) || ddGroupVariableIndices[currentLevel] < mtbdd_getvar(dd)) {
1042 splitIntoGroupsRec(dd, negated, groups, ddGroupVariableIndices, currentLevel + 1, maxLevel);
1043 splitIntoGroupsRec(dd, negated, groups, ddGroupVariableIndices, currentLevel + 1, maxLevel);
1046 MTBDD thenDdNode = mtbdd_gethigh(dd);
1047 MTBDD elseDdNode = mtbdd_getlow(dd);
1050 bool elseComplemented = mtbdd_hascomp(elseDdNode) ^ negated;
1051 bool thenComplemented = mtbdd_hascomp(thenDdNode) ^ negated;
1055 splitIntoGroupsRec(mtbdd_regular(elseDdNode), elseComplemented, groups, ddGroupVariableIndices, currentLevel + 1, maxLevel);
1056 splitIntoGroupsRec(mtbdd_regular(thenDdNode), thenComplemented, groups, ddGroupVariableIndices, currentLevel + 1, maxLevel);
1060template<
typename ValueType>
1061void InternalAdd<DdType::Sylvan, ValueType>::splitIntoGroupsRec(
1062 MTBDD dd1,
bool negated1, MTBDD dd2,
bool negated2,
1063 std::vector<std::pair<InternalAdd<DdType::Sylvan, ValueType>, InternalAdd<DdType::Sylvan, ValueType>>>& groups,
1064 std::vector<uint_fast64_t>
const& ddGroupVariableIndices, uint_fast64_t currentLevel, uint_fast64_t maxLevel)
const {
1066 if (mtbdd_isleaf(dd1) && mtbdd_isleaf(dd2) && mtbdd_iszero(dd1) && mtbdd_iszero(dd2)) {
1070 if (currentLevel == maxLevel) {
1071 groups.push_back(std::make_pair(InternalAdd<DdType::Sylvan, ValueType>(ddManager, negated1 ? sylvan::Mtbdd(dd1).Negate() : sylvan::Mtbdd(dd1)),
1072 InternalAdd<DdType::Sylvan, ValueType>(ddManager, negated2 ? sylvan::Mtbdd(dd2).Negate() : sylvan::Mtbdd(dd2))));
1073 }
else if (mtbdd_isleaf(dd1) || ddGroupVariableIndices[currentLevel] < mtbdd_getvar(dd1)) {
1074 if (mtbdd_isleaf(dd2) || ddGroupVariableIndices[currentLevel] < mtbdd_getvar(dd2)) {
1075 splitIntoGroupsRec(dd1, negated1, dd2, negated2, groups, ddGroupVariableIndices, currentLevel + 1, maxLevel);
1076 splitIntoGroupsRec(dd1, negated1, dd2, negated2, groups, ddGroupVariableIndices, currentLevel + 1, maxLevel);
1078 MTBDD dd2ThenNode = mtbdd_gethigh(dd2);
1079 MTBDD dd2ElseNode = mtbdd_getlow(dd2);
1082 bool elseComplemented = mtbdd_hascomp(dd2ElseNode) ^ negated2;
1083 bool thenComplemented = mtbdd_hascomp(dd2ThenNode) ^ negated2;
1085 splitIntoGroupsRec(dd1, negated1, mtbdd_regular(dd2ThenNode), thenComplemented, groups, ddGroupVariableIndices, currentLevel + 1, maxLevel);
1086 splitIntoGroupsRec(dd1, negated1, mtbdd_regular(dd2ElseNode), elseComplemented, groups, ddGroupVariableIndices, currentLevel + 1, maxLevel);
1088 }
else if (mtbdd_isleaf(dd2) || ddGroupVariableIndices[currentLevel] < mtbdd_getvar(dd2)) {
1089 MTBDD dd1ThenNode = mtbdd_gethigh(dd1);
1090 MTBDD dd1ElseNode = mtbdd_getlow(dd1);
1093 bool elseComplemented = mtbdd_hascomp(dd1ElseNode) ^ negated1;
1094 bool thenComplemented = mtbdd_hascomp(dd1ThenNode) ^ negated1;
1096 splitIntoGroupsRec(mtbdd_regular(dd1ThenNode), thenComplemented, dd2, negated2, groups, ddGroupVariableIndices, currentLevel + 1, maxLevel);
1097 splitIntoGroupsRec(mtbdd_regular(dd1ElseNode), elseComplemented, dd2, negated2, groups, ddGroupVariableIndices, currentLevel + 1, maxLevel);
1099 MTBDD dd1ThenNode = mtbdd_gethigh(dd1);
1100 MTBDD dd1ElseNode = mtbdd_getlow(dd1);
1101 MTBDD dd2ThenNode = mtbdd_gethigh(dd2);
1102 MTBDD dd2ElseNode = mtbdd_getlow(dd2);
1105 bool dd1ElseComplemented = mtbdd_hascomp(dd1ElseNode) ^ negated1;
1106 bool dd1ThenComplemented = mtbdd_hascomp(dd1ThenNode) ^ negated1;
1107 bool dd2ElseComplemented = mtbdd_hascomp(dd2ElseNode) ^ negated2;
1108 bool dd2ThenComplemented = mtbdd_hascomp(dd2ThenNode) ^ negated2;
1110 splitIntoGroupsRec(mtbdd_regular(dd1ThenNode), dd1ThenComplemented, mtbdd_regular(dd2ThenNode), dd2ThenComplemented, groups, ddGroupVariableIndices,
1111 currentLevel + 1, maxLevel);
1112 splitIntoGroupsRec(mtbdd_regular(dd1ElseNode), dd1ElseComplemented, mtbdd_regular(dd2ElseNode), dd2ElseComplemented, groups, ddGroupVariableIndices,
1113 currentLevel + 1, maxLevel);
1117template<
typename ValueType>
1118void InternalAdd<DdType::Sylvan, ValueType>::splitIntoGroupsRec(std::vector<MTBDD>
const& dds,
storm::storage::BitVector const& negatedDds,
1119 std::vector<std::vector<InternalAdd<DdType::Sylvan, ValueType>>>& groups,
1120 std::vector<uint_fast64_t>
const& ddGroupVariableIndices, uint_fast64_t currentLevel,
1121 uint_fast64_t maxLevel)
const {
1124 bool emptyDd =
true;
1125 for (
auto const& dd : dds) {
1126 if (!(mtbdd_isleaf(dd) && mtbdd_iszero(dd))) {
1136 if (currentLevel == maxLevel) {
1137 std::vector<InternalAdd<DdType::Sylvan, ValueType>> newGroup;
1138 for (uint64_t ddIndex = 0; ddIndex < dds.size(); ++ddIndex) {
1139 newGroup.emplace_back(ddManager, negatedDds.
get(ddIndex) ? sylvan::Mtbdd(dds[ddIndex]).Negate() : sylvan::Mtbdd(dds[ddIndex]));
1141 groups.push_back(std::move(newGroup));
1143 std::vector<MTBDD> thenSubDds(dds), elseSubDds(dds);
1145 for (uint64_t ddIndex = 0; ddIndex < dds.size(); ++ddIndex) {
1146 auto const& dd = dds[ddIndex];
1147 if (!mtbdd_isleaf(dd) && ddGroupVariableIndices[currentLevel] == mtbdd_getvar(dd)) {
1148 MTBDD ddThenNode = mtbdd_gethigh(dd);
1149 MTBDD ddElseNode = mtbdd_getlow(dd);
1150 thenSubDds[ddIndex] = mtbdd_regular(ddThenNode);
1151 elseSubDds[ddIndex] = mtbdd_regular(ddElseNode);
1153 thenNegatedSubDds.set(ddIndex, mtbdd_hascomp(ddThenNode) ^ negatedDds.
get(ddIndex));
1154 elseNegatedSubDds.set(ddIndex, mtbdd_hascomp(ddElseNode) ^ negatedDds.
get(ddIndex));
1157 splitIntoGroupsRec(thenSubDds, thenNegatedSubDds, groups, ddGroupVariableIndices, currentLevel + 1, maxLevel);
1158 splitIntoGroupsRec(elseSubDds, elseNegatedSubDds, groups, ddGroupVariableIndices, currentLevel + 1, maxLevel);
1162template<
typename ValueType>
1163void InternalAdd<DdType::Sylvan, ValueType>::toMatrixComponents(std::vector<uint_fast64_t>
const& rowGroupIndices, std::vector<uint_fast64_t>& rowIndications,
1165 Odd
const& rowOdd, Odd
const& columnOdd, std::vector<uint_fast64_t>
const& ddRowVariableIndices,
1166 std::vector<uint_fast64_t>
const& ddColumnVariableIndices,
bool writeValues)
const {
1167 return toMatrixComponentsRec(mtbdd_regular(this->getSylvanMtbdd().GetMTBDD()), mtbdd_hascomp(this->getSylvanMtbdd().GetMTBDD()), rowGroupIndices,
1168 rowIndications, columnsAndValues, rowOdd, columnOdd, 0, 0, ddRowVariableIndices.size() + ddColumnVariableIndices.size(), 0, 0,
1169 ddRowVariableIndices, ddColumnVariableIndices, writeValues);
1172template<
typename ValueType>
1173void InternalAdd<DdType::Sylvan, ValueType>::toMatrixComponentsRec(MTBDD dd,
bool negated, std::vector<uint_fast64_t>
const& rowGroupOffsets,
1174 std::vector<uint_fast64_t>& rowIndications,
1176 Odd
const& rowOdd, Odd
const& columnOdd, uint_fast64_t currentRowLevel,
1177 uint_fast64_t currentColumnLevel, uint_fast64_t maxLevel, uint_fast64_t currentRowOffset,
1178 uint_fast64_t currentColumnOffset, std::vector<uint_fast64_t>
const& ddRowVariableIndices,
1179 std::vector<uint_fast64_t>
const& ddColumnVariableIndices,
bool generateValues)
const {
1181 if (mtbdd_isleaf(dd) && mtbdd_iszero(dd)) {
1186 if (currentRowLevel + currentColumnLevel == maxLevel) {
1187 if (generateValues) {
1188 columnsAndValues[rowIndications[rowGroupOffsets[currentRowOffset]]] =
1191 ++rowIndications[rowGroupOffsets[currentRowOffset]];
1198 if (mtbdd_isleaf(dd) || ddColumnVariableIndices[currentColumnLevel] < mtbdd_getvar(dd)) {
1199 elseElse = elseThen = thenElse = thenThen = dd;
1200 }
else if (ddRowVariableIndices[currentColumnLevel] < mtbdd_getvar(dd)) {
1201 elseElse = thenElse = mtbdd_getlow(dd);
1202 elseThen = thenThen = mtbdd_gethigh(dd);
1204 MTBDD elseNode = mtbdd_getlow(dd);
1205 if (mtbdd_isleaf(elseNode) || ddColumnVariableIndices[currentColumnLevel] < mtbdd_getvar(elseNode)) {
1206 elseElse = elseThen = elseNode;
1208 elseElse = mtbdd_getlow(elseNode);
1209 elseThen = mtbdd_gethigh(elseNode);
1212 MTBDD thenNode = mtbdd_gethigh(dd);
1213 if (mtbdd_isleaf(thenNode) || ddColumnVariableIndices[currentColumnLevel] < mtbdd_getvar(thenNode)) {
1214 thenElse = thenThen = thenNode;
1216 thenElse = mtbdd_getlow(thenNode);
1217 thenThen = mtbdd_gethigh(thenNode);
1222 toMatrixComponentsRec(mtbdd_regular(elseElse), mtbdd_hascomp(elseElse) ^ negated, rowGroupOffsets, rowIndications, columnsAndValues,
1223 rowOdd.getElseSuccessor(), columnOdd.getElseSuccessor(), currentRowLevel + 1, currentColumnLevel + 1, maxLevel, currentRowOffset,
1224 currentColumnOffset, ddRowVariableIndices, ddColumnVariableIndices, generateValues);
1226 toMatrixComponentsRec(mtbdd_regular(elseThen), mtbdd_hascomp(elseThen) ^ negated, rowGroupOffsets, rowIndications, columnsAndValues,
1227 rowOdd.getElseSuccessor(), columnOdd.getThenSuccessor(), currentRowLevel + 1, currentColumnLevel + 1, maxLevel, currentRowOffset,
1228 currentColumnOffset + columnOdd.getElseOffset(), ddRowVariableIndices, ddColumnVariableIndices, generateValues);
1230 toMatrixComponentsRec(mtbdd_regular(thenElse), mtbdd_hascomp(thenElse) ^ negated, rowGroupOffsets, rowIndications, columnsAndValues,
1231 rowOdd.getThenSuccessor(), columnOdd.getElseSuccessor(), currentRowLevel + 1, currentColumnLevel + 1, maxLevel,
1232 currentRowOffset + rowOdd.getElseOffset(), currentColumnOffset, ddRowVariableIndices, ddColumnVariableIndices, generateValues);
1234 toMatrixComponentsRec(mtbdd_regular(thenThen), mtbdd_hascomp(thenThen) ^ negated, rowGroupOffsets, rowIndications, columnsAndValues,
1235 rowOdd.getThenSuccessor(), columnOdd.getThenSuccessor(), currentRowLevel + 1, currentColumnLevel + 1, maxLevel,
1236 currentRowOffset + rowOdd.getElseOffset(), currentColumnOffset + columnOdd.getElseOffset(), ddRowVariableIndices,
1237 ddColumnVariableIndices, generateValues);
1241template<
typename ValueType>
1242InternalAdd<DdType::Sylvan, ValueType> InternalAdd<DdType::Sylvan, ValueType>::fromVector(InternalDdManager<DdType::Sylvan>
const* ddManager,
1244 std::vector<uint_fast64_t>
const& ddVariableIndices) {
1245 uint_fast64_t offset = 0;
1246 return InternalAdd<DdType::Sylvan, ValueType>(ddManager, sylvan::Mtbdd(fromVectorRec(offset, 0, ddVariableIndices.size(), values, odd, ddVariableIndices)));
1249template<
typename ValueType>
1250MTBDD InternalAdd<DdType::Sylvan, ValueType>::fromVectorRec(uint_fast64_t& currentOffset, uint_fast64_t currentLevel, uint_fast64_t maxLevel,
1251 std::vector<ValueType>
const& values, Odd
const& odd,
1252 std::vector<uint_fast64_t>
const& ddVariableIndices) {
1253 if (currentLevel == maxLevel) {
1257 if (odd.getThenOffset() > 0) {
1258 return getLeaf(values[currentOffset++]);
1264 if (odd.getThenOffset() + odd.getElseOffset() == 0) {
1269 MTBDD elseSuccessor;
1270 if (odd.getElseOffset() > 0) {
1271 elseSuccessor = fromVectorRec(currentOffset, currentLevel + 1, maxLevel, values, odd.getElseSuccessor(), ddVariableIndices);
1275 mtbdd_refs_push(elseSuccessor);
1278 MTBDD thenSuccessor;
1279 if (odd.getThenOffset() > 0) {
1280 thenSuccessor = fromVectorRec(currentOffset, currentLevel + 1, maxLevel, values, odd.getThenSuccessor(), ddVariableIndices);
1284 mtbdd_refs_push(thenSuccessor);
1287 MTBDD currentVar = mtbdd_makenode(ddVariableIndices[currentLevel], mtbdd_false, mtbdd_true);
1288 mtbdd_refs_push(thenSuccessor);
1289#pragma clang diagnostic push
1290#pragma clang diagnostic ignored "-Wextra-semi-stmt"
1291#pragma clang diagnostic ignored "-Wused-but-marked-unused"
1292 MTBDD result = mtbdd_ite(currentVar, thenSuccessor, elseSuccessor);
1293#pragma clang diagnostic pop
1302template<
typename ValueType>
1303MTBDD InternalAdd<DdType::Sylvan, ValueType>::getLeaf(
double value) {
1304 return mtbdd_double(value);
1307template<
typename ValueType>
1308MTBDD InternalAdd<DdType::Sylvan, ValueType>::getLeaf(uint_fast64_t value) {
1309 return mtbdd_int64(value);
1312template<
typename ValueType>
1314 storm_rational_function_ptr ptr = (storm_rational_function_ptr)(&value);
1315 return mtbdd_storm_rational_function(ptr);
1318template<
typename ValueType>
1319MTBDD InternalAdd<DdType::Sylvan, ValueType>::getLeaf(storm::RationalNumber
const& value) {
1320 storm_rational_function_ptr ptr = (storm_rational_number_ptr)(&value);
1321 return mtbdd_storm_rational_number(ptr);
1324template<
typename ValueType>
1325sylvan::Mtbdd InternalAdd<DdType::Sylvan, ValueType>::getSylvanMtbdd()
const {
1329template<
typename ValueType>
1330std::string InternalAdd<DdType::Sylvan, ValueType>::getStringId()
const {
1331 std::stringstream ss;
1332 ss << this->getSylvanMtbdd().GetMTBDD();
1337template<
typename ValueType>
1340 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1341 "version of Storm with Sylvan support.");
1344template<
typename ValueType>
1347 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1348 "version of Storm with Sylvan support.");
1351template<
typename ValueType>
1354 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1355 "version of Storm with Sylvan support.");
1358template<
typename ValueType>
1361 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1362 "version of Storm with Sylvan support.");
1365template<
typename ValueType>
1368 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1369 "version of Storm with Sylvan support.");
1372template<
typename ValueType>
1375 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1376 "version of Storm with Sylvan support.");
1379template<
typename ValueType>
1382 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1383 "version of Storm with Sylvan support.");
1386template<
typename ValueType>
1389 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1390 "version of Storm with Sylvan support.");
1393template<
typename ValueType>
1396 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1397 "version of Storm with Sylvan support.");
1400template<
typename ValueType>
1403 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1404 "version of Storm with Sylvan support.");
1407template<
typename ValueType>
1410 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1411 "version of Storm with Sylvan support.");
1414template<
typename ValueType>
1417 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1418 "version of Storm with Sylvan support.");
1421template<
typename ValueType>
1424 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1425 "version of Storm with Sylvan support.");
1428template<
typename ValueType>
1431 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1432 "version of Storm with Sylvan support.");
1435template<
typename ValueType>
1438 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1439 "version of Storm with Sylvan support.");
1442template<
typename ValueType>
1445 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1446 "version of Storm with Sylvan support.");
1449template<
typename ValueType>
1452 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1453 "version of Storm with Sylvan support.");
1456template<
typename ValueType>
1459 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1460 "version of Storm with Sylvan support.");
1463template<
typename ValueType>
1466 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1467 "version of Storm with Sylvan support.");
1470template<
typename ValueType>
1473 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1474 "version of Storm with Sylvan support.");
1477template<
typename ValueType>
1480 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1481 "version of Storm with Sylvan support.");
1484template<
typename ValueType>
1487 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1488 "version of Storm with Sylvan support.");
1491template<
typename ValueType>
1494 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1495 "version of Storm with Sylvan support.");
1498template<
typename ValueType>
1501 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1502 "version of Storm with Sylvan support.");
1505template<
typename ValueType>
1508 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1509 "version of Storm with Sylvan support.");
1512template<
typename ValueType>
1513template<
typename TargetValueType>
1516 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1517 "version of Storm with Sylvan support.");
1523 STORM_LOG_THROW(
false, storm::exceptions::InvalidOperationException,
"Cannot convert this ADD to the target type.");
1529 STORM_LOG_THROW(
false, storm::exceptions::InvalidOperationException,
"Cannot convert this ADD to the target type.");
1535 STORM_LOG_THROW(
false, storm::exceptions::InvalidOperationException,
"Cannot convert this ADD to the target type.");
1538template<
typename ValueType>
1541 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1542 "version of Storm with Sylvan support.");
1545template<
typename ValueType>
1548 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1549 "version of Storm with Sylvan support.");
1552template<
typename ValueType>
1555 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1556 "version of Storm with Sylvan support.");
1559template<
typename ValueType>
1562 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1563 "version of Storm with Sylvan support.");
1566template<
typename ValueType>
1569 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1570 "version of Storm with Sylvan support.");
1573template<
typename ValueType>
1575 bool relative)
const {
1577 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1578 "version of Storm with Sylvan support.");
1581template<
typename ValueType>
1585 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1586 "version of Storm with Sylvan support.");
1589template<
typename ValueType>
1593 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1594 "version of Storm with Sylvan support.");
1597template<
typename ValueType>
1601 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1602 "version of Storm with Sylvan support.");
1605template<
typename ValueType>
1609 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1610 "version of Storm with Sylvan support.");
1613template<
typename ValueType>
1616 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1617 "version of Storm with Sylvan support.");
1620template<
typename ValueType>
1623 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1624 "version of Storm with Sylvan support.");
1627template<
typename ValueType>
1630 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1631 "version of Storm with Sylvan support.");
1634template<
typename ValueType>
1637 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1638 "version of Storm with Sylvan support.");
1641template<
typename ValueType>
1644 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1645 "version of Storm with Sylvan support.");
1648template<
typename ValueType>
1651 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1652 "version of Storm with Sylvan support.");
1655template<
typename ValueType>
1658 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1659 "version of Storm with Sylvan support.");
1662template<
typename ValueType>
1665 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1666 "version of Storm with Sylvan support.");
1669template<
typename ValueType>
1672 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1673 "version of Storm with Sylvan support.");
1676template<
typename ValueType>
1679 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1680 "version of Storm with Sylvan support.");
1683template<
typename ValueType>
1686 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1687 "version of Storm with Sylvan support.");
1690template<
typename ValueType>
1693 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1694 "version of Storm with Sylvan support.");
1697template<
typename ValueType>
1700 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1701 "version of Storm with Sylvan support.");
1704template<
typename ValueType>
1707 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1708 "version of Storm with Sylvan support.");
1711template<
typename ValueType>
1714 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1715 "version of Storm with Sylvan support.");
1718template<
typename ValueType>
1721 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1722 "version of Storm with Sylvan support.");
1725template<
typename ValueType>
1728 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1729 "version of Storm with Sylvan support.");
1732template<
typename ValueType>
1735 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1736 "version of Storm with Sylvan support.");
1739template<
typename ValueType>
1742 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1743 "version of Storm with Sylvan support.");
1746template<
typename ValueType>
1749 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1750 "version of Storm with Sylvan support.");
1753template<
typename ValueType>
1756 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1757 "version of Storm with Sylvan support.");
1760template<
typename ValueType>
1763 uint_fast64_t numberOfDdVariables,
1764 std::set<storm::expressions::Variable>
const& metaVariables,
1765 bool enumerateDontCareMetaVariables)
const {
1767 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1768 "version of Storm with Sylvan support.");
1771template<
typename ValueType>
1774 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1775 "version of Storm with Sylvan support.");
1778template<
typename ValueType>
1781 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1782 "version of Storm with Sylvan support.");
1785template<
typename ValueType>
1788 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1789 "version of Storm with Sylvan support.");
1792template<
typename ValueType>
1794 std::vector<ValueType>& targetVector,
1795 std::function<ValueType(ValueType
const&, ValueType
const&)>
const& function)
const {
1797 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1798 "version of Storm with Sylvan support.");
1801template<
typename ValueType>
1803 std::vector<uint_fast64_t>
const& offsets, std::vector<ValueType>& targetVector,
1804 std::function<ValueType(ValueType
const&, ValueType
const&)>
const& function)
const {
1806 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1807 "version of Storm with Sylvan support.");
1810template<
typename ValueType>
1812 std::function<
void(uint64_t
const&, ValueType
const&)>
const& function)
const {
1814 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1815 "version of Storm with Sylvan support.");
1818template<
typename ValueType>
1822 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1823 "version of Storm with Sylvan support.");
1826template<
typename ValueType>
1828 std::vector<uint_fast64_t>
const& ddGroupVariableIndices)
const {
1830 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1831 "version of Storm with Sylvan support.");
1834template<
typename ValueType>
1838 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1839 "version of Storm with Sylvan support.");
1842template<
typename ValueType>
1846 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1847 "version of Storm with Sylvan support.");
1850template<
typename ValueType>
1853 Odd const& rowOdd,
Odd const& columnOdd, std::vector<uint_fast64_t>
const& ddRowVariableIndices,
1854 std::vector<uint_fast64_t>
const& ddColumnVariableIndices,
bool writeValues)
const {
1856 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1857 "version of Storm with Sylvan support.");
1860template<
typename ValueType>
1863 std::vector<uint_fast64_t>
const& ddVariableIndices) {
1865 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1866 "version of Storm with Sylvan support.");
1869template<
typename ValueType>
1872 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1873 "version of Storm with Sylvan support.");
InternalAdd< DdType::Sylvan, double > toValueType() const
InternalBdd< DdType::CUDD > lessOrEqual(storm::RationalNumber const &value) const
InternalBdd< DdType::CUDD > greaterOrEqual(storm::RationalNumber const &value) const
bool equalModuloPrecision(InternalAdd< DdType::CUDD, storm::RationalNumber > const &, storm::RationalNumber const &, bool) const
InternalBdd< DdType::CUDD > less(storm::RationalNumber const &value) const
InternalBdd< DdType::CUDD > greater(storm::RationalNumber const &value) const
A bit vector that is internally represented as a vector of 64-bit values.
bool get(uint64_t index) const
Retrieves the truth value of the bit at the given index and performs a bound check.
#define STORM_LOG_ERROR(message)
#define STORM_LOG_ASSERT(cond, message)
#define STORM_LOG_THROW(cond, exception, message)
SFTBDDChecker::ValueType ValueType
carl::RationalFunction< Polynomial, true > RationalFunction