Storm 1.11.1.1
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
SparseLTLSchedulerHelper.h
Go to the documentation of this file.
1#pragma once
2
8
9namespace storm {
10
11namespace modelchecker {
12namespace helper {
13namespace internal {
14
20template<typename ValueType, bool Nondeterministic>
22 public:
26 using productModelType = typename std::conditional<Nondeterministic, storm::models::sparse::Mdp<ValueType>, storm::models::sparse::Dtmc<ValueType>>::type;
27
32 SparseLTLSchedulerHelper(uint_fast64_t numProductStates);
33
37 void setRandom();
38
53 storm::storage::MaximalEndComponent const& containingMEC,
54 std::vector<automata::AcceptanceCondition::acceptance_expr::ptr> const& conjunction,
56
70 void prepareScheduler(uint_fast64_t numDaStates, storm::storage::BitVector const& acceptingProductStates,
71 std::unique_ptr<storm::storage::Scheduler<ValueType>> reachScheduler, transformer::DAProductBuilder const& productBuilder,
72 typename transformer::DAProduct<productModelType>::ptr product, storm::storage::BitVector const& modelStatesOfInterest,
73 storm::storage::SparseMatrix<ValueType> const& transitionMatrix);
74
84
85 private:
92 uint_fast64_t getMemoryState(uint_fast64_t daState, uint_fast64_t infSet);
93
98 class InfSetPool {
99 public:
100 InfSetPool() = default;
101
106 uint_fast64_t getOrCreateIndex(storm::storage::BitVector&& infSet);
112 storm::storage::BitVector const& get(uint_fast64_t index) const;
113
117 uint_fast64_t size() const;
118
119 private:
120 std::vector<storm::storage::BitVector> _storage;
121 } _infSets;
122
123 static const uint_fast64_t DEFAULT_INFSET;
124
125 bool _randomScheduler;
126 std::vector<storm::storage::BitVector> _dontCareStates; // memorySate-modelState combinations that are never visited
127
128 std::map<std::tuple<uint_fast64_t, uint_fast64_t, uint_fast64_t>, storm::storage::SchedulerChoice<ValueType>>
129 _producedChoices; // <s, q, DEFAULT_INFSET)> -> ReachChoice and <s, q, InfSetIndex> -> MecChoice
130
131 std::vector<boost::optional<std::set<uint_fast64_t>>>
132 _accInfSets; // Save for each product state (which is assigned to an acceptingMEC), the infSets that need to be visited inf often to satisfy the
133 // acceptance condition. Remaining states belonging to no accepting EC, are assigned len(_infSets) (REACH scheduler)
134
135 // Memory structure
136 std::vector<std::vector<storm::storage::BitVector>>
137 _memoryTransitions; // The BitVector contains the model states that lead from startState <q, mec, infSet> to <q', mec', infSet'>. This is
138 // deterministic, because each state <s, q> is assigned to a unique MEC (scheduler).
139 std::vector<uint_fast64_t> _memoryInitialStates; // Save for each relevant state (initial or all) s its unique initial memory state (which memory state is
140 // reached from the initial state after reading s)
141};
142} // namespace internal
143} // namespace helper
144} // namespace modelchecker
145} // 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:13
Base class for all sparse models.
Definition Model.h:32
A bit vector that is internally represented as a vector of 64-bit values.
Definition BitVector.h:16
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