Storm
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
SparseLTLSchedulerHelper.h
Go to the documentation of this file.
6
7namespace storm {
8
9namespace modelchecker {
10namespace helper {
11namespace internal {
12
18template<typename ValueType, bool Nondeterministic>
20 public:
24 using productModelType = typename std::conditional<Nondeterministic, storm::models::sparse::Mdp<ValueType>, storm::models::sparse::Dtmc<ValueType>>::type;
25
30 SparseLTLSchedulerHelper(uint_fast64_t numProductStates);
31
35 void setRandom();
36
51 storm::storage::MaximalEndComponent const& containingMEC,
52 std::vector<automata::AcceptanceCondition::acceptance_expr::ptr> const& conjunction,
54
68 void prepareScheduler(uint_fast64_t numDaStates, storm::storage::BitVector const& acceptingProductStates,
69 std::unique_ptr<storm::storage::Scheduler<ValueType>> reachScheduler, transformer::DAProductBuilder const& productBuilder,
70 typename transformer::DAProduct<productModelType>::ptr product, storm::storage::BitVector const& modelStatesOfInterest,
71 storm::storage::SparseMatrix<ValueType> const& transitionMatrix);
72
82
83 private:
90 uint_fast64_t getMemoryState(uint_fast64_t daState, uint_fast64_t infSet);
91
96 class InfSetPool {
97 public:
98 InfSetPool() = default;
99
104 uint_fast64_t getOrCreateIndex(storm::storage::BitVector&& infSet);
110 storm::storage::BitVector const& get(uint_fast64_t index) const;
111
115 uint_fast64_t size() const;
116
117 private:
118 std::vector<storm::storage::BitVector> _storage;
119 } _infSets;
120
121 static const uint_fast64_t DEFAULT_INFSET;
122
123 bool _randomScheduler;
124 std::vector<storm::storage::BitVector> _dontCareStates; // memorySate-modelState combinations that are never visited
125
126 std::map<std::tuple<uint_fast64_t, uint_fast64_t, uint_fast64_t>, storm::storage::SchedulerChoice<ValueType>>
127 _producedChoices; // <s, q, DEFAULT_INFSET)> -> ReachChoice and <s, q, InfSetIndex> -> MecChoice
128
129 std::vector<boost::optional<std::set<uint_fast64_t>>>
130 _accInfSets; // Save for each product state (which is assigned to an acceptingMEC), the infSets that need to be visited inf often to satisfy the
131 // acceptance condition. Remaining states belonging to no accepting EC, are assigned len(_infSets) (REACH scheduler)
132
133 // Memory structure
134 std::vector<std::vector<storm::storage::BitVector>>
135 _memoryTransitions; // The BitVector contains the model states that lead from startState <q, mec, infSet> to <q', mec', infSet'>. This is
136 // deterministic, because each state <s, q> is assigned to a unique MEC (scheduler).
137 std::vector<uint_fast64_t> _memoryInitialStates; // Save for each relevant state (initial or all) s its unique initial memory state (which memory state is
138 // reached from the initial state after reading s)
139};
140} // namespace internal
141} // namespace helper
142} // namespace modelchecker
143} // namespace storm
Helper class for scheduler construction in LTL model checking.
void saveProductEcChoices(automata::AcceptanceCondition const &acceptance, storm::storage::MaximalEndComponent const &acceptingEC, storm::storage::MaximalEndComponent const &containingMEC, std::vector< automata::AcceptanceCondition::acceptance_expr::ptr > const &conjunction, typename transformer::DAProduct< productModelType >::ptr product)
Save choices for states in the accepting end component of the DA-Model product and for the states in ...
storm::storage::Scheduler< ValueType > extractScheduler(storm::models::sparse::Model< ValueType > const &model, bool onlyInitialStatesRelevant)
Returns a deterministic fully defined scheduler (except for dontCareStates) for the given model.
typename std::conditional< Nondeterministic, storm::models::sparse::Mdp< ValueType >, storm::models::sparse::Dtmc< ValueType > >::type productModelType
The type of the product model (DTMC or MDP) that is used during the computation.
void prepareScheduler(uint_fast64_t numDaStates, storm::storage::BitVector const &acceptingProductStates, std::unique_ptr< storm::storage::Scheduler< ValueType > > reachScheduler, transformer::DAProductBuilder const &productBuilder, typename transformer::DAProduct< productModelType >::ptr product, storm::storage::BitVector const &modelStatesOfInterest, storm::storage::SparseMatrix< ValueType > const &transitionMatrix)
Extracts scheduler choices and creates the memory structure for the LTL-Scheduler.
void setRandom()
Set the scheduler choices to random.
This class represents a discrete-time Markov chain.
Definition Dtmc.h:14
Base class for all sparse models.
Definition Model.h:33
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.
This class defines which action is chosen in a particular state of a non-deterministic model.
Definition Scheduler.h:18
A class that holds a possibly non-square matrix in the compressed row storage format.
std::shared_ptr< DAProduct< Model > > ptr
Definition DAProduct.h:13
LabParser.cpp.
Definition cli.cpp:18