#pragma once #include #include "src/storage/dd/DdType.h" #include "src/logic/Formula.h" #include "src/storage/jani/Model.h" namespace storm { namespace models { namespace symbolic { template class Model; } } namespace builder { template class DdJaniModelBuilder { public: struct Options { /*! * Creates an object representing the default building options. */ Options(bool buildAllLabels = false, bool buildAllRewardModels = false); /*! Creates an object representing the suggested building options assuming that the given formula is the * only one to check. Additional formulas may be preserved by calling preserveFormula. * * @param formula The formula based on which to choose the building options. */ Options(storm::logic::Formula const& formula); /*! Creates an object representing the suggested building options assuming that the given formulas are * the only ones to check. Additional formulas may be preserved by calling preserveFormula. * * @param formula Thes formula based on which to choose the building options. */ Options(std::vector> const& formulas); /*! * Changes the options in a way that ensures that the given formula can be checked on the model once it * has been built. * * @param formula The formula that is to be ''preserved''. */ void preserveFormula(storm::logic::Formula const& formula); /*! * Analyzes the given formula and sets an expression for the states states of the model that can be * treated as terminal states. Note that this may interfere with checking properties different than the * one provided. * * @param formula The formula used to (possibly) derive an expression for the terminal states of the * model. */ void setTerminalStatesFromFormula(storm::logic::Formula const& formula); /*! * Retrieves the names of the reward models to build. */ std::set const& getRewardModelNames() const; /*! * Adds the given label to the ones that are supposed to be built. */ void addLabel(std::string const& labelName); /*! * Retrieves whether the flag to build all labels is set. */ bool isBuildAllLabelsSet() const; /// A flag that indicates whether all labels are to be built. In this case, the label names are to be ignored. bool buildAllLabels; /// A set of labels to build. std::set labelNames; /*! * Retrieves whether the flag to build all reward models is set. */ bool isBuildAllRewardModelsSet() const; // A flag that indicates whether or not all reward models are to be build. bool buildAllRewardModels; // A list of reward models to be build in case not all reward models are to be build. std::set rewardModelsToBuild; // An optional mapping that, if given, contains defining expressions for undefined constants. boost::optional> constantDefinitions; // An optional expression or label that (a subset of) characterizes the terminal states of the model. // If this is set, the outgoing transitions of these states are replaced with a self-loop. boost::optional terminalStates; // An optional expression or label whose negation characterizes (a subset of) the terminal states of the // model. If this is set, the outgoing transitions of these states are replaced with a self-loop. boost::optional negatedTerminalStates; }; /*! * Translates the given program into a symbolic model (i.e. one that stores the transition relation as a * decision diagram). * * @param model The model to translate. * @return A pointer to the resulting model. */ std::shared_ptr> build(storm::jani::Model const& model, Options const& options = Options()); }; } }