#pragma once #include "storm/generator/NextStateGenerator.h" #include "storm/utility/ConstantsComparator.h" #include "storm-dft/storage/dft/DFT.h" namespace storm { namespace generator { /*! * Next state generator for DFTs. */ template class DftNextStateGenerator { // TODO: inherit from NextStateGenerator using DFTStatePointer = std::shared_ptr>; using DFTElementPointer = std::shared_ptr>; using DFTGatePointer = std::shared_ptr>; using DFTRestrictionPointer = std::shared_ptr>; public: typedef std::function StateToIdCallback; DftNextStateGenerator(storm::storage::DFT const& dft, storm::storage::DFTStateGenerationInfo const& stateGenerationInfo, bool enableDC, bool mergeFailedStates); bool isDeterministicModel() const; std::vector getInitialStates(StateToIdCallback const& stateToIdCallback); void load(storm::storage::BitVector const& state); void load(DFTStatePointer const& state); StateBehavior expand(StateToIdCallback const& stateToIdCallback); /*! * Create unique failed state. * * @param stateToIdCallback Callback for state. The callback should just return the id and not use the state. * * @return Behavior of state. */ StateBehavior createMergeFailedState(StateToIdCallback const& stateToIdCallback); private: // The dft used for the generation of next states. storm::storage::DFT const& mDft; // General information for the state generation. storm::storage::DFTStateGenerationInfo const& mStateGenerationInfo; // Current state DFTStatePointer state; // Flag indicating if dont care propagation is enabled. bool enableDC; // Flag indication if all failed states should be merged into one. bool mergeFailedStates = true; // Id of the merged failed state StateType mergeFailedStateId = 0; // Flag indicating if the model is deterministic. bool deterministicModel = false; }; } }