Storm
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
PrismMenuGameAbstractor.h
Go to the documentation of this file.
1#pragma once
2
4
11
13
15
17
18namespace storm {
19namespace utility {
20namespace solver {
21class SmtSolverFactory;
22}
23} // namespace utility
24
25namespace models {
26namespace symbolic {
27template<storm::dd::DdType Type, typename ValueType>
28class StochasticTwoPlayerGame;
29}
30} // namespace models
31
32namespace prism {
33// Forward-declare concrete Program class.
34class Program;
35} // namespace prism
36} // namespace storm
37
38namespace storm::gbar {
39namespace abstraction {
40namespace prism {
41
42template<storm::dd::DdType DdType, typename ValueType>
43class PrismMenuGameAbstractor : public MenuGameAbstractor<DdType, ValueType> {
44 public:
51 PrismMenuGameAbstractor(storm::prism::Program const& program, std::shared_ptr<storm::utility::solver::SmtSolverFactory> const& smtSolverFactory,
53
58
59 storm::dd::DdManager<DdType> const& getDdManager() const override;
60
67
74
81 storm::expressions::Expression const& getGuard(uint64_t player1Choice) const override;
82
86 virtual uint64_t getNumberOfUpdates(uint64_t player1Choice) const override;
87
92 std::map<storm::expressions::Variable, storm::expressions::Expression> getVariableUpdates(uint64_t player1Choice, uint64_t auxiliaryChoice) const override;
93
97 virtual std::set<storm::expressions::Variable> const& getAssignedVariables(uint64_t player1Choice) const override;
98
102 std::pair<uint64_t, uint64_t> getPlayer1ChoiceRange() const override;
103
108
110
116 virtual void refine(RefinementCommand const& command) override;
117
125 virtual void exportToDot(std::string const& filename, storm::dd::Bdd<DdType> const& highlightStates, storm::dd::Bdd<DdType> const& filter) const override;
126
127 virtual uint64_t getNumberOfPredicates() const override;
128
129 virtual void addTerminalStates(storm::expressions::Expression const& expression) override;
130
131 virtual void notifyGuardsArePredicates() override;
132
133 protected:
134 using MenuGameAbstractor<DdType, ValueType>::exportToDot;
135
136 private:
142 std::unique_ptr<MenuGame<DdType, ValueType>> buildGame();
143
150 std::map<uint_fast64_t, storm::storage::BitVector> decodeChoiceToUpdateSuccessorMapping(storm::dd::Bdd<DdType> const& choice) const;
151
152 // The concrete program this abstract program refers to.
153 std::reference_wrapper<storm::prism::Program const> program;
154
155 // A factory that can be used to create new SMT solvers.
156 std::shared_ptr<storm::utility::solver::SmtSolverFactory> smtSolverFactory;
157
158 // An object containing all information about the abstraction like predicates and the corresponding DDs.
159 AbstractionInformation<DdType> abstractionInformation;
160
161 // The abstract modules of the abstract program.
162 std::vector<ModuleAbstractor<DdType, ValueType>> modules;
163
164 // A state-set abstractor used to determine the initial states of the abstraction.
165 StateSetAbstractor<DdType, ValueType> initialStateAbstractor;
166
167 // A flag indicating whether the valid blocks need to be computed and the game restricted to these.
168 bool restrictToValidBlocks;
169
170 // An object that is used to compute the valid blocks.
171 ValidBlockAbstractor<DdType> validBlockAbstractor;
172
173 // An ADD characterizing the probabilities of commands and their updates.
174 storm::dd::Add<DdType, ValueType> commandUpdateProbabilitiesAdd;
175
176 // The current game-based abstraction.
177 std::unique_ptr<MenuGame<DdType, ValueType>> currentGame;
178
179 // A flag storing whether a refinement was performed.
180 bool refinementPerformed;
181
182 // A list of terminal state expressions.
183 std::vector<storm::expressions::Expression> terminalStateExpressions;
184};
185} // namespace prism
186} // namespace abstraction
187} // namespace storm::gbar
This class represents a discrete-time stochastic two-player game.
Definition MenuGame.h:16
virtual void exportToDot(std::string const &filename, storm::dd::Bdd< DdType > const &highlightStates, storm::dd::Bdd< DdType > const &filter) const override
Exports the current state of the abstraction in the dot format to the given file.
PrismMenuGameAbstractor(PrismMenuGameAbstractor const &)=default
PrismMenuGameAbstractor & operator=(PrismMenuGameAbstractor &&)=default
virtual uint64_t getNumberOfPredicates() const override
Retrieves the number of predicates currently in use.
virtual void notifyGuardsArePredicates() override
Notifies the abstractor that the guards are predicates, which may be used to improve the bottom state...
AbstractionInformation< DdType > const & getAbstractionInformation() const override
Retrieves information about the abstraction.
std::map< storm::expressions::Variable, storm::expressions::Expression > getVariableUpdates(uint64_t player1Choice, uint64_t auxiliaryChoice) const override
Retrieves a mapping from variables to expressions that define their updates wrt.
PrismMenuGameAbstractor(PrismMenuGameAbstractor &&)=default
virtual uint64_t getNumberOfUpdates(uint64_t player1Choice) const override
Retrieves the number of updates of the specified player 1 choice.
storm::expressions::Expression const & getGuard(uint64_t player1Choice) const override
Retrieves the guard predicate of the given player 1 choice.
std::pair< uint64_t, uint64_t > getPlayer1ChoiceRange() const override
Retrieves the range of player 1 choices.
virtual void refine(RefinementCommand const &command) override
Performs the given refinement command.
MenuGame< DdType, ValueType > abstract() override
Uses the current set of predicates to derive the abstract menu game in the form of an ADD.
storm::expressions::Expression getInitialExpression() const override
Retrieves the expression that characterizes the initial states.
storm::dd::DdManager< DdType > const & getDdManager() const override
storm::dd::Bdd< DdType > getStates(storm::expressions::Expression const &expression) override
Retrieves a BDD that characterizes the states corresponding to the given expression.
PrismMenuGameAbstractor & operator=(PrismMenuGameAbstractor const &)=default
virtual void addTerminalStates(storm::expressions::Expression const &expression) override
Adds the expression to the ones characterizing terminal states, i.e.
virtual std::set< storm::expressions::Variable > const & getAssignedVariables(uint64_t player1Choice) const override
Retrieves the variables assigned by the given player 1 choice.
LabParser.cpp.
Definition cli.cpp:18