Storm
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
SparseExplorationModelChecker.h
Go to the documentation of this file.
1#ifndef STORM_MODELCHECKER_EXPLORATION_SPARSEEXPLORATIONMODELCHECKER_H_
2#define STORM_MODELCHECKER_EXPLORATION_SPARSEEXPLORATIONMODELCHECKER_H_
3
4#include <random>
5
7
9
12
14
15namespace storm {
16
17class Environment;
18
19namespace storage {
20class MaximalEndComponent;
21template<typename V>
22class SparseMatrix;
23} // namespace storage
24namespace prism {
25class Program;
26}
27
28namespace modelchecker {
29namespace exploration_detail {
30template<typename StateType, typename ValueType>
31class StateGeneration;
32template<typename StateType, typename ValueType>
33class ExplorationInformation;
34template<typename StateType, typename ValueType>
35class Bounds;
36template<typename StateType, typename ValueType>
37struct Statistics;
38} // namespace exploration_detail
39
40using namespace exploration_detail;
41
42template<typename ModelType, typename StateType = uint32_t>
44 public:
45 typedef typename ModelType::ValueType ValueType;
46 typedef StateType ActionType;
47 typedef std::vector<std::pair<StateType, ActionType>> StateActionStack;
48
50
52
53 virtual bool canHandle(CheckTask<storm::logic::Formula, ValueType> const& checkTask) const override;
54
55 virtual std::unique_ptr<CheckResult> computeUntilProbabilities(Environment const& env,
56 CheckTask<storm::logic::UntilFormula, ValueType> const& checkTask) override;
57
58 private:
59 std::tuple<StateType, ValueType, ValueType> performExploration(StateGeneration<StateType, ValueType>& stateGeneration,
60 ExplorationInformation<StateType, ValueType>& explorationInformation) const;
61
62 bool samplePathFromInitialState(StateGeneration<StateType, ValueType>& stateGeneration,
65
66 bool exploreState(StateGeneration<StateType, ValueType>& stateGeneration, StateType const& currentStateId,
69
70 ActionType sampleActionOfState(StateType const& currentStateId, ExplorationInformation<StateType, ValueType> const& explorationInformation,
71 Bounds<StateType, ValueType>& bounds) const;
72
73 StateType sampleSuccessorFromAction(ActionType const& chosenAction, ExplorationInformation<StateType, ValueType> const& explorationInformation,
74 Bounds<StateType, ValueType> const& bounds) const;
75
76 bool performPrecomputation(StateActionStack const& stack, ExplorationInformation<StateType, ValueType>& explorationInformation,
78
79 void collapseMec(storm::storage::MaximalEndComponent const& mec, std::vector<StateType> const& relevantStates,
80 storm::storage::SparseMatrix<ValueType> const& relevantStatesMatrix, ExplorationInformation<StateType, ValueType>& explorationInformation,
81 Bounds<StateType, ValueType>& bounds) const;
82
83 void updateProbabilityBoundsAlongSampledPath(StateActionStack& stack, ExplorationInformation<StateType, ValueType> const& explorationInformation,
84 Bounds<StateType, ValueType>& bounds) const;
85
86 void updateProbabilityOfAction(StateType const& state, ActionType const& action, ExplorationInformation<StateType, ValueType> const& explorationInformation,
87 Bounds<StateType, ValueType>& bounds) const;
88
89 std::pair<ValueType, ValueType> computeBoundsOfAction(ActionType const& action, ExplorationInformation<StateType, ValueType> const& explorationInformation,
90 Bounds<StateType, ValueType> const& bounds) const;
91 ValueType computeBoundOverAllOtherActions(storm::OptimizationDirection const& direction, StateType const& state, ActionType const& action,
92 ExplorationInformation<StateType, ValueType> const& explorationInformation,
93 Bounds<StateType, ValueType> const& bounds) const;
94 std::pair<ValueType, ValueType> computeBoundsOfState(StateType const& currentStateId,
95 ExplorationInformation<StateType, ValueType> const& explorationInformation,
96 Bounds<StateType, ValueType> const& bounds) const;
97 ValueType computeLowerBoundOfAction(ActionType const& action, ExplorationInformation<StateType, ValueType> const& explorationInformation,
98 Bounds<StateType, ValueType> const& bounds) const;
99 ValueType computeUpperBoundOfAction(ActionType const& action, ExplorationInformation<StateType, ValueType> const& explorationInformation,
100 Bounds<StateType, ValueType> const& bounds) const;
101
102 std::pair<ValueType, ValueType> getLowestBounds(storm::OptimizationDirection const& direction) const;
103 ValueType getLowestBound(storm::OptimizationDirection const& direction) const;
104 std::pair<ValueType, ValueType> combineBounds(storm::OptimizationDirection const& direction, std::pair<ValueType, ValueType> const& bounds1,
105 std::pair<ValueType, ValueType> const& bounds2) const;
106
107 // The program that defines the model to check.
108 storm::prism::Program program;
109
110 // The random number generator.
111 mutable std::default_random_engine randomGenerator;
112
113 // A comparator used to determine whether values are equal.
115};
116} // namespace modelchecker
117} // namespace storm
118
119#endif /* STORM_MODELCHECKER_EXPLORATION_SPARSEEXPLORATIONMODELCHECKER_H_ */
virtual std::unique_ptr< CheckResult > computeUntilProbabilities(Environment const &env, CheckTask< storm::logic::UntilFormula, ValueType > const &checkTask) override
std::vector< std::pair< StateType, ActionType > > StateActionStack
static bool canHandleStatic(CheckTask< storm::logic::Formula, ValueType > const &checkTask)
virtual bool canHandle(CheckTask< storm::logic::Formula, ValueType > const &checkTask) const override
A bit vector that is internally represented as a vector of 64-bit values.
Definition BitVector.h:18
This class represents a maximal end-component of a nondeterministic model.
A class that holds a possibly non-square matrix in the compressed row storage format.
LabParser.cpp.
Definition cli.cpp:18