Storm 1.14.0.1
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 {
22}
23} // namespace utility
24
25class Environment;
26
27namespace models {
28namespace symbolic {
29template<storm::dd::DdType Type, typename ValueType>
31}
32} // namespace models
33
34namespace prism {
35// Forward-declare concrete Program class.
36class Program;
37} // namespace prism
38} // namespace storm
39
40namespace storm::gbar {
41namespace abstraction {
42namespace prism {
43
44template<storm::dd::DdType DdType, typename ValueType>
45class PrismMenuGameAbstractor : public MenuGameAbstractor<DdType, ValueType> {
46 public:
55 std::shared_ptr<storm::utility::solver::SmtSolverFactory> const& smtSolverFactory,
57
62
63 storm::dd::DdManager<DdType> const& getDdManager() const override;
64
71
78
85 storm::expressions::Expression const& getGuard(uint64_t player1Choice) const override;
86
90 virtual uint64_t getNumberOfUpdates(uint64_t player1Choice) const override;
91
96 std::map<storm::expressions::Variable, storm::expressions::Expression> getVariableUpdates(uint64_t player1Choice, uint64_t auxiliaryChoice) const override;
97
101 virtual std::set<storm::expressions::Variable> const& getAssignedVariables(uint64_t player1Choice) const override;
102
106 std::pair<uint64_t, uint64_t> getPlayer1ChoiceRange() const override;
107
112
114
120 virtual void refine(RefinementCommand const& command) override;
121
129 virtual void exportToDot(std::string const& filename, storm::dd::Bdd<DdType> const& highlightStates, storm::dd::Bdd<DdType> const& filter) const override;
130
131 virtual uint64_t getNumberOfPredicates() const override;
132
133 virtual void addTerminalStates(storm::expressions::Expression const& expression) override;
134
135 virtual void notifyGuardsArePredicates() override;
136
137 protected:
138 using MenuGameAbstractor<DdType, ValueType>::exportToDot;
139
140 private:
146 std::unique_ptr<MenuGame<DdType, ValueType>> buildGame();
147
148 // The concrete program this abstract program refers to.
149 std::reference_wrapper<storm::prism::Program const> program;
150
151 // A factory that can be used to create new SMT solvers.
152 std::shared_ptr<storm::utility::solver::SmtSolverFactory> smtSolverFactory;
153
154 // An object containing all information about the abstraction like predicates and the corresponding DDs.
155 AbstractionInformation<DdType> abstractionInformation;
156
157 // The abstract modules of the abstract program.
158 std::vector<ModuleAbstractor<DdType, ValueType>> modules;
159
160 // A state-set abstractor used to determine the initial states of the abstraction.
161 StateSetAbstractor<DdType, ValueType> initialStateAbstractor;
162
163 // A flag indicating whether the valid blocks need to be computed and the game restricted to these.
164 bool restrictToValidBlocks;
165
166 // An object that is used to compute the valid blocks.
167 ValidBlockAbstractor<DdType> validBlockAbstractor;
168
169 // An ADD characterizing the probabilities of commands and their updates.
170 storm::dd::Add<DdType, ValueType> commandUpdateProbabilitiesAdd;
171
172 // The current game-based abstraction.
173 std::unique_ptr<MenuGame<DdType, ValueType>> currentGame;
174
175 // A flag storing whether a refinement was performed.
176 bool refinementPerformed;
177
178 // A list of terminal state expressions.
179 std::vector<storm::expressions::Expression> terminalStateExpressions;
180};
181} // namespace prism
182} // namespace abstraction
183} // namespace storm::gbar
This class represents a discrete-time stochastic two-player game.
Definition MenuGame.h:14
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.
PrismMenuGameAbstractor(storm::Environment const &env, storm::prism::Program const &program, std::shared_ptr< storm::utility::solver::SmtSolverFactory > const &smtSolverFactory, MenuGameAbstractorOptions const &options=MenuGameAbstractorOptions())
Constructs an abstractor for the given program.
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.
This class represents a discrete-time stochastic two-player game.