#pragma once #include #include "storm/models/symbolic/StochasticTwoPlayerGame.h" #include "storm/utility/OsDetection.h" namespace storm { namespace abstraction { /*! * This class represents a discrete-time stochastic two-player game. */ template class MenuGame : public storm::models::symbolic::StochasticTwoPlayerGame { public: typedef typename storm::models::symbolic::StochasticTwoPlayerGame::RewardModelType RewardModelType; MenuGame(MenuGame const& other) = default; MenuGame& operator=(MenuGame const& other) = default; MenuGame(MenuGame&& other) = default; MenuGame& operator=(MenuGame&& other) = default; /*! * Constructs a model from the given data. * * @param manager The manager responsible for the decision diagrams. * @param reachableStates The reachable states of the model. * @param initialStates The initial states of the model. * @param deadlockStates The deadlock states of the model. * @param transitionMatrix The matrix representing the transitions in the model. * @param bottomStates The bottom states of the model. * @param rowVariables The set of row meta variables used in the DDs. * @param columVariables The set of column meta variables used in the DDs. * @param rowColumnMetaVariablePairs All pairs of row/column meta variables. * @param player1Variables The meta variables used to encode the nondeterministic choices of player 1. * @param player2Variables The meta variables used to encode the nondeterministic choices of player 2. * @param allNondeterminismVariables The meta variables used to encode the nondeterminism in the model. * @param probabilisticBranchingVariables The variables used to encode probabilistic branching. * @param expressionToBddMap A mapping from expressions (used) in the abstraction to the BDDs encoding * them. */ MenuGame(std::shared_ptr> manager, storm::dd::Bdd reachableStates, storm::dd::Bdd initialStates, storm::dd::Bdd deadlockStates, storm::dd::Add transitionMatrix, storm::dd::Bdd bottomStates, std::set const& rowVariables, std::set const& columnVariables, std::vector> const& rowColumnMetaVariablePairs, std::set const& player1Variables, std::set const& player2Variables, std::set const& allNondeterminismVariables, std::set const& probabilisticBranchingVariables, std::map> const& expressionToBddMap); virtual storm::dd::Bdd getStates(std::string const& label) const override; /*! * Returns the set of states satisfying the given expression (that must be of boolean type). Note that * for menu games, the given expression must be a predicate that was used to build the abstract game. * * @param expression The expression that needs to hold in the states. * @return The set of states satisfying the given expression. */ virtual storm::dd::Bdd getStates(storm::expressions::Expression const& expression) const override; /*! * Returns the set of states satisfying the given expression (that must be of boolean type). Note that * for menu games, the given expression must be a predicate that was used to build the abstract game. * * @param expression The expression that needs to hold in the states. * @param negated If set to true, the result is the set of states not satisfying the expression. * @return The set of states labeled satisfying the given expression. */ storm::dd::Bdd getStates(storm::expressions::Expression const& expression, bool negated) const; /*! * Retrieves the bottom states of the model. * * @return The bottom states of the model. */ storm::dd::Bdd getBottomStates() const; /*! * Retrieves the transition matrix extended by variables that encode additional information for the * probabilistic branching. * * @reutrn Th extended transition matrix. */ storm::dd::Add const& getExtendedTransitionMatrix() const; /*! * Retrieves the variables used to encode additional information for the probabilistic branching in the * extended transition matrix. * * @return The probabilistic branching variables. */ std::set const& getProbabilisticBranchingVariables() const; virtual bool hasLabel(std::string const& label) const override; private: // The transition relation extended byt the probabilistic branching variables. storm::dd::Add extendedTransitionMatrix; // The meta variables used to probabilistic branching. std::set probabilisticBranchingVariables; // A mapping from expressions that were used in the abstraction process to the the BDDs representing them. std::map> expressionToBddMap; // The bottom states of the model. storm::dd::Bdd bottomStates; }; } }