45#ifdef STORM_HAVE_SYLVAN
52 InternalAdd(InternalDdManager<DdType::Sylvan> const* ddManager, sylvan::Mtbdd const& sylvanMtbdd);
57 InternalAdd(InternalAdd<DdType::Sylvan, ValueType> const& other) = default;
58 InternalAdd& operator=(InternalAdd<DdType::Sylvan, ValueType> const& other) = default;
59 InternalAdd(InternalAdd<DdType::Sylvan, ValueType>&& other) = default;
60 InternalAdd& operator=(InternalAdd<DdType::Sylvan, ValueType>&& other) = default;
69 bool operator==(InternalAdd<DdType::Sylvan, ValueType> const& other) const;
77 bool operator!=(InternalAdd<DdType::Sylvan, ValueType> const& other) const;
85 InternalAdd<DdType::Sylvan, ValueType> operator+(InternalAdd<DdType::Sylvan, ValueType> const& other) const;
93 InternalAdd<DdType::Sylvan, ValueType>& operator+=(InternalAdd<DdType::Sylvan, ValueType> const& other);
101 InternalAdd<DdType::Sylvan, ValueType> operator*(InternalAdd<DdType::Sylvan, ValueType> const& other) const;
109 InternalAdd<DdType::Sylvan, ValueType>& operator*=(InternalAdd<DdType::Sylvan, ValueType> const& other);
117 InternalAdd<DdType::Sylvan, ValueType> operator-(InternalAdd<DdType::Sylvan, ValueType> const& other) const;
125 InternalAdd<DdType::Sylvan, ValueType>& operator-=(InternalAdd<DdType::Sylvan, ValueType> const& other);
133 InternalAdd<DdType::Sylvan, ValueType> operator/(InternalAdd<DdType::Sylvan, ValueType> const& other) const;
141 InternalAdd<DdType::Sylvan, ValueType>& operator/=(InternalAdd<DdType::Sylvan, ValueType> const& other);
149 InternalBdd<DdType::Sylvan> equals(InternalAdd<DdType::Sylvan, ValueType> const& other) const;
157 InternalBdd<DdType::Sylvan> notEquals(InternalAdd<DdType::Sylvan, ValueType> const& other) const;
166 InternalBdd<DdType::Sylvan>
less(InternalAdd<DdType::Sylvan, ValueType> const& other) const;
184 InternalBdd<DdType::Sylvan>
greater(InternalAdd<DdType::Sylvan, ValueType> const& other) const;
201 InternalAdd<DdType::Sylvan, ValueType> pow(InternalAdd<DdType::Sylvan, ValueType> const& other) const;
209 InternalAdd<DdType::Sylvan, ValueType> mod(InternalAdd<DdType::Sylvan, ValueType> const& other) const;
218 InternalAdd<DdType::Sylvan, ValueType> logxy(InternalAdd<DdType::Sylvan, ValueType> const& other) const;
225 InternalAdd<DdType::Sylvan, ValueType> floor() const;
232 InternalAdd<DdType::Sylvan, ValueType> ceil() const;
239 InternalAdd<DdType::Sylvan, storm::RationalNumber> sharpenKwekMehlhorn(size_t precision) const;
247 InternalAdd<DdType::Sylvan, ValueType> minimum(InternalAdd<DdType::Sylvan, ValueType> const& other) const;
255 InternalAdd<DdType::Sylvan, ValueType> maximum(InternalAdd<DdType::Sylvan, ValueType> const& other) const;
262 template<typename TargetValueType>
270 InternalAdd<DdType::Sylvan, ValueType> sumAbstract(InternalBdd<DdType::Sylvan> const& cube) const;
277 InternalAdd<DdType::Sylvan, ValueType> minAbstract(InternalBdd<DdType::Sylvan> const& cube) const;
284 InternalBdd<DdType::Sylvan> minAbstractRepresentative(InternalBdd<DdType::Sylvan> const& cube) const;
291 InternalAdd<DdType::Sylvan, ValueType> maxAbstract(InternalBdd<DdType::Sylvan> const& cube) const;
298 InternalBdd<DdType::Sylvan> maxAbstractRepresentative(InternalBdd<DdType::Sylvan> const& cube) const;
309 bool
equalModuloPrecision(InternalAdd<DdType::Sylvan, ValueType> const& other, ValueType const& precision, bool relative = true) const;
319 InternalAdd<DdType::Sylvan, ValueType> swapVariables(std::vector<InternalBdd<DdType::Sylvan>> const& from,
320 std::vector<InternalBdd<DdType::Sylvan>> const& to) const;
330 InternalAdd<DdType::Sylvan, ValueType> permuteVariables(std::vector<InternalBdd<DdType::Sylvan>> const& from,
331 std::vector<InternalBdd<DdType::Sylvan>> const& to) const;
341 InternalAdd<DdType::Sylvan, ValueType> multiplyMatrix(InternalAdd<DdType::Sylvan, ValueType> const& otherMatrix,
342 std::vector<InternalBdd<DdType::Sylvan>> const& summationDdVariables) const;
352 InternalAdd<DdType::Sylvan, ValueType> multiplyMatrix(InternalBdd<DdType::Sylvan> const& otherMatrix,
353 std::vector<InternalBdd<DdType::Sylvan>> const& summationDdVariables) const;
407 InternalAdd<DdType::Sylvan, ValueType> constrain(InternalAdd<DdType::Sylvan, ValueType> const& constraint) const;
417 InternalAdd<DdType::Sylvan, ValueType> restrict(InternalAdd<DdType::Sylvan, ValueType> const& constraint) const;
432 virtual uint_fast64_t getNonZeroCount(uint_fast64_t numberOfDdVariables) const;
439 virtual uint_fast64_t getLeafCount() const;
446 virtual uint_fast64_t getNodeCount() const;
453 ValueType getMin() const;
460 ValueType getMax() const;
467 ValueType getValue() const;
488 bool isConstant() const;
495 uint_fast64_t getIndex() const;
502 uint_fast64_t getLevel() const;
510 void exportToDot(std::string const& filename, std::vector<std::string> const& ddVariableNamesAsStrings, bool showVariablesIfPossible = true) const;
517 void exportToText(std::string const& filename) const;
530 AddIterator<DdType::Sylvan, ValueType> begin(DdManager<DdType::Sylvan> const& fullDdManager, InternalBdd<DdType::Sylvan> const& variableCube,
531 uint_fast64_t numberOfDdVariables, std::set<storm::expressions::Variable> const& metaVariables,
532 bool enumerateDontCareMetaVariables = true) const;
540 AddIterator<DdType::Sylvan, ValueType> end(DdManager<DdType::Sylvan> const& fullDdManager) const;
552 void composeWithExplicitVector(Odd const& odd, std::vector<uint_fast64_t> const& ddVariableIndices, std::vector<ValueType>& targetVector,
553 std::function<ValueType(ValueType const&, ValueType const&)> const& function) const;
566 void composeWithExplicitVector(Odd const& odd, std::vector<uint_fast64_t> const& ddVariableIndices, std::vector<uint_fast64_t> const& offsets,
567 std::vector<ValueType>& targetVector, std::function<ValueType(ValueType const&, ValueType const&)> const& function) const;
579 void forEach(Odd const& odd, std::vector<uint_fast64_t> const& ddVariableIndices,
580 std::function<void(uint64_t const&, ValueType const&)> const& function) const;
588 std::vector<InternalAdd<DdType::Sylvan, ValueType>> splitIntoGroups(std::vector<uint_fast64_t> const& ddGroupVariableIndices) const;
598 std::vector<uint64_t> decodeGroupLabels(std::vector<uint_fast64_t> const& ddGroupVariableIndices,
599 storm::storage::BitVector const& ddLabelVariableIndices) const;
610 std::vector<std::pair<InternalAdd<DdType::Sylvan, ValueType>, InternalAdd<DdType::Sylvan, ValueType>>> splitIntoGroups(
611 InternalAdd<DdType::Sylvan, ValueType> vector, std::vector<uint_fast64_t> const& ddGroupVariableIndices) const;
622 std::vector<std::vector<InternalAdd<DdType::Sylvan, ValueType>>> splitIntoGroups(std::vector<InternalAdd<DdType::Sylvan, ValueType>> const& vectors,
623 std::vector<uint_fast64_t> const& ddGroupVariableIndices) const;
638 void toMatrixComponents(std::vector<uint_fast64_t> const& rowGroupIndices, std::vector<uint_fast64_t>& rowIndications,
639 std::vector<storm::storage::MatrixEntry<uint_fast64_t, ValueType>>& columnsAndValues, Odd const& rowOdd, Odd const& columnOdd,
640 std::vector<uint_fast64_t> const& ddRowVariableIndices, std::vector<uint_fast64_t> const& ddColumnVariableIndices,
641 bool writeValues) const;
651 static
InternalAdd<DdType::Sylvan, ValueType> fromVector(InternalDdManager<DdType::Sylvan> const* ddManager, std::vector<ValueType> const& values,
652 storm::dd::Odd const& odd, std::vector<uint_fast64_t> const& ddVariableIndices);
659 Odd createOdd(std::vector<uint_fast64_t> const& ddVariableIndices) const;
663#ifdef STORM_HAVE_SYLVAN
669 sylvan::Mtbdd getSylvanMtbdd() const;
676 static ValueType getValue(MTBDD const& node);
679 std::string getStringId() const;
682#ifdef STORM_HAVE_SYLVAN
694 static std::shared_ptr<Odd> createOddRec(BDD dd, uint_fast64_t currentLevel, uint_fast64_t maxLevel, std::vector<uint_fast64_t> const& ddVariableIndices,
695 std::vector<std::unordered_map<BDD, std::shared_ptr<Odd>>>& uniqueTableForLevels);
709 void forEachRec(MTBDD dd, uint_fast64_t currentLevel, uint_fast64_t maxLevel, uint_fast64_t currentOffset, Odd const& odd,
710 std::vector<uint_fast64_t> const& ddVariableIndices, std::function<void(uint64_t const&, ValueType const&)> const& function) const;
724 void decodeGroupLabelsRec(MTBDD dd, std::vector<uint64_t>& labels, std::vector<uint_fast64_t> const& ddGroupVariableIndices,
725 storm::storage::BitVector const& ddLabelVariableIndices, uint_fast64_t currentLevel, uint_fast64_t maxLevel,
726 uint64_t label) const;
738 void splitIntoGroupsRec(MTBDD dd, bool negated, std::vector<InternalAdd<DdType::Sylvan, ValueType>>& groups,
739 std::vector<uint_fast64_t> const& ddGroupVariableIndices, uint_fast64_t currentLevel, uint_fast64_t maxLevel) const;
753 void splitIntoGroupsRec(MTBDD dd1, bool negated1, MTBDD dd2, bool negated2,
754 std::vector<std::pair<InternalAdd<DdType::Sylvan, ValueType>, InternalAdd<DdType::Sylvan, ValueType>>>& groups,
755 std::vector<uint_fast64_t> const& ddGroupVariableIndices, uint_fast64_t currentLevel, uint_fast64_t maxLevel) const;
767 void splitIntoGroupsRec(std::vector<MTBDD> const& dds, storm::storage::BitVector const& negatedDds,
768 std::vector<std::vector<InternalAdd<DdType::Sylvan, ValueType>>>& groups, std::vector<uint_fast64_t> const& ddGroupVariableIndices,
769 uint_fast64_t currentLevel, uint_fast64_t maxLevel) const;
782 static MTBDD fromVectorRec(uint_fast64_t& currentOffset, uint_fast64_t currentLevel, uint_fast64_t maxLevel, std::vector<ValueType> const& values,
783 Odd const& odd, std::vector<uint_fast64_t> const& ddVariableIndices);
811 void toMatrixComponentsRec(MTBDD dd, bool negated, std::vector<uint_fast64_t> const& rowGroupOffsets, std::vector<uint_fast64_t>& rowIndications,
812 std::vector<storm::storage::MatrixEntry<uint_fast64_t, ValueType>>& columnsAndValues, Odd const& rowOdd, Odd const& columnOdd,
813 uint_fast64_t currentRowLevel, uint_fast64_t currentColumnLevel, uint_fast64_t maxLevel, uint_fast64_t currentRowOffset,
814 uint_fast64_t currentColumnOffset, std::vector<uint_fast64_t> const& ddRowVariableIndices,
815 std::vector<uint_fast64_t> const& ddColumnVariableIndices, bool writeValues) const;
822 static MTBDD getLeaf(double value);
829 static MTBDD getLeaf(uint_fast64_t value);
836 static MTBDD getLeaf(storm::RationalNumber const& value);
843 static MTBDD getLeaf(storm::RationalFunction const& value);
849 sylvan::Mtbdd sylvanMtbdd;