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