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