Storm
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
HybridDtmcPrctlHelper.cpp
Go to the documentation of this file.
2
4
7
12
14#include "storm/utility/graph.h"
15
17
22
24
28
30
31namespace storm {
32namespace modelchecker {
33namespace helper {
34
35template<storm::dd::DdType DdType, typename ValueType>
38 storm::dd::Add<DdType, ValueType> const& transitionMatrix,
39 storm::dd::Bdd<DdType> const& phiStates,
40 storm::dd::Bdd<DdType> const& psiStates, bool qualitative) {
41 // We need to identify the states which have to be taken out of the matrix, i.e. all states that have
42 // probability 0 and 1 of satisfying the until-formula.
43 STORM_LOG_TRACE("Found " << phiStates.getNonZeroCount() << " phi states and " << psiStates.getNonZeroCount() << " psi states.");
44 std::pair<storm::dd::Bdd<DdType>, storm::dd::Bdd<DdType>> statesWithProbability01 =
45 storm::utility::graph::performProb01(model, transitionMatrix.notZero(), phiStates, psiStates);
46 storm::dd::Bdd<DdType> maybeStates = !statesWithProbability01.first && !statesWithProbability01.second && model.getReachableStates();
47
48 STORM_LOG_INFO("Preprocessing: " << statesWithProbability01.first.getNonZeroCount() << " states with probability 0, "
49 << statesWithProbability01.second.getNonZeroCount() << " with probability 1 (" << maybeStates.getNonZeroCount()
50 << " states remaining).");
51
52 // Check whether we need to compute exact probabilities for some states.
53 if (qualitative) {
54 // Set the values for all maybe-states to 0.5 to indicate that their probability values are neither 0 nor 1.
56 model.getReachableStates(),
57 statesWithProbability01.second.template toAdd<ValueType>() +
58 maybeStates.template toAdd<ValueType>() * model.getManager().template getConstant<ValueType>(storm::utility::convertNumber<ValueType>(0.5))));
59 } else {
60 // If there are maybe states, we need to solve an equation system.
61 if (!maybeStates.isZero()) {
62 storm::utility::Stopwatch conversionWatch;
63
64 // Create the ODD for the translation between symbolic and explicit storage.
65 conversionWatch.start();
66 storm::dd::Odd odd = maybeStates.createOdd();
67 conversionWatch.stop();
68
69 // Create the matrix and the vector for the equation system.
70 storm::dd::Add<DdType, ValueType> maybeStatesAdd = maybeStates.template toAdd<ValueType>();
71
72 // Start by cutting away all rows that do not belong to maybe states. Note that this leaves columns targeting
73 // non-maybe states in the matrix.
74 storm::dd::Add<DdType, ValueType> submatrix = transitionMatrix * maybeStatesAdd;
75
76 // Then compute the vector that contains the one-step probabilities to a state with probability 1 for all
77 // maybe states.
78 storm::dd::Add<DdType, ValueType> prob1StatesAsColumn = statesWithProbability01.second.template toAdd<ValueType>();
79 prob1StatesAsColumn = prob1StatesAsColumn.swapVariables(model.getRowColumnMetaVariablePairs());
80 storm::dd::Add<DdType, ValueType> subvector = submatrix * prob1StatesAsColumn;
81 subvector = subvector.sumAbstract(model.getColumnVariables());
82
84 auto req = linearEquationSolverFactory.getRequirements(env);
85 req.clearLowerBounds();
86 req.clearUpperBounds();
87 STORM_LOG_THROW(!req.hasEnabledCriticalRequirement(), storm::exceptions::UncheckedRequirementException,
88 "Solver requirements " + req.getEnabledRequirementsAsString() + " not checked.");
89
90 // Check whether we need to create an equation system.
91 bool convertToEquationSystem =
93
94 // Finally cut away all columns targeting non-maybe states and potentially convert the matrix
95 // into the matrix needed for solving the equation system (i.e. compute (I-A)).
96 submatrix *= maybeStatesAdd.swapVariables(model.getRowColumnMetaVariablePairs());
97 if (convertToEquationSystem) {
98 submatrix = (model.getRowColumnIdentity() * maybeStatesAdd) - submatrix;
99 }
100
101 // Create the solution vector.
102 std::vector<ValueType> x(maybeStates.getNonZeroCount(), storm::utility::convertNumber<ValueType>(0.5));
103
104 // Translate the symbolic matrix/vector to their explicit representations and solve the equation system.
105 conversionWatch.start();
106 storm::storage::SparseMatrix<ValueType> explicitSubmatrix = submatrix.toMatrix(odd, odd);
107 std::vector<ValueType> b = subvector.toVector(odd);
108 conversionWatch.stop();
109 STORM_LOG_INFO("Converting symbolic matrix/vector to explicit representation done in " << conversionWatch.getTimeInMilliseconds() << "ms.");
110
111 std::unique_ptr<storm::solver::LinearEquationSolver<ValueType>> solver = linearEquationSolverFactory.create(env, std::move(explicitSubmatrix));
112 solver->setBounds(storm::utility::zero<ValueType>(), storm::utility::one<ValueType>());
113 solver->solveEquations(env, x, b);
114
115 // Return a hybrid check result that stores the numerical values explicitly.
116 return std::unique_ptr<CheckResult>(new storm::modelchecker::HybridQuantitativeCheckResult<DdType, ValueType>(
117 model.getReachableStates(), model.getReachableStates() && !maybeStates, statesWithProbability01.second.template toAdd<ValueType>(), maybeStates,
118 odd, x));
119 } else {
121 model.getReachableStates(), statesWithProbability01.second.template toAdd<ValueType>()));
122 }
123 }
124}
125
126template<storm::dd::DdType DdType, typename ValueType>
129 storm::dd::Bdd<DdType> const& psiStates, bool qualitative) {
130 std::unique_ptr<CheckResult> result =
131 computeUntilProbabilities(env, model, transitionMatrix, model.getReachableStates(), !psiStates && model.getReachableStates(), qualitative);
132 result->asQuantitativeCheckResult<ValueType>().oneMinus();
133 return result;
134}
135
136template<storm::dd::DdType DdType, typename ValueType>
139 storm::dd::Add<DdType, ValueType> const& transitionMatrix,
140 storm::dd::Bdd<DdType> const& nextStates) {
141 storm::dd::Add<DdType, ValueType> result = transitionMatrix * nextStates.swapVariables(model.getRowColumnMetaVariablePairs()).template toAdd<ValueType>();
142 return std::unique_ptr<CheckResult>(
144}
145
146template<storm::dd::DdType DdType, typename ValueType>
149 storm::dd::Bdd<DdType> const& phiStates, storm::dd::Bdd<DdType> const& psiStates, uint_fast64_t stepBound) {
150 // We need to identify the states which have to be taken out of the matrix, i.e. all states that have
151 // probability 0 or 1 of satisfying the until-formula.
152 storm::dd::Bdd<DdType> statesWithProbabilityGreater0 =
153 storm::utility::graph::performProbGreater0(model, transitionMatrix.notZero(), phiStates, psiStates, stepBound);
154 storm::dd::Bdd<DdType> maybeStates = statesWithProbabilityGreater0 && !psiStates && model.getReachableStates();
155
156 STORM_LOG_INFO("Preprocessing: " << statesWithProbabilityGreater0.getNonZeroCount() << " states with probability greater 0.");
157
158 // If there are maybe states, we need to perform matrix-vector multiplications.
159 if (!maybeStates.isZero()) {
160 storm::utility::Stopwatch conversionWatch;
161
162 // Create the ODD for the translation between symbolic and explicit storage.
163 conversionWatch.start();
164 storm::dd::Odd odd = maybeStates.createOdd();
165 conversionWatch.stop();
166
167 // Create the matrix and the vector for the equation system.
168 storm::dd::Add<DdType, ValueType> maybeStatesAdd = maybeStates.template toAdd<ValueType>();
169
170 // Start by cutting away all rows that do not belong to maybe states. Note that this leaves columns targeting
171 // non-maybe states in the matrix.
172 storm::dd::Add<DdType, ValueType> submatrix = transitionMatrix * maybeStatesAdd;
173
174 // Then compute the vector that contains the one-step probabilities to a state with probability 1 for all
175 // maybe states.
176 storm::dd::Add<DdType, ValueType> prob1StatesAsColumn = psiStates.template toAdd<ValueType>().swapVariables(model.getRowColumnMetaVariablePairs());
177 storm::dd::Add<DdType, ValueType> subvector = (submatrix * prob1StatesAsColumn).sumAbstract(model.getColumnVariables());
178
179 // Finally cut away all columns targeting non-maybe states.
180 submatrix *= maybeStatesAdd.swapVariables(model.getRowColumnMetaVariablePairs());
181
182 // Create the solution vector.
183 std::vector<ValueType> x(maybeStates.getNonZeroCount(), storm::utility::zero<ValueType>());
184
185 // Translate the symbolic matrix/vector to their explicit representations.
186 conversionWatch.start();
187 storm::storage::SparseMatrix<ValueType> explicitSubmatrix = submatrix.toMatrix(odd, odd);
188 std::vector<ValueType> b = subvector.toVector(odd);
189 conversionWatch.stop();
190 STORM_LOG_INFO("Converting symbolic matrix/vector to explicit representation done in " << conversionWatch.getTimeInMilliseconds() << "ms.");
191
192 auto multiplier = storm::solver::MultiplierFactory<ValueType>().create(env, explicitSubmatrix);
193 multiplier->repeatedMultiply(env, x, &b, stepBound);
194
195 // Return a hybrid check result that stores the numerical values explicitly.
196 return std::unique_ptr<CheckResult>(new storm::modelchecker::HybridQuantitativeCheckResult<DdType, ValueType>(
197 model.getReachableStates(), model.getReachableStates() && !maybeStates, psiStates.template toAdd<ValueType>(), maybeStates, odd, x));
198 } else {
199 return std::unique_ptr<CheckResult>(
200 new storm::modelchecker::SymbolicQuantitativeCheckResult<DdType, ValueType>(model.getReachableStates(), psiStates.template toAdd<ValueType>()));
201 }
202}
203
204template<storm::dd::DdType DdType, typename ValueType>
207 RewardModelType const& rewardModel, uint_fast64_t stepBound) {
208 // Only compute the result if the model has at least one reward this->getModel().
209 STORM_LOG_THROW(rewardModel.hasStateRewards(), storm::exceptions::InvalidPropertyException,
210 "Computing instantaneous rewards for a reward model that does not define any state-rewards. The result is trivially 0.");
211
212 storm::utility::Stopwatch conversionWatch(true);
213
214 // Create the ODD for the translation between symbolic and explicit storage.
216
217 // Create the solution vector (and initialize it to the state rewards of the model).
218 std::vector<ValueType> x = rewardModel.getStateRewardVector().toVector(odd);
219
220 // Translate the symbolic matrix to its explicit representations.
221 storm::storage::SparseMatrix<ValueType> explicitMatrix = transitionMatrix.toMatrix(odd, odd);
222 conversionWatch.stop();
223 STORM_LOG_INFO("Converting symbolic matrix/vector to explicit representation done in " << conversionWatch.getTimeInMilliseconds() << "ms.");
224
225 // Perform the matrix-vector multiplication.
226 auto multiplier = storm::solver::MultiplierFactory<ValueType>().create(env, explicitMatrix);
227 multiplier->repeatedMultiply(env, x, nullptr, stepBound);
228
229 // Return a hybrid check result that stores the numerical values explicitly.
230 return std::unique_ptr<CheckResult>(new HybridQuantitativeCheckResult<DdType, ValueType>(
231 model.getReachableStates(), model.getManager().getBddZero(), model.getManager().template getAddZero<ValueType>(), model.getReachableStates(), odd, x));
232}
233
234template<storm::dd::DdType DdType, typename ValueType>
237 storm::dd::Add<DdType, ValueType> const& transitionMatrix,
238 RewardModelType const& rewardModel, uint_fast64_t stepBound) {
239 // Only compute the result if the model has at least one reward this->getModel().
240 STORM_LOG_THROW(!rewardModel.empty(), storm::exceptions::InvalidPropertyException, "Missing reward model for formula. Skipping formula.");
241
242 // Compute the reward vector to add in each step based on the available reward models.
243 storm::dd::Add<DdType, ValueType> totalRewardVector = rewardModel.getTotalRewardVector(transitionMatrix, model.getColumnVariables());
244
245 // Create the solution vector.
246 std::vector<ValueType> x(model.getNumberOfStates(), storm::utility::zero<ValueType>());
247
248 storm::utility::Stopwatch conversionWatch(true);
249
250 // Create the ODD for the translation between symbolic and explicit storage.
252
253 // Translate the symbolic matrix/vector to their explicit representations.
254 storm::storage::SparseMatrix<ValueType> explicitMatrix = transitionMatrix.toMatrix(odd, odd);
255 std::vector<ValueType> b = totalRewardVector.toVector(odd);
256 conversionWatch.stop();
257 STORM_LOG_INFO("Converting symbolic matrix/vector to explicit representation done in " << conversionWatch.getTimeInMilliseconds() << "ms.");
258
259 // Perform the matrix-vector multiplication.
260 auto multiplier = storm::solver::MultiplierFactory<ValueType>().create(env, explicitMatrix);
261 multiplier->repeatedMultiply(env, x, &b, stepBound);
262
263 // Return a hybrid check result that stores the numerical values explicitly.
264 return std::unique_ptr<CheckResult>(new HybridQuantitativeCheckResult<DdType, ValueType>(
265 model.getReachableStates(), model.getManager().getBddZero(), model.getManager().template getAddZero<ValueType>(), model.getReachableStates(), odd, x));
266}
267
268// This function computes an upper bound on the reachability rewards (see Baier et al, CAV'17).
269template<typename ValueType>
270inline std::vector<ValueType> computeUpperRewardBounds(storm::storage::SparseMatrix<ValueType> const& transitionMatrix, std::vector<ValueType> const& rewards,
271 std::vector<ValueType> const& oneStepTargetProbabilities) {
272 DsMpiDtmcUpperRewardBoundsComputer<ValueType> dsmpi(transitionMatrix, rewards, oneStepTargetProbabilities);
273 std::vector<ValueType> bounds = dsmpi.computeUpperBounds();
274 return bounds;
275}
276
277template<>
278inline std::vector<storm::RationalFunction> computeUpperRewardBounds(storm::storage::SparseMatrix<storm::RationalFunction> const& transitionMatrix,
279 std::vector<storm::RationalFunction> const& rewards,
280 std::vector<storm::RationalFunction> const& oneStepTargetProbabilities) {
281 STORM_LOG_THROW(false, storm::exceptions::NotSupportedException, "Computing upper reward bounds is not supported for rational functions.");
282}
283
284template<storm::dd::DdType DdType, typename ValueType>
287 RewardModelType const& rewardModel, storm::dd::Bdd<DdType> const& targetStates, bool qualitative) {
288 // Only compute the result if there is at least one reward model.
289 STORM_LOG_THROW(!rewardModel.empty(), storm::exceptions::InvalidPropertyException, "Missing reward model for formula. Skipping formula.");
290
291 // Determine which states have a reward of infinity by definition.
292 storm::dd::Bdd<DdType> infinityStates = storm::utility::graph::performProb1(model, transitionMatrix.notZero(), model.getReachableStates(), targetStates);
293 infinityStates = !infinityStates && model.getReachableStates();
294 storm::dd::Bdd<DdType> maybeStates = (!targetStates && !infinityStates) && model.getReachableStates();
295
296 STORM_LOG_INFO("Preprocessing: " << infinityStates.getNonZeroCount() << " states with reward infinity, " << targetStates.getNonZeroCount()
297 << " target states (" << maybeStates.getNonZeroCount() << " states remaining).");
298
299 // Check whether we need to compute exact rewards for some states.
300 if (qualitative) {
301 // Set the values for all maybe-states to 1 to indicate that their reward values
302 // are neither 0 nor infinity.
303 return std::unique_ptr<CheckResult>(new SymbolicQuantitativeCheckResult<DdType, ValueType>(
304 model.getReachableStates(),
305 infinityStates.ite(model.getManager().getConstant(storm::utility::infinity<ValueType>()), model.getManager().template getAddZero<ValueType>()) +
306 maybeStates.template toAdd<ValueType>() * model.getManager().template getAddOne<ValueType>()));
307 } else {
308 // If there are maybe states, we need to solve an equation system.
309 if (!maybeStates.isZero()) {
310 storm::utility::Stopwatch conversionWatch;
311
312 // Create the ODD for the translation between symbolic and explicit storage.
313 conversionWatch.start();
314 storm::dd::Odd odd = maybeStates.createOdd();
315 conversionWatch.stop();
316
317 // Create the matrix and the vector for the equation system.
318 storm::dd::Add<DdType, ValueType> maybeStatesAdd = maybeStates.template toAdd<ValueType>();
319
320 // Start by cutting away all rows that do not belong to maybe states. Note that this leaves columns targeting
321 // non-maybe states in the matrix.
322 storm::dd::Add<DdType, ValueType> submatrix = transitionMatrix * maybeStatesAdd;
323
324 // Then compute the state reward vector to use in the computation.
325 storm::dd::Add<DdType, ValueType> subvector = rewardModel.getTotalRewardVector(maybeStatesAdd, submatrix, model.getColumnVariables());
326
327 // Check the requirements of a linear equation solver
328 // We might need to compute upper reward bounds for which the oneStepTargetProbabilities are needed.
329 boost::optional<storm::dd::Add<DdType, ValueType>> oneStepTargetProbs;
331 auto req = linearEquationSolverFactory.getRequirements(env);
332 req.clearLowerBounds();
333 if (req.upperBounds()) {
334 storm::dd::Add<DdType, ValueType> targetStatesAsColumn = targetStates.template toAdd<ValueType>();
335 targetStatesAsColumn = targetStatesAsColumn.swapVariables(model.getRowColumnMetaVariablePairs());
336 oneStepTargetProbs = submatrix * targetStatesAsColumn;
337 oneStepTargetProbs = oneStepTargetProbs->sumAbstract(model.getColumnVariables());
338 req.clearUpperBounds();
339 }
340 STORM_LOG_THROW(!req.hasEnabledCriticalRequirement(), storm::exceptions::UncheckedRequirementException,
341 "Solver requirements " + req.getEnabledRequirementsAsString() + " not checked.");
342
343 // Check whether we need to create an equation system.
344 bool convertToEquationSystem =
346
347 // Finally cut away all columns targeting non-maybe states and potentially convert the matrix
348 // into the matrix needed for solving the equation system (i.e. compute (I-A)).
349 submatrix *= maybeStatesAdd.swapVariables(model.getRowColumnMetaVariablePairs());
350 if (convertToEquationSystem) {
351 submatrix = (model.getRowColumnIdentity() * maybeStatesAdd) - submatrix;
352 }
353
354 // Create the solution vector.
355 std::vector<ValueType> x(maybeStates.getNonZeroCount(), storm::utility::convertNumber<ValueType>(0.5));
356
357 // Translate the symbolic matrix/vector to their explicit representations.
358 conversionWatch.start();
359 storm::storage::SparseMatrix<ValueType> explicitSubmatrix = submatrix.toMatrix(odd, odd);
360 std::vector<ValueType> b = subvector.toVector(odd);
361 conversionWatch.stop();
362 STORM_LOG_INFO("Converting symbolic matrix/vector to explicit representation done in " << conversionWatch.getTimeInMilliseconds() << "ms.");
363
364 // Create the upper bounds vector if one was requested.
365 boost::optional<std::vector<ValueType>> upperBounds;
366 if (oneStepTargetProbs) {
367 // FIXME: This will fail if we already converted the matrix to the equation problem format.
368 STORM_LOG_ASSERT(!convertToEquationSystem, "Upper reward bounds required, but the matrix is in the wrong format for the computation.");
369 upperBounds = computeUpperRewardBounds(explicitSubmatrix, b, oneStepTargetProbs->toVector(odd));
370 }
371
372 // Now solve the resulting equation system.
373 std::unique_ptr<storm::solver::LinearEquationSolver<ValueType>> solver = linearEquationSolverFactory.create(env, std::move(explicitSubmatrix));
374 solver->setLowerBound(storm::utility::zero<ValueType>());
375 if (upperBounds) {
376 solver->setUpperBounds(std::move(upperBounds.get()));
377 }
378 solver->solveEquations(env, x, b);
379
380 // Return a hybrid check result that stores the numerical values explicitly.
381 return std::unique_ptr<CheckResult>(new storm::modelchecker::HybridQuantitativeCheckResult<DdType, ValueType>(
382 model.getReachableStates(), model.getReachableStates() && !maybeStates,
383 infinityStates.ite(model.getManager().getConstant(storm::utility::infinity<ValueType>()), model.getManager().template getAddZero<ValueType>()),
384 maybeStates, odd, x));
385 } else {
387 model.getReachableStates(), infinityStates.ite(model.getManager().getConstant(storm::utility::infinity<ValueType>()),
388 model.getManager().template getAddZero<ValueType>())));
389 }
390 }
391}
392
393template<storm::dd::DdType DdType, typename ValueType>
396 storm::dd::Add<DdType, ValueType> const& transitionMatrix,
397 storm::dd::Bdd<DdType> const& targetStates, bool qualitative) {
398 RewardModelType rewardModel(model.getManager().getConstant(storm::utility::one<ValueType>()), boost::none, boost::none);
399 return computeReachabilityRewards(env, model, transitionMatrix, rewardModel, targetStates, qualitative);
400}
401
404
407} // namespace helper
408} // namespace modelchecker
409} // namespace storm
Add< LibraryType, ValueType > swapVariables(std::vector< std::pair< storm::expressions::Variable, storm::expressions::Variable > > const &metaVariablePairs) const
Swaps the given pairs of meta variables in the ADD.
Definition Add.cpp:292
storm::storage::SparseMatrix< ValueType > toMatrix() const
Converts the ADD to a (sparse) matrix.
Definition Add.cpp:634
Add< LibraryType, ValueType > sumAbstract(std::set< storm::expressions::Variable > const &metaVariables) const
Sum-abstracts from the given meta variables.
Definition Add.cpp:178
Bdd< LibraryType > notZero() const
Computes a BDD that represents the function in which all assignments with a function value unequal to...
Definition Add.cpp:431
std::vector< ValueType > toVector() const
Converts the ADD to a vector.
Definition Add.cpp:552
bool isZero() const
Retrieves whether this DD represents the constant zero function.
Definition Bdd.cpp:547
virtual uint_fast64_t getNonZeroCount() const override
Retrieves the number of encodings that are mapped to a non-zero value.
Definition Bdd.cpp:513
Bdd< LibraryType > swapVariables(std::vector< std::pair< storm::expressions::Variable, storm::expressions::Variable > > const &metaVariablePairs) const
Swaps the given pairs of meta variables in the BDD.
Definition Bdd.cpp:302
Odd createOdd() const
Creates an ODD based on the current BDD.
Definition Bdd.cpp:571
Bdd< LibraryType > ite(Bdd< LibraryType > const &thenBdd, Bdd< LibraryType > const &elseBdd) const
Performs an if-then-else with the given operands, i.e.
Definition Bdd.cpp:113
std::vector< ValueType > computeUpperBounds()
Computes upper bounds on the expected rewards.
static std::unique_ptr< CheckResult > computeReachabilityTimes(Environment const &env, storm::models::symbolic::Model< DdType, ValueType > const &model, storm::dd::Add< DdType, ValueType > const &transitionMatrix, storm::dd::Bdd< DdType > const &targetStates, bool qualitative)
static std::unique_ptr< CheckResult > computeInstantaneousRewards(Environment const &env, storm::models::symbolic::Model< DdType, ValueType > const &model, storm::dd::Add< DdType, ValueType > const &transitionMatrix, RewardModelType const &rewardModel, uint_fast64_t stepBound)
static std::unique_ptr< CheckResult > computeReachabilityRewards(Environment const &env, storm::models::symbolic::Model< DdType, ValueType > const &model, storm::dd::Add< DdType, ValueType > const &transitionMatrix, RewardModelType const &rewardModel, storm::dd::Bdd< DdType > const &targetStates, bool qualitative)
static std::unique_ptr< CheckResult > computeNextProbabilities(Environment const &env, storm::models::symbolic::Model< DdType, ValueType > const &model, storm::dd::Add< DdType, ValueType > const &transitionMatrix, storm::dd::Bdd< DdType > const &nextStates)
static std::unique_ptr< CheckResult > computeGloballyProbabilities(Environment const &env, storm::models::symbolic::Model< DdType, ValueType > const &model, storm::dd::Add< DdType, ValueType > const &transitionMatrix, storm::dd::Bdd< DdType > const &psiStates, bool qualitative)
static std::unique_ptr< CheckResult > computeBoundedUntilProbabilities(Environment const &env, storm::models::symbolic::Model< DdType, ValueType > const &model, storm::dd::Add< DdType, ValueType > const &transitionMatrix, storm::dd::Bdd< DdType > const &phiStates, storm::dd::Bdd< DdType > const &psiStates, uint_fast64_t stepBound)
static std::unique_ptr< CheckResult > computeCumulativeRewards(Environment const &env, storm::models::symbolic::Model< DdType, ValueType > const &model, storm::dd::Add< DdType, ValueType > const &transitionMatrix, RewardModelType const &rewardModel, uint_fast64_t stepBound)
static std::unique_ptr< CheckResult > computeUntilProbabilities(Environment const &env, storm::models::symbolic::Model< DdType, ValueType > const &model, storm::dd::Add< DdType, ValueType > const &transitionMatrix, storm::dd::Bdd< DdType > const &phiStates, storm::dd::Bdd< DdType > const &psiStates, bool qualitative)
Base class for all symbolic models.
Definition Model.h:46
storm::dd::DdManager< Type > & getManager() const
Retrieves the manager responsible for the DDs that represent this model.
Definition Model.cpp:92
std::set< storm::expressions::Variable > const & getColumnVariables() const
Retrieves the meta variables used to encode the columns of the transition matrix and the vector indic...
Definition Model.cpp:197
storm::dd::Add< Type, ValueType > getRowColumnIdentity() const
Retrieves an ADD that represents the diagonal of the transition matrix.
Definition Model.cpp:243
std::vector< std::pair< storm::expressions::Variable, storm::expressions::Variable > > const & getRowColumnMetaVariablePairs() const
Retrieves the pairs of row and column meta variables.
Definition Model.cpp:223
storm::dd::Bdd< Type > const & getReachableStates() const
Retrieves the reachable states of the model.
Definition Model.cpp:102
virtual uint_fast64_t getNumberOfStates() const override
Returns the number of states of the model.
Definition Model.cpp:77
bool hasStateRewards() const
Retrieves whether the reward model has state rewards.
storm::dd::Add< Type, ValueType > getTotalRewardVector(storm::dd::Add< Type, ValueType > const &transitionMatrix, std::set< storm::expressions::Variable > const &columnVariables) const
Creates a vector representing the complete reward vector based on the state-, state-action- and trans...
bool empty() const
Retrieves whether the reward model is empty.
storm::dd::Add< Type, ValueType > const & getStateRewardVector() const
Retrieves the state rewards of the reward model.
virtual std::unique_ptr< LinearEquationSolver< ValueType > > create(Environment const &env) const override
Creates an equation solver with the current settings, but without a matrix.
LinearEquationSolverRequirements getRequirements(Environment const &env) const
Retrieves the requirements of the solver if it was created with the current settings.
virtual LinearEquationSolverProblemFormat getEquationProblemFormat(Environment const &env) const
Retrieves the problem format that the solver expects if it was created with the current settings.
std::unique_ptr< Multiplier< ValueType > > create(Environment const &env, storm::storage::SparseMatrix< ValueType > const &matrix)
A class that holds a possibly non-square matrix in the compressed row storage format.
A class that provides convenience operations to display run times.
Definition Stopwatch.h:14
MilisecondType getTimeInMilliseconds() const
Gets the measured time in milliseconds.
Definition Stopwatch.cpp:21
void start()
Start stopwatch (again) and start measuring time.
Definition Stopwatch.cpp:48
void stop()
Stop stopwatch and add measured time to total time.
Definition Stopwatch.cpp:42
#define STORM_LOG_INFO(message)
Definition logging.h:29
#define STORM_LOG_TRACE(message)
Definition logging.h:17
#define STORM_LOG_ASSERT(cond, message)
Definition macros.h:11
#define STORM_LOG_THROW(cond, exception, message)
Definition macros.h:30
std::vector< ValueType > computeUpperRewardBounds(storm::storage::SparseMatrix< ValueType > const &transitionMatrix, std::vector< ValueType > const &rewards, std::vector< ValueType > const &oneStepTargetProbabilities)
std::pair< storm::storage::BitVector, storm::storage::BitVector > performProb01(storm::models::sparse::DeterministicModel< T > const &model, storm::storage::BitVector const &phiStates, storm::storage::BitVector const &psiStates)
Computes the sets of states that have probability 0 or 1, respectively, of satisfying phi until psi i...
Definition graph.cpp:400
storm::storage::BitVector performProbGreater0(storm::storage::SparseMatrix< T > const &backwardTransitions, storm::storage::BitVector const &phiStates, storm::storage::BitVector const &psiStates, bool useStepBound, uint_fast64_t maximalSteps)
Performs a backward depth-first search trough the underlying graph structure of the given model to de...
Definition graph.cpp:322
storm::storage::BitVector performProb1(storm::storage::SparseMatrix< T > const &backwardTransitions, storm::storage::BitVector const &, storm::storage::BitVector const &psiStates, storm::storage::BitVector const &statesWithProbabilityGreater0)
Computes the set of states of the given model for which all paths lead to the given set of target sta...
Definition graph.cpp:383
LabParser.cpp.
Definition cli.cpp:18