Storm
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
lexicographicModelCheckerHelper.cpp
Go to the documentation of this file.
15
16namespace storm {
17namespace modelchecker {
18namespace helper {
19namespace lexicographic {
20
21template<typename SparseModelType, typename ValueType, bool Nondeterministic>
22std::pair<std::shared_ptr<storm::transformer::DAProduct<SparseModelType>>, std::vector<uint>>
24 CheckFormulaCallback const& formulaChecker) {
26 std::vector<uint> acceptanceConditions;
27
28 // Get the big product automton for all subformulae
29 std::shared_ptr<storm::automata::DeterministicAutomaton> productAutomaton = spothelper::ltl2daSpotProduct(this->formula, extracted, acceptanceConditions);
30
31 // Compute Satisfaction sets for the Atomic propositions (which represent the state-subformulae)
32 std::map<std::string, storm::storage::BitVector> apSatSets = computeApSets(extracted, formulaChecker);
33 const storm::automata::APSet& apSet = productAutomaton->getAPSet();
34 std::vector<storm::storage::BitVector> statesForAP;
35 for (const std::string& ap : apSet.getAPs()) {
36 auto it = apSatSets.find(ap);
37 STORM_LOG_THROW(it != apSatSets.end(), storm::exceptions::InvalidOperationException,
38 "Deterministic automaton has AP " << ap << ", does not appear in formula");
39
40 statesForAP.push_back(std::move(it->second));
41 }
42
43 storm::storage::BitVector statesOfInterest;
44
45 if (this->hasRelevantStates()) {
46 statesOfInterest = this->getRelevantStates();
47 } else {
48 // Product from all model states
49 statesOfInterest = storm::storage::BitVector(this->_transitionMatrix.getRowGroupCount(), true);
50 }
51
52 // create the product of automaton and MDP
53 transformer::DAProductBuilder productBuilder(*productAutomaton, statesForAP);
54 std::shared_ptr<storm::transformer::DAProduct<SparseModelType>> product =
55 productBuilder.build<SparseModelType>(model.getTransitionMatrix(), statesOfInterest);
56
57 return std::make_pair(product, acceptanceConditions);
58}
59
60template<typename SparseModelType, typename ValueType, bool Nondeterministic>
61std::pair<storm::storage::MaximalEndComponentDecomposition<ValueType>, std::vector<std::vector<bool>>>
63 std::shared_ptr<storm::transformer::DAProduct<productModelType>> productModel, std::vector<uint>& acceptanceConditions) {
64 storm::storage::BitVector allowed(productModel->getProductModel().getTransitionMatrix().getRowGroupCount(), true);
65 // get MEC decomposition
66 storm::storage::MaximalEndComponentDecomposition<ValueType> mecs(productModel->getProductModel().getTransitionMatrix(),
67 productModel->getProductModel().getBackwardTransitions(), allowed);
68
69 std::vector<std::vector<bool>> bscc_satisfaction;
70 storm::automata::AcceptanceCondition::ptr acceptance = productModel->getAcceptance();
71
72 // Get all the Streett-pairs
73 std::vector<storm::automata::AcceptanceCondition::acceptance_expr::ptr> acceptancePairs = getStreettPairs(acceptance->getAcceptanceExpression());
74 STORM_LOG_ASSERT(!acceptancePairs.empty(), "There are no accepting pairs, maybe you have a parity automaton?");
75 // they are ordered from last to first, so reverse the array
76 std::reverse(acceptancePairs.begin(), acceptancePairs.end());
77
78 // Iterate over the end-components and find their lex-array
79 for (storm::storage::MaximalEndComponent& mec : mecs) {
80 std::vector<storm::automata::AcceptanceCondition::acceptance_expr::ptr> sprime;
81 std::vector<bool> bsccAccepting;
82 for (uint i = 0; i < acceptanceConditions.size() - 1; i++) {
83 // copy the current list of Streett-pairs that can be fulfilled together
84 std::vector<storm::automata::AcceptanceCondition::acceptance_expr::ptr> sprimeTemp(sprime);
85 // add the new pairs (for the new condition) that should be checked now
86 std::vector<storm::automata::AcceptanceCondition::acceptance_expr::ptr> sub = {acceptancePairs.begin() + acceptanceConditions[i],
87 acceptancePairs.begin() + acceptanceConditions[i + 1]};
88 sprimeTemp.insert(sprimeTemp.end(), sub.begin(), sub.end());
89
90 // check whether the Streett-condition in sprimeTemp can be fulfilled in the mec
91 bool accepts = isAcceptingStreettConditions(mec, sprimeTemp, acceptance, productModel->getProductModel());
92
93 if (accepts) {
94 // if the condition can be fulfilled, add the Streett-pairs to the current list of pairs, and mark this property as true for this MEC
95 bsccAccepting.push_back(true);
96 sprime.insert(sprime.end(), sub.begin(), sub.end());
97 } else {
98 bsccAccepting.push_back(false);
99 }
100 }
101 bscc_satisfaction.push_back(bsccAccepting);
102 }
103 return std::pair<storm::storage::MaximalEndComponentDecomposition<ValueType>&, std::vector<std::vector<bool>>&>(mecs, bscc_satisfaction);
104}
105
106template<typename SparseModelType, typename ValueType, bool Nondeterministic>
108 storm::storage::MaximalEndComponentDecomposition<ValueType> const& mecs, std::vector<std::vector<bool>> const& mecLexArray,
109 std::shared_ptr<storm::transformer::DAProduct<SparseModelType>> const& productModel, SparseModelType const& originalMdp) {
110 // Eliminate all MECs and generate one sink state instead
111 // Add first new states for each MEC
112 auto stStateResult = addSinkStates(mecs, productModel);
113 storm::storage::SparseMatrix<ValueType> newMatrixWithNewStates = stStateResult.first;
114 std::map<uint, uint_fast64_t> bccToStStateMapping = stStateResult.second;
115
116 // eliminate the MECs (collapse them into one state)
118 storm::storage::BitVector eliminationStates(newMatrixWithNewStates.getColumnCount(), true);
119 auto compressionResult =
120 eliminator.transform(newMatrixWithNewStates, mecs, eliminationStates, storm::storage::BitVector(eliminationStates.size(), false), true);
121
122 STORM_LOG_ASSERT(!mecLexArray.empty(), "No MECs in the model!");
123 std::vector<std::vector<bool>> bccLexArrayCurrent(mecLexArray);
124 // prepare the result (one reachability probability for each objective)
125 MDPSparseModelCheckingHelperReturnType<ValueType> retResult(std::vector<ValueType>(mecLexArray[0].size()));
126 std::vector<uint_fast64_t> compressedToReducedMapping(compressionResult.matrix.getColumnCount());
127 std::iota(std::begin(compressedToReducedMapping), std::end(compressedToReducedMapping), 0);
128 storm::storage::SparseMatrix<ValueType> transitionMatrix = compressionResult.matrix;
129
130 // check reachability for each condition and restrict the model to optimal choices
131 for (uint condition = 0; condition < mecLexArray[0].size(); condition++) {
132 // get the goal-states for this objective (i.e. the st-states of the MECs where the objective can be fulfilled
133 storm::storage::BitVector psiStates = getGoodStates(mecs, bccLexArrayCurrent, compressionResult.oldToNewStateMapping, condition,
134 transitionMatrix.getColumnCount(), compressedToReducedMapping, bccToStStateMapping);
135 if (psiStates.getNumberOfSetBits() == 0) {
136 retResult.values[condition] = 0;
137 continue;
138 }
139
140 // solve the reachability query for this set of goal states
141 std::vector<uint_fast64_t> newInitalStates;
142 auto res =
143 solveOneReachability(newInitalStates, psiStates, transitionMatrix, originalMdp, compressedToReducedMapping, compressionResult.oldToNewStateMapping);
144 if (newInitalStates.empty()) {
145 retResult.values[condition] = 0;
146 continue;
147 }
148 retResult.values[condition] = res.values[newInitalStates[0]];
149
150 // create a reduced subsystem that only contains the optimal actions for this objective
151 auto subsystem = getReducedSubsystem(transitionMatrix, res, newInitalStates, psiStates);
152 std::vector<uint_fast64_t> compressedToReducedMappingTemp;
153 compressedToReducedMappingTemp.reserve(compressedToReducedMapping.size());
154 // create a new mapping for the states
155 for (uint_fast64_t newState : subsystem.newToOldStateIndexMapping) {
156 compressedToReducedMappingTemp.push_back(compressedToReducedMapping[newState]);
157 }
158 compressedToReducedMapping = compressedToReducedMappingTemp;
159 transitionMatrix = subsystem.model->getTransitionMatrix();
160 }
161 return retResult;
162}
163
164template<typename SparseModelType, typename ValueType, bool Nondeterministic>
165std::vector<storm::automata::AcceptanceCondition::acceptance_expr::ptr>
167 storm::automata::AcceptanceCondition::acceptance_expr::ptr const& current) {
168 std::vector<storm::automata::AcceptanceCondition::acceptance_expr::ptr> accConds;
169 if (current->isOR()) {
170 accConds.push_back(current);
171 } else if (current->isAND()) {
172 auto leftAccConds = getStreettPairs(current->getLeft());
173 accConds.reserve(accConds.size() + distance(leftAccConds.begin(), leftAccConds.end()));
174 accConds.insert(accConds.end(), leftAccConds.begin(), leftAccConds.end());
175 auto rightAccConds = getStreettPairs(current->getRight());
176 accConds.reserve(accConds.size() + distance(rightAccConds.begin(), rightAccConds.end()));
177 accConds.insert(accConds.end(), rightAccConds.begin(), rightAccConds.end());
178 } else {
179 STORM_LOG_THROW(true, storm::exceptions::NotImplementedException, "Finding StreettPairs - unknown type " + current->toString());
180 }
181 return accConds;
182}
183
185 storm::automata::AcceptanceCondition::acceptance_expr::ptr const& setPointer) {
186 STORM_LOG_THROW(setPointer->isAtom(), storm::exceptions::NotImplementedException, "Not an Atom!");
187 const cpphoafparser::AtomAcceptance& atom = setPointer->getAtom();
188 const storm::storage::BitVector& accSet = acceptance->getAcceptanceSet(atom.getAcceptanceSet());
189 return accSet;
190}
191
192template<typename SparseModelType, typename ValueType, bool Nondeterministic>
193bool lexicographicModelCheckerHelper<SparseModelType, ValueType, Nondeterministic>::isAcceptingStreettConditions(
194 storm::storage::MaximalEndComponent const& scc, std::vector<storm::automata::AcceptanceCondition::acceptance_expr::ptr> const& acceptancePairs,
195 storm::automata::AcceptanceCondition::ptr const& acceptance, productModelType const& model) {
196 // initialize the states and choices we have to consider for mec decomposition
197 storm::storage::BitVector mecStates = storm::storage::BitVector(model.getNumberOfStates(), false);
198 std::for_each(scc.begin(), scc.end(), [&mecStates](auto const& state) { mecStates.set(state.first); });
199 auto mecChoices = model.getTransitionMatrix().getRowFilter(mecStates, mecStates);
200 // catch the simple case where there are no mecs
201 if (mecChoices.empty()) {
202 return false;
203 }
204 // get easy access to incoming transitions of a state
205 auto incomingChoicesMatrix = model.getTransitionMatrix().transpose();
206 auto incomingStatesMatrix = model.getBackwardTransitions();
207 bool changedSomething = true;
208 while (changedSomething) {
209 // iterate until there is no change
210 changedSomething = false;
211 // decompose the MEC, if possible
212 auto subMecDecomposition =
213 storm::storage::MaximalEndComponentDecomposition<ValueType>(model.getTransitionMatrix(), incomingStatesMatrix, mecStates, mecChoices);
214 // iterate over all sub-MECs in the big MEC
215 for (storm::storage::MaximalEndComponent const& mec : subMecDecomposition) {
216 // iterate over all Streett-pairs
217 for (storm::automata::AcceptanceCondition::acceptance_expr::ptr const& streettPair : acceptancePairs) {
218 // check whether (i) the MEC contains states from the Inf-set (the condition holds) or (ii) states from the Fin-set (unclear whether it can be
219 // fulfilled)
220 auto infSet = getStreettSet(acceptance, streettPair->getRight());
221 auto finSet = getStreettSet(acceptance, streettPair->getLeft());
222 if (mec.containsAnyState(infSet)) {
223 // streett-condition is true (INF is fulfilled)
224 continue;
225 } else {
226 // INF cannot be fulfilled
227 // check if there's a state from FIN
228 for (auto const& stateToChoice : mec) {
229 StateType state = stateToChoice.first;
230 if (finSet.get(state)) {
231 // remove the state from the set of states in this EC
232 mecStates.set(state, false);
233 // remove all incoming transitions to this state
234 auto incChoices = incomingChoicesMatrix.getRow(state);
235 std::for_each(incChoices.begin(), incChoices.end(), [&mecChoices](auto const& entry) { mecChoices.set(entry.getColumn(), false); });
236 changedSomething = true;
237 }
238 }
239 }
240 }
241 }
242 }
243 // decompose one last time
244 auto subMecDecomposition =
245 storm::storage::MaximalEndComponentDecomposition<ValueType>(model.getTransitionMatrix(), incomingStatesMatrix, mecStates, mecChoices);
246 if (subMecDecomposition.empty()) {
247 // there are no more ECs in this set of states
248 return false;
249 } else {
250 // there is still an end-component that can fulfill the Streett-condition
251 return true;
252 }
253}
254
255template<typename SparseModelType, typename ValueType, bool Nondeterministic>
256storm::storage::BitVector lexicographicModelCheckerHelper<SparseModelType, ValueType, Nondeterministic>::getGoodStates(
257 storm::storage::MaximalEndComponentDecomposition<ValueType> const& bcc, std::vector<std::vector<bool>> const& bccLexArray,
258 std::vector<uint_fast64_t> const& oldToNewStateMapping, uint const& condition, uint const numStates,
259 std::vector<uint_fast64_t> const& compressedToReducedMapping, std::map<uint, uint_fast64_t> const& bccToStStateMapping) {
260 STORM_LOG_ASSERT(!bccLexArray.empty(), "Lex-Array is empty!");
261 STORM_LOG_ASSERT(condition < bccLexArray[0].size(), "Condition is not in Lex-Array!");
262 std::vector<uint_fast64_t> goodStates;
263 for (uint i = 0; i < bcc.size(); i++) {
264 std::vector<bool> const& bccLex = bccLexArray[i];
265 if (bccLex[condition]) {
266 uint_fast64_t bccStateOld = bccToStStateMapping.at(i);
267 uint_fast64_t bccState = oldToNewStateMapping[bccStateOld];
268 auto pointer = std::find(compressedToReducedMapping.begin(), compressedToReducedMapping.end(), bccState);
269 if (pointer != compressedToReducedMapping.end()) {
270 // We have to check whether the state has already been removed
271 uint_fast64_t bccStateReduced = pointer - compressedToReducedMapping.begin();
272 goodStates.push_back(bccStateReduced);
273 }
274 }
275 }
276 return {numStates, goodStates};
277}
278
279template<typename SparseModelType, typename ValueType, bool Nondeterministic>
280MDPSparseModelCheckingHelperReturnType<ValueType> lexicographicModelCheckerHelper<SparseModelType, ValueType, Nondeterministic>::solveOneReachability(
281 std::vector<uint_fast64_t>& newInitalStates, storm::storage::BitVector const& psiStates, storm::storage::SparseMatrix<ValueType> const& transitionMatrix,
282 SparseModelType const& originalMdp, std::vector<uint_fast64_t> const& compressedToReducedMapping, std::vector<uint_fast64_t> const& oldToNewStateMapping) {
283 Environment env;
284 // A reachability condition "F x" is transformed to "true U x"
285 // phi states are all states
286 // psi states are the ones from the "good bccs"
287 storm::storage::BitVector phiStates(transitionMatrix.getColumnCount(), true);
288
289 // Get initial states in the compressed model
290 storm::storage::BitVector const& originalInitialStates = originalMdp.getInitialStates();
291
292 uint pos = 0;
293 while (originalInitialStates.getNextSetIndex(pos) != originalInitialStates.size()) {
294 pos = originalInitialStates.getNextSetIndex(pos) + 1;
295 auto pointer = std::find(compressedToReducedMapping.begin(), compressedToReducedMapping.end(), oldToNewStateMapping[pos - 1]);
296 if (pointer != compressedToReducedMapping.end()) {
297 newInitalStates.push_back(pointer - compressedToReducedMapping.begin());
298 }
299 }
300 storm::storage::BitVector i(transitionMatrix.getColumnCount(), newInitalStates);
301
302 ModelCheckerHint hint;
303 MDPSparseModelCheckingHelperReturnType<ValueType> ret = storm::modelchecker::helper::SparseMdpPrctlHelper<ValueType>::computeUntilProbabilities(
304 env, storm::solver::SolveGoal<ValueType>(storm::solver::OptimizationDirection::Maximize, i), transitionMatrix, transitionMatrix.transpose(true),
305 phiStates, psiStates, false, true, hint);
306 return ret;
307}
308
309template<typename SparseModelType, typename ValueType, bool Nondeterministic>
311lexicographicModelCheckerHelper<SparseModelType, ValueType, Nondeterministic>::getReducedSubsystem(
312 storm::storage::SparseMatrix<ValueType> const& transitionMatrix, MDPSparseModelCheckingHelperReturnType<ValueType> const& reachabilityResult,
313 std::vector<uint_fast64_t> const& newInitalStates, storm::storage::BitVector const& goodStates) {
314 std::vector<std::vector<uint>> optimalActions;
315 std::vector<uint_fast64_t> keptActions;
316 std::vector<uint_fast64_t> const& rowGroupIndices = transitionMatrix.getRowGroupIndices();
317
318 // iterate over the states
319 for (uint currentState = 0; currentState < reachabilityResult.values.size(); currentState++) {
320 std::vector<uint> goodActionsForState;
321 uint_fast64_t bestAction = reachabilityResult.scheduler->getChoice(currentState).getDeterministicChoice();
322 // determine the value of the best action
323 ValueType bestActionValue(0);
324 for (const storm::storage::MatrixEntry<uint_fast64_t, ValueType>& rowEntry : transitionMatrix.getRow(rowGroupIndices[currentState] + bestAction)) {
325 bestActionValue += rowEntry.getValue() * reachabilityResult.values[rowEntry.getColumn()];
326 }
327 uint lastAction = rowGroupIndices[currentState] + transitionMatrix.getRowGroupSize(currentState);
328 // iterate over all actions in this state to find those that are also optimal
329 for (uint action = rowGroupIndices[currentState]; action < lastAction; action++) {
330 ValueType actionValue(0);
331 for (const auto& rowEntry : transitionMatrix.getRow(action)) {
332 actionValue += rowEntry.getValue() * reachabilityResult.values[rowEntry.getColumn()];
333 }
334 if (actionValue == bestActionValue) {
335 goodActionsForState.push_back(action);
336 keptActions.push_back(action);
337 }
338 }
339 optimalActions.push_back(goodActionsForState);
340 }
341 storm::storage::BitVector subSystemActions(transitionMatrix.getRowCount(), keptActions);
342 storm::storage::BitVector subSystemStates(transitionMatrix.getRowGroupCount(), true);
343 transformer::SubsystemBuilderOptions sbo;
344 sbo.fixDeadlocks = true;
345 storm::models::sparse::StateLabeling stateLabelling(transitionMatrix.getColumnCount());
346 stateLabelling.addLabel("init");
347 for (auto const& state : newInitalStates) {
348 stateLabelling.addLabelToState("init", state);
349 }
350 storm::models::sparse::Mdp<ValueType> newModel(transitionMatrix, stateLabelling);
351 SubsystemReturnType subsystemReturn = transformer::buildSubsystem(newModel, subSystemStates, subSystemActions, false, sbo);
352 return subsystemReturn;
353}
354
355template<typename SparseModelType, typename ValueType, bool Nondeterministic>
356std::pair<storm::storage::SparseMatrix<ValueType>, std::map<uint, uint_fast64_t>>
357lexicographicModelCheckerHelper<SparseModelType, ValueType, Nondeterministic>::addSinkStates(
359 std::shared_ptr<storm::transformer::DAProduct<SparseModelType>> const& productModel) {
360 storm::storage::SparseMatrix<ValueType> const matrix = productModel->getProductModel().getTransitionMatrix();
361 uint countNewRows = 0;
362 std::map<uint_fast64_t, uint> stateToMEC;
363 for (uint i = 0; i < mecs.size(); i++) {
364 auto bcc = mecs[i];
365 countNewRows += bcc.size() + 1;
366 for (auto const& stateAndChoices : bcc) {
367 // create an assignment of states to MECS
368 uint_fast64_t bccState = stateAndChoices.first;
369 stateToMEC[bccState] = i;
370 }
371 }
372 // create a new transition matrix
373 storm::storage::SparseMatrixBuilder<ValueType> builder(matrix.getRowCount() + countNewRows, matrix.getColumnCount() + mecs.size(),
374 matrix.getEntryCount() + countNewRows, false, true, matrix.getRowGroupCount());
375 uint_fast64_t numRowGroups = matrix.getColumnCount() + mecs.size();
376 std::map<uint, uint_fast64_t> sTstatesForBCC;
377 uint_fast64_t newestRowGroup = matrix.getRowGroupCount();
378 uint_fast64_t newRow = 0;
379 uint_fast64_t oldRowCounting = 0;
380 auto oldRowGroupIndices = matrix.getRowGroupIndices();
381 // iterate over the row groups (aka states) of the old transition matrix
382 for (uint_fast64_t newRowGroup = 0; newRowGroup < matrix.getColumnCount(); ++newRowGroup) {
383 // create a new row group (aka state) for this
384 builder.newRowGroup(newRow);
385 // iterate over the rows of this row group (aka transitions from this state)
386 for (; oldRowCounting < oldRowGroupIndices[newRowGroup + 1]; oldRowCounting++) {
387 for (auto const& entry : matrix.getRow(oldRowCounting)) {
388 // add the actions to the new matrix
389 builder.addNextValue(newRow, entry.getColumn(), entry.getValue());
390 }
391 newRow++;
392 }
393 // if the state belongs to an MEC, add a new transition to the sink state of this MEC
394 if (stateToMEC.find(newRowGroup) != stateToMEC.end()) {
395 if (sTstatesForBCC.find(stateToMEC[newRowGroup]) == sTstatesForBCC.end()) {
396 sTstatesForBCC[stateToMEC[newRowGroup]] = newestRowGroup;
397 newestRowGroup++;
398 }
399 builder.addNextValue(newRow, sTstatesForBCC[stateToMEC[newRowGroup]], storm::utility::one<ValueType>());
400 newRow++;
401 }
402 }
403 // add new row groups (aka states) for the new sink states to the transition matrix
404 // only possible action of those is a self-loop
405 for (uint_fast64_t newRowGroup = matrix.getColumnCount(); newRowGroup < numRowGroups; newRowGroup++) {
406 builder.newRowGroup(newRow);
407 builder.addNextValue(newRow, newRowGroup, storm::utility::one<ValueType>());
408 newRow++;
409 }
410 storm::storage::SparseMatrix<ValueType> newMatrix = builder.build();
411 return {newMatrix, sTstatesForBCC};
412}
413
414template<typename SparseModelType, typename ValueType, bool Nondeterministic>
415std::map<std::string, storm::storage::BitVector> lexicographicModelCheckerHelper<SparseModelType, ValueType, Nondeterministic>::computeApSets(
416 std::map<std::string, std::shared_ptr<storm::logic::Formula const>> const& extracted, CheckFormulaCallback const& formulaChecker) {
417 std::map<std::string, storm::storage::BitVector> apSets;
418 for (auto& p : extracted) {
419 STORM_LOG_DEBUG(" Computing satisfaction set for atomic proposition \"" << p.first << "\" <=> " << *p.second << "...");
420 apSets[p.first] = formulaChecker(*p.second);
421 }
422 return apSets;
423}
424
425template class lexicographic::lexicographicModelCheckerHelper<storm::models::sparse::Mdp<double>, double, true>;
426template class lexicographic::lexicographicModelCheckerHelper<storm::models::sparse::Mdp<double>, double, false>;
427template class lexicographic::lexicographicModelCheckerHelper<storm::models::sparse::Mdp<storm::RationalNumber>, storm::RationalNumber, true>;
428template class lexicographic::lexicographicModelCheckerHelper<storm::models::sparse::Mdp<storm::RationalNumber>, storm::RationalNumber, false>;
429} // namespace lexicographic
430} // namespace helper
431} // namespace modelchecker
432} // namespace storm
433
434#pragma clang diagnostic pop
const std::vector< std::string > & getAPs() const
Definition APSet.cpp:44
std::shared_ptr< AcceptanceCondition > ptr
std::map< std::string, std::shared_ptr< Formula const > > ApToFormulaMap
static MDPSparseModelCheckingHelperReturnType< SolutionType > computeUntilProbabilities(Environment const &env, storm::solver::SolveGoal< ValueType, SolutionType > &&goal, storm::storage::SparseMatrix< ValueType > const &transitionMatrix, storm::storage::SparseMatrix< ValueType > const &backwardTransitions, storm::storage::BitVector const &phiStates, storm::storage::BitVector const &psiStates, bool qualitative, bool produceScheduler, ModelCheckerHint const &hint=ModelCheckerHint())
MDPSparseModelCheckingHelperReturnType< ValueType > lexReachability(storm::storage::MaximalEndComponentDecomposition< ValueType > const &mecs, std::vector< std::vector< bool > > const &mecLexArray, std::shared_ptr< storm::transformer::DAProduct< SparseModelType > > const &productModel, SparseModelType const &originalMdp)
Solves the reachability query for a lexicographic objective In lexicographic order,...
std::pair< std::shared_ptr< storm::transformer::DAProduct< SparseModelType > >, std::vector< uint > > getCompleteProductModel(SparseModelType const &model, CheckFormulaCallback const &formulaChecker)
Returns the product of a model and the product-automaton of all sub-formulae of the multi-objective f...
std::pair< storm::storage::MaximalEndComponentDecomposition< ValueType >, std::vector< std::vector< bool > > > getLexArrays(std::shared_ptr< storm::transformer::DAProduct< productModelType > > productModel, std::vector< uint > &acceptanceConditions)
Given a product of an MDP and a automaton, returns the MECs and their corresponding Lex-Arrays First:...
std::function< storm::storage::BitVector(storm::logic::Formula const &)> CheckFormulaCallback
storm::transformer::SubsystemBuilderReturnType< ValueType, storm::models::sparse::StandardRewardModel< ValueType > > SubsystemReturnType
This class represents a (discrete-time) Markov decision process.
Definition Mdp.h:14
This class manages the labeling of the state space with a number of (atomic) labels.
A bit vector that is internally represented as a vector of 64-bit values.
Definition BitVector.h:18
uint_fast64_t getNextSetIndex(uint_fast64_t startingIndex) const
Retrieves the index of the bit that is the next bit set to true in the bit vector.
void set(uint_fast64_t index, bool value=true)
Sets the given truth value at the given index.
size_t size() const
Retrieves the number of bits this bit vector can store.
uint_fast64_t getNumberOfSetBits() const
Returns the number of bits that are set to true in this bit vector.
std::size_t size() const
Retrieves the number of blocks of this decomposition.
This class represents the decomposition of a nondeterministic model into its maximal end components.
This class represents a maximal end-component of a nondeterministic model.
iterator end()
Retrieves an iterator that points past the last state and its choices in the MEC.
iterator begin()
Retrieves an iterator that points to the first state and its choices in the MEC.
A class that can be used to build a sparse matrix by adding value by value.
A class that holds a possibly non-square matrix in the compressed row storage format.
index_type getEntryCount() const
Returns the number of entries in the matrix.
index_type getRowGroupCount() const
Returns the number of row groups in the matrix.
index_type getColumnCount() const
Returns the number of columns of the matrix.
std::vector< index_type > const & getRowGroupIndices() const
Returns the grouping of rows of this matrix.
index_type getRowGroupSize(index_type group) const
Returns the size of the given row group.
storm::storage::SparseMatrix< value_type > transpose(bool joinGroups=false, bool keepZeros=false) const
Transposes the matrix.
index_type getRowCount() const
Returns the number of rows of the matrix.
DAProduct< Model >::ptr build(const Model &originalModel, const storm::storage::BitVector &statesOfInterest) const
static EndComponentEliminatorReturnType transform(storm::storage::SparseMatrix< ValueType > const &originalMatrix, storm::storage::MaximalEndComponentDecomposition< ValueType > ecs, storm::storage::BitVector const &subsystemStates, storm::storage::BitVector const &addSinkRowStates, bool addSelfLoopAtSinkStates=false)
#define STORM_LOG_DEBUG(message)
Definition logging.h:23
#define STORM_LOG_ASSERT(cond, message)
Definition macros.h:11
#define STORM_LOG_THROW(cond, exception, message)
Definition macros.h:30
SFTBDDChecker::ValueType ValueType
std::shared_ptr< storm::automata::DeterministicAutomaton > ltl2daSpotProduct(storm::logic::MultiObjectiveFormula const &formula, storm::logic::ExtractMaximalStateFormulasVisitor::ApToFormulaMap &extracted, std::vector< uint > &acceptanceConditions)
Function that creates a determinitistic automaton with Streett-acceptance condition.
const storm::storage::BitVector & getStreettSet(storm::automata::AcceptanceCondition::ptr const &acceptance, storm::automata::AcceptanceCondition::acceptance_expr::ptr const &setPointer)
SubsystemBuilderReturnType< ValueType, RewardModelType > buildSubsystem(storm::models::sparse::Model< ValueType, RewardModelType > const &originalModel, storm::storage::BitVector const &subsystemStates, storm::storage::BitVector const &subsystemActions, bool keepUnreachableStates, SubsystemBuilderOptions options)
LabParser.cpp.
Definition cli.cpp:18