18#ifdef STORM_HAVE_SYLVAN
19template<
typename ValueType>
20InternalAdd<DdType::Sylvan, ValueType>::InternalAdd() : ddManager(nullptr), sylvanMtbdd() {
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++]);
1260 return getLeaf(storm::utility::zero<ValueType>());
1264 if (odd.getThenOffset() + odd.getElseOffset() == 0) {
1265 return getLeaf(storm::utility::zero<ValueType>());
1269 MTBDD elseSuccessor;
1270 if (odd.getElseOffset() > 0) {
1271 elseSuccessor = fromVectorRec(currentOffset, currentLevel + 1, maxLevel, values, odd.getElseSuccessor(), ddVariableIndices);
1273 elseSuccessor = getLeaf(storm::utility::zero<ValueType>());
1275 mtbdd_refs_push(elseSuccessor);
1278 MTBDD thenSuccessor;
1279 if (odd.getThenOffset() > 0) {
1280 thenSuccessor = fromVectorRec(currentOffset, currentLevel + 1, maxLevel, values, odd.getThenSuccessor(), ddVariableIndices);
1282 thenSuccessor = getLeaf(storm::utility::zero<ValueType>());
1284 mtbdd_refs_push(thenSuccessor);
1287 MTBDD currentVar = mtbdd_makenode(ddVariableIndices[currentLevel], mtbdd_false, mtbdd_true);
1288 mtbdd_refs_push(thenSuccessor);
1289 MTBDD result = mtbdd_ite(currentVar, thenSuccessor, elseSuccessor);
1298template<
typename ValueType>
1299MTBDD InternalAdd<DdType::Sylvan, ValueType>::getLeaf(
double value) {
1300 return mtbdd_double(value);
1303template<
typename ValueType>
1304MTBDD InternalAdd<DdType::Sylvan, ValueType>::getLeaf(uint_fast64_t value) {
1305 return mtbdd_int64(value);
1308template<
typename ValueType>
1310 storm_rational_function_ptr ptr = (storm_rational_function_ptr)(&value);
1311 return mtbdd_storm_rational_function(ptr);
1314template<
typename ValueType>
1315MTBDD InternalAdd<DdType::Sylvan, ValueType>::getLeaf(storm::RationalNumber
const& value) {
1316 storm_rational_function_ptr ptr = (storm_rational_number_ptr)(&value);
1317 return mtbdd_storm_rational_number(ptr);
1320template<
typename ValueType>
1321sylvan::Mtbdd InternalAdd<DdType::Sylvan, ValueType>::getSylvanMtbdd()
const {
1325template<
typename ValueType>
1326std::string InternalAdd<DdType::Sylvan, ValueType>::getStringId()
const {
1327 std::stringstream ss;
1328 ss << this->getSylvanMtbdd().GetMTBDD();
1333template<
typename ValueType>
1336 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1337 "version of Storm with Sylvan support.");
1340template<
typename ValueType>
1343 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1344 "version of Storm with Sylvan support.");
1347template<
typename ValueType>
1350 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1351 "version of Storm with Sylvan support.");
1354template<
typename ValueType>
1357 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1358 "version of Storm with Sylvan support.");
1361template<
typename ValueType>
1364 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1365 "version of Storm with Sylvan support.");
1368template<
typename ValueType>
1371 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1372 "version of Storm with Sylvan support.");
1375template<
typename ValueType>
1378 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1379 "version of Storm with Sylvan support.");
1382template<
typename ValueType>
1385 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1386 "version of Storm with Sylvan support.");
1389template<
typename ValueType>
1392 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1393 "version of Storm with Sylvan support.");
1396template<
typename ValueType>
1399 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1400 "version of Storm with Sylvan support.");
1403template<
typename ValueType>
1406 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1407 "version of Storm with Sylvan support.");
1410template<
typename ValueType>
1413 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1414 "version of Storm with Sylvan support.");
1417template<
typename ValueType>
1420 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1421 "version of Storm with Sylvan support.");
1424template<
typename ValueType>
1427 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1428 "version of Storm with Sylvan support.");
1431template<
typename ValueType>
1434 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1435 "version of Storm with Sylvan support.");
1438template<
typename ValueType>
1441 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1442 "version of Storm with Sylvan support.");
1445template<
typename ValueType>
1448 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1449 "version of Storm with Sylvan support.");
1452template<
typename ValueType>
1455 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1456 "version of Storm with Sylvan support.");
1459template<
typename ValueType>
1462 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1463 "version of Storm with Sylvan support.");
1466template<
typename ValueType>
1469 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1470 "version of Storm with Sylvan support.");
1473template<
typename ValueType>
1476 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1477 "version of Storm with Sylvan support.");
1480template<
typename ValueType>
1483 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1484 "version of Storm with Sylvan support.");
1487template<
typename ValueType>
1490 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1491 "version of Storm with Sylvan support.");
1494template<
typename ValueType>
1497 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1498 "version of Storm with Sylvan support.");
1501template<
typename ValueType>
1504 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1505 "version of Storm with Sylvan support.");
1508template<
typename ValueType>
1509template<
typename TargetValueType>
1512 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1513 "version of Storm with Sylvan support.");
1519 STORM_LOG_THROW(
false, storm::exceptions::InvalidOperationException,
"Cannot convert this ADD to the target type.");
1525 STORM_LOG_THROW(
false, storm::exceptions::InvalidOperationException,
"Cannot convert this ADD to the target type.");
1531 STORM_LOG_THROW(
false, storm::exceptions::InvalidOperationException,
"Cannot convert this ADD to the target type.");
1534template<
typename ValueType>
1537 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1538 "version of Storm with Sylvan support.");
1541template<
typename ValueType>
1544 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1545 "version of Storm with Sylvan support.");
1548template<
typename ValueType>
1551 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1552 "version of Storm with Sylvan support.");
1555template<
typename ValueType>
1558 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1559 "version of Storm with Sylvan support.");
1562template<
typename ValueType>
1565 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1566 "version of Storm with Sylvan support.");
1569template<
typename ValueType>
1571 bool relative)
const {
1573 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1574 "version of Storm with Sylvan support.");
1577template<
typename ValueType>
1581 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1582 "version of Storm with Sylvan support.");
1585template<
typename ValueType>
1589 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1590 "version of Storm with Sylvan support.");
1593template<
typename ValueType>
1597 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1598 "version of Storm with Sylvan support.");
1601template<
typename ValueType>
1605 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1606 "version of Storm with Sylvan support.");
1609template<
typename ValueType>
1612 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1613 "version of Storm with Sylvan support.");
1616template<
typename ValueType>
1619 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1620 "version of Storm with Sylvan support.");
1623template<
typename ValueType>
1626 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1627 "version of Storm with Sylvan support.");
1630template<
typename ValueType>
1633 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1634 "version of Storm with Sylvan support.");
1637template<
typename ValueType>
1640 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1641 "version of Storm with Sylvan support.");
1644template<
typename ValueType>
1647 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1648 "version of Storm with Sylvan support.");
1651template<
typename ValueType>
1654 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1655 "version of Storm with Sylvan support.");
1658template<
typename ValueType>
1661 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1662 "version of Storm with Sylvan support.");
1665template<
typename ValueType>
1668 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1669 "version of Storm with Sylvan support.");
1672template<
typename ValueType>
1675 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1676 "version of Storm with Sylvan support.");
1679template<
typename ValueType>
1682 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1683 "version of Storm with Sylvan support.");
1686template<
typename ValueType>
1689 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1690 "version of Storm with Sylvan support.");
1693template<
typename ValueType>
1696 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1697 "version of Storm with Sylvan support.");
1700template<
typename ValueType>
1703 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1704 "version of Storm with Sylvan support.");
1707template<
typename ValueType>
1710 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1711 "version of Storm with Sylvan support.");
1714template<
typename ValueType>
1717 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1718 "version of Storm with Sylvan support.");
1721template<
typename ValueType>
1724 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1725 "version of Storm with Sylvan support.");
1728template<
typename ValueType>
1731 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1732 "version of Storm with Sylvan support.");
1735template<
typename ValueType>
1738 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1739 "version of Storm with Sylvan support.");
1742template<
typename ValueType>
1745 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1746 "version of Storm with Sylvan support.");
1749template<
typename ValueType>
1752 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1753 "version of Storm with Sylvan support.");
1756template<
typename ValueType>
1759 uint_fast64_t numberOfDdVariables,
1760 std::set<storm::expressions::Variable>
const& metaVariables,
1761 bool enumerateDontCareMetaVariables)
const {
1763 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1764 "version of Storm with Sylvan support.");
1767template<
typename ValueType>
1770 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1771 "version of Storm with Sylvan support.");
1774template<
typename ValueType>
1777 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1778 "version of Storm with Sylvan support.");
1781template<
typename ValueType>
1784 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1785 "version of Storm with Sylvan support.");
1788template<
typename ValueType>
1790 std::vector<ValueType>& targetVector,
1791 std::function<ValueType(ValueType
const&, ValueType
const&)>
const& function)
const {
1793 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1794 "version of Storm with Sylvan support.");
1797template<
typename ValueType>
1799 std::vector<uint_fast64_t>
const& offsets, std::vector<ValueType>& targetVector,
1800 std::function<ValueType(ValueType
const&, ValueType
const&)>
const& function)
const {
1802 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1803 "version of Storm with Sylvan support.");
1806template<
typename ValueType>
1808 std::function<
void(uint64_t
const&, ValueType
const&)>
const& function)
const {
1810 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1811 "version of Storm with Sylvan support.");
1814template<
typename ValueType>
1818 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1819 "version of Storm with Sylvan support.");
1822template<
typename ValueType>
1824 std::vector<uint_fast64_t>
const& ddGroupVariableIndices)
const {
1826 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1827 "version of Storm with Sylvan support.");
1830template<
typename ValueType>
1834 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1835 "version of Storm with Sylvan support.");
1838template<
typename ValueType>
1842 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1843 "version of Storm with Sylvan support.");
1846template<
typename ValueType>
1849 Odd const& rowOdd,
Odd const& columnOdd, std::vector<uint_fast64_t>
const& ddRowVariableIndices,
1850 std::vector<uint_fast64_t>
const& ddColumnVariableIndices,
bool writeValues)
const {
1852 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1853 "version of Storm with Sylvan support.");
1856template<
typename ValueType>
1859 std::vector<uint_fast64_t>
const& ddVariableIndices) {
1861 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1862 "version of Storm with Sylvan support.");
1865template<
typename ValueType>
1868 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
1869 "version of Storm with Sylvan support.");
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