Storm
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
EdgeAbstractor.h
Go to the documentation of this file.
1#pragma once
2
3#include <map>
4#include <memory>
5#include <set>
6#include <vector>
7
11
13
16
18
19namespace storm {
20namespace utility {
21namespace solver {
23}
24} // namespace utility
25
26namespace dd {
27template<storm::dd::DdType DdType>
28class Bdd;
29
30template<storm::dd::DdType DdType, typename ValueType>
31class Add;
32} // namespace dd
33
34namespace jani {
35// Forward-declare concrete edge and assignment classes.
36class Edge;
37class Assignment;
38class OrderedAssignments;
39} // namespace jani
40} // namespace storm
41
42namespace storm::gbar {
43namespace abstraction {
44template<storm::dd::DdType DdType>
45class AbstractionInformation;
46
47template<storm::dd::DdType DdType>
48struct BottomStateResult;
49
50namespace jani {
51template<storm::dd::DdType DdType, typename ValueType>
53 public:
63 EdgeAbstractor(uint64_t edgeId, storm::jani::Edge const& edge, AbstractionInformation<DdType>& abstractionInformation,
64 std::shared_ptr<storm::utility::solver::SmtSolverFactory> const& smtSolverFactory, bool useDecomposition, bool addPredicatesForValidBlocks,
65 bool debug);
66
72 void refine(std::vector<uint_fast64_t> const& predicates);
73
78
82 uint64_t getNumberOfUpdates(uint64_t player1Choice) const;
83
88 std::map<storm::expressions::Variable, storm::expressions::Expression> getVariableUpdates(uint64_t auxiliaryChoice) const;
89
93 std::set<storm::expressions::Variable> const& getAssignedVariables() const;
94
102
111 storm::dd::Bdd<DdType> const& reachableStates, uint_fast64_t numberOfPlayer2Variables,
112 boost::optional<std::pair<storm::expressions::Variable, storm::expressions::Variable>> const& locationVariables);
113
122 boost::optional<std::pair<storm::expressions::Variable, storm::expressions::Variable>> const& locationVariables) const;
123
129 storm::jani::Edge const& getConcreteEdge() const;
130
132
133 private:
142 std::pair<std::set<uint_fast64_t>, std::set<uint_fast64_t>> computeRelevantPredicates(storm::jani::OrderedAssignments const& assignments) const;
143
150 std::pair<std::set<uint_fast64_t>, std::vector<std::set<uint_fast64_t>>> computeRelevantPredicates() const;
151
157 bool relevantPredicatesChanged(std::pair<std::set<uint_fast64_t>, std::vector<std::set<uint_fast64_t>>> const& newRelevantPredicates) const;
158
165 void addMissingPredicates(std::pair<std::set<uint_fast64_t>, std::vector<std::set<uint_fast64_t>>> const& newRelevantPredicates);
166
174 std::vector<std::pair<storm::expressions::Variable, uint_fast64_t>> const& variablePredicates) const;
175
183 std::vector<std::vector<std::pair<storm::expressions::Variable, uint_fast64_t>>> const& variablePredicates) const;
184
188 void recomputeCachedBdd();
189
193 void recomputeCachedBddWithoutDecomposition();
194
198 void recomputeCachedBddWithDecomposition();
199
206 storm::dd::Bdd<DdType> computeMissingDestinationIdentities() const;
207
213 AbstractionInformation<DdType> const& getAbstractionInformation() const;
214
220 AbstractionInformation<DdType>& getAbstractionInformation();
221
222 // An SMT responsible for this abstract command.
223 std::unique_ptr<storm::solver::SmtSolver> smtSolver;
224
225 // The abstraction-related information.
226 std::reference_wrapper<AbstractionInformation<DdType>> abstractionInformation;
227
228 // The ID of the edge.
229 uint64_t edgeId;
230
231 // The concrete edge this abstract command refers to.
232 std::reference_wrapper<storm::jani::Edge const> edge;
233
234 // The variables to which this edge assigns expressions.
235 std::set<storm::expressions::Variable> assignedVariables;
236
237 // The local expression-related information.
238 LocalExpressionInformation<DdType> localExpressionInformation;
239
240 // The evaluator used to translate the probability expressions.
242
243 // The currently relevant source/successor predicates and the corresponding variables.
244 std::pair<std::vector<std::pair<storm::expressions::Variable, uint_fast64_t>>,
245 std::vector<std::vector<std::pair<storm::expressions::Variable, uint_fast64_t>>>>
246 relevantPredicatesAndVariables;
247
248 // The set of all relevant predicates.
249 std::set<uint64_t> allRelevantPredicates;
250
251 // The most recent result of a call to computeDd. If nothing has changed regarding the relevant
252 // predicates, this result may be reused.
253 GameBddResult<DdType> cachedDd;
254
255 // All relevant decision variables over which to perform AllSat.
256 std::vector<storm::expressions::Variable> decisionVariables;
257
258 // A flag indicating whether to use the decomposition when abstracting.
259 bool useDecomposition;
260
261 // Whether or not to add predicates indirectly related to assignment variables to relevant source predicates.
262 bool addPredicatesForValidBlocks;
263
264 // A flag indicating whether the computation of bottom states can be skipped (for example, if the bottom
265 // states become empty at some point).
266 bool skipBottomStates;
267
268 // A flag remembering whether we need to force recomputation of the BDD.
269 bool forceRecomputation;
270
271 // The abstract guard of the edge. This is only used if the guard is not a predicate, because it can
272 // then be used to constrain the bottom state abstractor.
273 storm::dd::Bdd<DdType> abstractGuard;
274
275 // A state-set abstractor used to determine the bottom states if not all guards were added.
276 StateSetAbstractor<DdType, ValueType> bottomStateAbstractor;
277
278 // A flag that indicates whether or not debug mode is enabled.
279 bool debug;
280};
281} // namespace jani
282} // namespace abstraction
283} // namespace storm::gbar
void refine(std::vector< uint_fast64_t > const &predicates)
Refines the abstract edge with the given predicates.
BottomStateResult< DdType > getBottomStateTransitions(storm::dd::Bdd< DdType > const &reachableStates, uint_fast64_t numberOfPlayer2Variables, boost::optional< std::pair< storm::expressions::Variable, storm::expressions::Variable > > const &locationVariables)
Retrieves the transitions to bottom states of this edge.
std::map< storm::expressions::Variable, storm::expressions::Expression > getVariableUpdates(uint64_t auxiliaryChoice) const
Retrieves a mapping from variables to expressions that define their updates wrt.
storm::jani::Edge const & getConcreteEdge() const
Retrieves the concrete edge that is abstracted by this abstract edge.
std::set< storm::expressions::Variable > const & getAssignedVariables() const
Retrieves the assigned variables.
storm::expressions::Expression const & getGuard() const
Retrieves the guard of this edge.
uint64_t getNumberOfUpdates(uint64_t player1Choice) const
Retrieves the number of updates of this edge.
GameBddResult< DdType > abstract()
Computes the abstraction of the edge wrt.
storm::dd::Add< DdType, ValueType > getEdgeDecoratorAdd(boost::optional< std::pair< storm::expressions::Variable, storm::expressions::Variable > > const &locationVariables) const
Retrieves an ADD that maps the encoding of the edge, source/target locations and its updates to their...
The base class for all model references.
Definition SmtSolver.h:31
LabParser.cpp.
Definition cli.cpp:18