Storm
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
SparseMdpParameterLiftingModelChecker.cpp
Go to the documentation of this file.
4
14#include "storm/utility/graph.h"
16
21
22namespace storm {
23namespace modelchecker {
25template<typename SparseModelType, typename ConstantType>
27 : SparseMdpParameterLiftingModelChecker<SparseModelType, ConstantType>(std::make_unique<storm::solver::GameSolverFactory<ConstantType>>()) {
28 // Intentionally left empty
30
31template<typename SparseModelType, typename ConstantType>
33 std::unique_ptr<storm::solver::GameSolverFactory<ConstantType>>&& solverFactory)
34 : solverFactory(std::move(solverFactory)) {
35 // Intentionally left empty
38template<typename SparseModelType, typename ConstantType>
40 std::shared_ptr<storm::models::ModelBase> parametricModel, CheckTask<storm::logic::Formula, typename SparseModelType::ValueType> const& checkTask) const {
41 bool result = parametricModel->isOfType(storm::models::ModelType::Mdp);
42 result &= parametricModel->isSparseModel();
43 result &= parametricModel->supportsParameters();
44 auto mdp = parametricModel->template as<SparseModelType>();
45 result &= static_cast<bool>(mdp);
46 result &= checkTask.getFormula().isInFragment(storm::logic::reachability()
55 return result;
56}
57
58template<typename SparseModelType, typename ConstantType>
60 Environment const& env, std::shared_ptr<storm::models::ModelBase> parametricModel,
61 CheckTask<storm::logic::Formula, typename SparseModelType::ValueType> const& checkTask, bool generateRegionSplitEstimates, bool allowModelSimplifications) {
62 auto mdp = parametricModel->template as<SparseModelType>();
63 specify_internal(env, mdp, checkTask, !allowModelSimplifications);
64}
65
66template<typename SparseModelType, typename ConstantType>
68 Environment const& env, std::shared_ptr<SparseModelType> parametricModel,
69 CheckTask<storm::logic::Formula, typename SparseModelType::ValueType> const& checkTask, bool skipModelSimplification) {
70 STORM_LOG_ASSERT(this->canHandle(parametricModel, checkTask), "specified model and formula can not be handled by this.");
71
72 reset();
73
74 if (skipModelSimplification) {
75 this->parametricModel = parametricModel;
76 this->specifyFormula(env, checkTask);
77 } else {
79 if (!simplifier.simplify(checkTask.getFormula())) {
80 STORM_LOG_THROW(false, storm::exceptions::UnexpectedException, "Simplifying the model was not successfull.");
81 }
82 this->parametricModel = simplifier.getSimplifiedModel();
83 this->specifyFormula(env, checkTask.substituteFormula(*simplifier.getSimplifiedFormula()));
84 }
85}
86
87template<typename SparseModelType, typename ConstantType>
90 // get the step bound
91 STORM_LOG_THROW(!checkTask.getFormula().hasLowerBound(), storm::exceptions::NotSupportedException, "Lower step bounds are not supported.");
92 STORM_LOG_THROW(checkTask.getFormula().hasUpperBound(), storm::exceptions::NotSupportedException, "Expected a bounded until formula with an upper bound.");
93 STORM_LOG_THROW(checkTask.getFormula().getTimeBoundReference().isStepBound(), storm::exceptions::NotSupportedException,
94 "Expected a bounded until formula with step bounds.");
95 stepBound = checkTask.getFormula().getUpperBound().evaluateAsInt();
96 STORM_LOG_THROW(*stepBound > 0, storm::exceptions::NotSupportedException,
97 "Can not apply parameter lifting on step bounded formula: The step bound has to be positive.");
98 if (checkTask.getFormula().isUpperBoundStrict()) {
99 STORM_LOG_THROW(*stepBound > 0, storm::exceptions::NotSupportedException, "Expected a strict upper step bound that is greater than zero.");
100 --(*stepBound);
101 }
102 STORM_LOG_THROW(*stepBound > 0, storm::exceptions::NotSupportedException,
103 "Can not apply parameter lifting on step bounded formula: The step bound has to be positive.");
104
105 // get the results for the subformulas
106 storm::modelchecker::SparsePropositionalModelChecker<SparseModelType> propositionalChecker(*this->parametricModel);
107 STORM_LOG_THROW(propositionalChecker.canHandle(checkTask.getFormula().getLeftSubformula()) &&
108 propositionalChecker.canHandle(checkTask.getFormula().getRightSubformula()),
109 storm::exceptions::NotSupportedException, "Parameter lifting with non-propositional subformulas is not supported");
110 storm::storage::BitVector phiStates =
111 std::move(propositionalChecker.check(checkTask.getFormula().getLeftSubformula())->asExplicitQualitativeCheckResult().getTruthValuesVector());
112 storm::storage::BitVector psiStates =
113 std::move(propositionalChecker.check(checkTask.getFormula().getRightSubformula())->asExplicitQualitativeCheckResult().getTruthValuesVector());
114
115 // get the maybeStates
116 maybeStates = storm::solver::minimize(checkTask.getOptimizationDirection())
117 ? storm::utility::graph::performProbGreater0A(this->parametricModel->getTransitionMatrix(),
118 this->parametricModel->getTransitionMatrix().getRowGroupIndices(),
119 this->parametricModel->getBackwardTransitions(), phiStates, psiStates, true, *stepBound)
120 : storm::utility::graph::performProbGreater0E(this->parametricModel->getBackwardTransitions(), phiStates, psiStates, true, *stepBound);
121 maybeStates &= ~psiStates;
122
123 // set the result for all non-maybe states
124 resultsForNonMaybeStates = std::vector<ConstantType>(this->parametricModel->getNumberOfStates(), storm::utility::zero<ConstantType>());
125 storm::utility::vector::setVectorValues(resultsForNonMaybeStates, psiStates, storm::utility::one<ConstantType>());
126
127 // if there are maybestates, create the parameterLifter
128 if (!maybeStates.empty()) {
129 // Create the vector of one-step probabilities to go to target states.
130 std::vector<typename SparseModelType::ValueType> b = this->parametricModel->getTransitionMatrix().getConstrainedRowSumVector(
131 storm::storage::BitVector(this->parametricModel->getTransitionMatrix().getRowCount(), true), psiStates);
132
133 parameterLifter = std::make_unique<storm::transformer::ParameterLifter<typename SparseModelType::ValueType, ConstantType>>(
134 this->parametricModel->getTransitionMatrix(), b, this->parametricModel->getTransitionMatrix().getRowFilter(maybeStates), maybeStates);
135 computePlayer1Matrix();
136
137 applyPreviousResultAsHint = false;
138 }
139
140 // We know some bounds for the results
141 lowerResultBound = storm::utility::zero<ConstantType>();
142 upperResultBound = storm::utility::one<ConstantType>();
143}
144
145template<typename SparseModelType, typename ConstantType>
148 // get the results for the subformulas
149 storm::modelchecker::SparsePropositionalModelChecker<SparseModelType> propositionalChecker(*this->parametricModel);
150 STORM_LOG_THROW(propositionalChecker.canHandle(checkTask.getFormula().getLeftSubformula()) &&
151 propositionalChecker.canHandle(checkTask.getFormula().getRightSubformula()),
152 storm::exceptions::NotSupportedException, "Parameter lifting with non-propositional subformulas is not supported");
153 storm::storage::BitVector phiStates =
154 std::move(propositionalChecker.check(checkTask.getFormula().getLeftSubformula())->asExplicitQualitativeCheckResult().getTruthValuesVector());
155 storm::storage::BitVector psiStates =
156 std::move(propositionalChecker.check(checkTask.getFormula().getRightSubformula())->asExplicitQualitativeCheckResult().getTruthValuesVector());
157
158 // get the maybeStates
159 std::pair<storm::storage::BitVector, storm::storage::BitVector> statesWithProbability01 =
161 ? storm::utility::graph::performProb01Min(this->parametricModel->getTransitionMatrix(),
162 this->parametricModel->getTransitionMatrix().getRowGroupIndices(),
163 this->parametricModel->getBackwardTransitions(), phiStates, psiStates)
164 : storm::utility::graph::performProb01Max(this->parametricModel->getTransitionMatrix(),
165 this->parametricModel->getTransitionMatrix().getRowGroupIndices(),
166 this->parametricModel->getBackwardTransitions(), phiStates, psiStates);
167 maybeStates = ~(statesWithProbability01.first | statesWithProbability01.second);
168
169 // set the result for all non-maybe states
170 resultsForNonMaybeStates = std::vector<ConstantType>(this->parametricModel->getNumberOfStates(), storm::utility::zero<ConstantType>());
171 storm::utility::vector::setVectorValues(resultsForNonMaybeStates, statesWithProbability01.second, storm::utility::one<ConstantType>());
172
173 // if there are maybestates, create the parameterLifter
174 if (!maybeStates.empty()) {
175 // Create the vector of one-step probabilities to go to target states.
176 std::vector<typename SparseModelType::ValueType> b = this->parametricModel->getTransitionMatrix().getConstrainedRowSumVector(
177 storm::storage::BitVector(this->parametricModel->getTransitionMatrix().getRowCount(), true), statesWithProbability01.second);
178
179 parameterLifter = std::make_unique<storm::transformer::ParameterLifter<typename SparseModelType::ValueType, ConstantType>>(
180 this->parametricModel->getTransitionMatrix(), b, this->parametricModel->getTransitionMatrix().getRowFilter(maybeStates), maybeStates);
181 computePlayer1Matrix();
182
183 // Check whether there is an EC consisting of maybestates
184 applyPreviousResultAsHint =
185 storm::solver::minimize(checkTask.getOptimizationDirection()) || // when minimizing, there can not be an EC within the maybestates
186 storm::utility::graph::performProb1A(this->parametricModel->getTransitionMatrix(),
187 this->parametricModel->getTransitionMatrix().getRowGroupIndices(),
188 this->parametricModel->getBackwardTransitions(), maybeStates, ~maybeStates)
189 .full();
190 }
191
192 // We know some bounds for the results
193 lowerResultBound = storm::utility::zero<ConstantType>();
194 upperResultBound = storm::utility::one<ConstantType>();
195}
196
197template<typename SparseModelType, typename ConstantType>
200 // get the results for the subformula
201 storm::modelchecker::SparsePropositionalModelChecker<SparseModelType> propositionalChecker(*this->parametricModel);
202 STORM_LOG_THROW(propositionalChecker.canHandle(checkTask.getFormula().getSubformula()), storm::exceptions::NotSupportedException,
203 "Parameter lifting with non-propositional subformulas is not supported");
204 storm::storage::BitVector targetStates =
205 std::move(propositionalChecker.check(checkTask.getFormula().getSubformula())->asExplicitQualitativeCheckResult().getTruthValuesVector());
206
207 // get the maybeStates
208 storm::storage::BitVector infinityStates =
211 this->parametricModel->getTransitionMatrix(), this->parametricModel->getTransitionMatrix().getRowGroupIndices(),
212 this->parametricModel->getBackwardTransitions(), storm::storage::BitVector(this->parametricModel->getNumberOfStates(), true), targetStates)
214 this->parametricModel->getTransitionMatrix(), this->parametricModel->getTransitionMatrix().getRowGroupIndices(),
215 this->parametricModel->getBackwardTransitions(), storm::storage::BitVector(this->parametricModel->getNumberOfStates(), true), targetStates);
216 infinityStates.complement();
217 maybeStates = ~(targetStates | infinityStates);
218
219 // set the result for all the non-maybe states
220 resultsForNonMaybeStates = std::vector<ConstantType>(this->parametricModel->getNumberOfStates(), storm::utility::zero<ConstantType>());
221 storm::utility::vector::setVectorValues(resultsForNonMaybeStates, infinityStates, storm::utility::infinity<ConstantType>());
222
223 // if there are maybestates, create the parameterLifter
224 if (!maybeStates.empty()) {
225 // Create the reward vector
226 STORM_LOG_THROW((checkTask.isRewardModelSet() && this->parametricModel->hasRewardModel(checkTask.getRewardModel())) ||
227 (!checkTask.isRewardModelSet() && this->parametricModel->hasUniqueRewardModel()),
228 storm::exceptions::InvalidPropertyException, "The reward model specified by the CheckTask is not available in the given model.");
229
230 typename SparseModelType::RewardModelType const& rewardModel =
231 checkTask.isRewardModelSet() ? this->parametricModel->getRewardModel(checkTask.getRewardModel()) : this->parametricModel->getUniqueRewardModel();
232
233 std::vector<typename SparseModelType::ValueType> b = rewardModel.getTotalRewardVector(this->parametricModel->getTransitionMatrix());
234
235 // We need to handle choices that lead to an infinity state.
236 // As a maybeState does not have reward infinity, a choice leading to an infinity state will never be picked. Hence, we can unselect the corresponding
237 // rows
238 storm::storage::BitVector selectedRows = this->parametricModel->getTransitionMatrix().getRowFilter(maybeStates, ~infinityStates);
239
240 parameterLifter = std::make_unique<storm::transformer::ParameterLifter<typename SparseModelType::ValueType, ConstantType>>(
241 this->parametricModel->getTransitionMatrix(), b, selectedRows, maybeStates);
242 computePlayer1Matrix(selectedRows);
243
244 // Check whether there is an EC consisting of maybestates
245 applyPreviousResultAsHint =
246 !storm::solver::minimize(checkTask.getOptimizationDirection()) || // when maximizing, there can not be an EC within the maybestates
247 storm::utility::graph::performProb1A(this->parametricModel->getTransitionMatrix(),
248 this->parametricModel->getTransitionMatrix().getRowGroupIndices(),
249 this->parametricModel->getBackwardTransitions(), maybeStates, ~maybeStates)
250 .full();
251 }
252
253 // We only know a lower bound for the result
254 lowerResultBound = storm::utility::zero<ConstantType>();
255}
256
257template<typename SparseModelType, typename ConstantType>
260 // Obtain the stepBound
261 stepBound = checkTask.getFormula().getBound().evaluateAsInt();
262 if (checkTask.getFormula().isBoundStrict()) {
263 STORM_LOG_THROW(*stepBound > 0, storm::exceptions::NotSupportedException, "Expected a strict upper step bound that is greater than zero.");
264 --(*stepBound);
265 }
266 STORM_LOG_THROW(*stepBound > 0, storm::exceptions::NotSupportedException,
267 "Can not apply parameter lifting on step bounded formula: The step bound has to be positive.");
268
269 // Every state is a maybeState
270 maybeStates = storm::storage::BitVector(this->parametricModel->getTransitionMatrix().getColumnCount(), true);
271 resultsForNonMaybeStates = std::vector<ConstantType>(this->parametricModel->getNumberOfStates());
272
273 // Create the reward vector
274 STORM_LOG_THROW((checkTask.isRewardModelSet() && this->parametricModel->hasRewardModel(checkTask.getRewardModel())) ||
275 (!checkTask.isRewardModelSet() && this->parametricModel->hasUniqueRewardModel()),
276 storm::exceptions::InvalidPropertyException, "The reward model specified by the CheckTask is not available in the given model.");
277 typename SparseModelType::RewardModelType const& rewardModel =
278 checkTask.isRewardModelSet() ? this->parametricModel->getRewardModel(checkTask.getRewardModel()) : this->parametricModel->getUniqueRewardModel();
279 std::vector<typename SparseModelType::ValueType> b = rewardModel.getTotalRewardVector(this->parametricModel->getTransitionMatrix());
280
281 parameterLifter = std::make_unique<storm::transformer::ParameterLifter<typename SparseModelType::ValueType, ConstantType>>(
282 this->parametricModel->getTransitionMatrix(), b, storm::storage::BitVector(this->parametricModel->getTransitionMatrix().getRowCount(), true),
283 maybeStates);
284 computePlayer1Matrix();
285
286 applyPreviousResultAsHint = false;
287
288 // We only know a lower bound for the result
289 lowerResultBound = storm::utility::zero<ConstantType>();
290}
291
292template<typename SparseModelType, typename ConstantType>
295 if (!instantiationChecker) {
296 instantiationChecker = std::make_unique<storm::modelchecker::SparseMdpInstantiationModelChecker<SparseModelType, ConstantType>>(*this->parametricModel);
297 instantiationChecker->specifyFormula(this->currentCheckTask->template convertValueType<typename SparseModelType::ValueType>());
298 instantiationChecker->setInstantiationsAreGraphPreserving(true);
299 }
300 return *instantiationChecker;
301}
302
303template<typename SparseModelType, typename ConstantType>
306 storm::solver::OptimizationDirection const& dirForParameters,
308 localMonotonicityResult) {
309 if (maybeStates.empty()) {
310 return std::make_unique<storm::modelchecker::ExplicitQuantitativeCheckResult<ConstantType>>(resultsForNonMaybeStates);
311 }
312
313 parameterLifter->specifyRegion(region, dirForParameters);
314
315 // Set up the solver
316 auto solver = solverFactory->create(env, player1Matrix, parameterLifter->getMatrix());
317 if (lowerResultBound)
318 solver->setLowerBound(lowerResultBound.get());
319 if (upperResultBound)
320 solver->setUpperBound(upperResultBound.get());
321 if (applyPreviousResultAsHint) {
322 solver->setTrackSchedulers(true);
323 x.resize(maybeStates.getNumberOfSetBits(), storm::utility::zero<ConstantType>());
324 if (storm::solver::minimize(dirForParameters) && minSchedChoices && player1SchedChoices)
325 solver->setSchedulerHints(std::move(player1SchedChoices.get()), std::move(minSchedChoices.get()));
326 if (storm::solver::maximize(dirForParameters) && maxSchedChoices && player1SchedChoices)
327 solver->setSchedulerHints(std::move(player1SchedChoices.get()), std::move(maxSchedChoices.get()));
328 } else {
329 x.assign(maybeStates.getNumberOfSetBits(), storm::utility::zero<ConstantType>());
330 }
331 if (this->currentCheckTask->isBoundSet() && this->currentCheckTask->getOptimizationDirection() == dirForParameters && solver->hasSchedulerHints()) {
332 // If we reach this point, we know that after applying the hints, the x-values can only become larger (if we maximize) or smaller (if we minimize).
333 std::unique_ptr<storm::solver::TerminationCondition<ConstantType>> termCond;
334 storm::storage::BitVector relevantStatesInSubsystem = this->currentCheckTask->isOnlyInitialStatesRelevantSet()
335 ? this->parametricModel->getInitialStates() % maybeStates
336 : storm::storage::BitVector(maybeStates.getNumberOfSetBits(), true);
337 if (storm::solver::minimize(dirForParameters)) {
338 // Terminate if the value for ALL relevant states is already below the threshold
339 termCond = std::make_unique<storm::solver::TerminateIfFilteredExtremumBelowThreshold<ConstantType>>(
340 relevantStatesInSubsystem, true, this->currentCheckTask->getBoundThreshold(), false);
341 } else {
342 // Terminate if the value for ALL relevant states is already above the threshold
343 termCond = std::make_unique<storm::solver::TerminateIfFilteredExtremumExceedsThreshold<ConstantType>>(
344 relevantStatesInSubsystem, true, this->currentCheckTask->getBoundThreshold(), true);
345 }
346 solver->setTerminationCondition(std::move(termCond));
347 }
348
349 // Invoke the solver
350 if (stepBound) {
351 STORM_LOG_ASSERT(*stepBound > 0, "Expected positive step bound.");
352 solver->repeatedMultiply(env, this->currentCheckTask->getOptimizationDirection(), dirForParameters, x, &parameterLifter->getVector(), *stepBound);
353 } else {
354 solver->solveGame(env, this->currentCheckTask->getOptimizationDirection(), dirForParameters, x, parameterLifter->getVector());
355 if (applyPreviousResultAsHint) {
356 if (storm::solver::minimize(dirForParameters)) {
357 minSchedChoices = solver->getPlayer2SchedulerChoices();
358 } else {
359 maxSchedChoices = solver->getPlayer2SchedulerChoices();
360 }
361 player1SchedChoices = solver->getPlayer1SchedulerChoices();
362 }
363 }
364
365 // Get the result for the complete model (including maybestates)
366 std::vector<ConstantType> result = resultsForNonMaybeStates;
367 auto maybeStateResIt = x.begin();
368 for (auto const& maybeState : maybeStates) {
369 result[maybeState] = *maybeStateResIt;
370 ++maybeStateResIt;
371 }
372
373 return std::make_unique<storm::modelchecker::ExplicitQuantitativeCheckResult<ConstantType>>(std::move(result));
374}
375
376template<typename SparseModelType, typename ConstantType>
378 boost::optional<storm::storage::BitVector> const& selectedRows) {
379 uint_fast64_t n = 0;
380 if (selectedRows) {
381 // only count selected rows
382 n = selectedRows->getNumberOfSetBits();
383 } else {
384 for (auto const& maybeState : maybeStates) {
385 n += this->parametricModel->getTransitionMatrix().getRowGroupSize(maybeState);
386 }
387 }
388
389 // The player 1 matrix is the identity matrix of size n with the row groups as given by the original matrix (potentially without unselected rows)
390 storm::storage::SparseMatrixBuilder<storm::storage::sparse::state_type> matrixBuilder(n, n, n, true, true, maybeStates.getNumberOfSetBits());
391 uint_fast64_t p1MatrixRow = 0;
392 for (auto maybeState : maybeStates) {
393 matrixBuilder.newRowGroup(p1MatrixRow);
394 if (selectedRows) {
395 for (uint_fast64_t row = selectedRows->getNextSetIndex(this->parametricModel->getTransitionMatrix().getRowGroupIndices()[maybeState]);
396 row < this->parametricModel->getTransitionMatrix().getRowGroupIndices()[maybeState + 1]; row = selectedRows->getNextSetIndex(row + 1)) {
397 matrixBuilder.addNextValue(p1MatrixRow, p1MatrixRow, storm::utility::one<storm::storage::sparse::state_type>());
398 ++p1MatrixRow;
399 }
400 } else {
401 for (uint_fast64_t endOfGroup = p1MatrixRow + this->parametricModel->getTransitionMatrix().getRowGroupSize(maybeState); p1MatrixRow < endOfGroup;
402 ++p1MatrixRow) {
403 matrixBuilder.addNextValue(p1MatrixRow, p1MatrixRow, storm::utility::one<storm::storage::sparse::state_type>());
404 }
405 }
406 }
407 player1Matrix = matrixBuilder.build();
408}
409
410template<typename SparseModelType, typename ConstantType>
412 maybeStates.resize(0);
413 resultsForNonMaybeStates.clear();
414 stepBound = boost::none;
415 instantiationChecker = nullptr;
417 parameterLifter = nullptr;
418 minSchedChoices = boost::none;
419 maxSchedChoices = boost::none;
420 x.clear();
421 lowerResultBound = boost::none;
422 upperResultBound = boost::none;
423 applyPreviousResultAsHint = false;
424}
425
426template<typename SparseModelType, typename ConstantType>
428 if (!minSchedChoices) {
429 return boost::none;
430 }
431
432 storm::storage::Scheduler<ConstantType> result(minSchedChoices->size());
433 uint_fast64_t state = 0;
434 for (auto const& schedulerChoice : minSchedChoices.get()) {
435 result.setChoice(schedulerChoice, state);
436 ++state;
437 }
438
439 return result;
440}
441
442template<typename SparseModelType, typename ConstantType>
444 if (!maxSchedChoices) {
445 return boost::none;
446 }
447
448 storm::storage::Scheduler<ConstantType> result(maxSchedChoices->size());
449 uint_fast64_t state = 0;
450 for (auto const& schedulerChoice : maxSchedChoices.get()) {
451 result.setChoice(schedulerChoice, state);
452 ++state;
453 }
454
455 return result;
456}
457
458template<typename SparseModelType, typename ConstantType>
460 if (!player1SchedChoices) {
461 return boost::none;
462 }
463
464 storm::storage::Scheduler<ConstantType> result(player1SchedChoices->size());
465 uint_fast64_t state = 0;
466 for (auto const& schedulerChoice : player1SchedChoices.get()) {
467 result.setChoice(schedulerChoice, state);
468 ++state;
469 }
470
471 return result;
472}
473
476} // namespace modelchecker
477} // namespace storm
FragmentSpecification & setStepBoundedUntilFormulasAllowed(bool newValue)
FragmentSpecification & setTimeBoundedUntilFormulasAllowed(bool newValue)
FragmentSpecification & setCumulativeRewardFormulasAllowed(bool newValue)
FragmentSpecification & setReachabilityRewardFormulasAllowed(bool newValue)
FragmentSpecification & setRewardOperatorsAllowed(bool newValue)
FragmentSpecification & setBoundedUntilFormulasAllowed(bool newValue)
FragmentSpecification & setTimeBoundedCumulativeRewardFormulasAllowed(bool newValue)
FragmentSpecification & setStepBoundedCumulativeRewardFormulasAllowed(bool newValue)
virtual std::unique_ptr< CheckResult > check(Environment const &env, CheckTask< storm::logic::Formula, SolutionType > const &checkTask)
Checks the provided formula.
CheckTask< NewFormulaType, ValueType > substituteFormula(NewFormulaType const &newFormula) const
Copies the check task from the source while replacing the formula with the new one.
Definition CheckTask.h:52
bool isRewardModelSet() const
Retrieves whether a reward model was set.
Definition CheckTask.h:190
std::string const & getRewardModel() const
Retrieves the reward model over which to perform the checking (if set).
Definition CheckTask.h:197
FormulaType const & getFormula() const
Retrieves the formula from this task.
Definition CheckTask.h:140
storm::OptimizationDirection const & getOptimizationDirection() const
Retrieves the optimization direction (if set).
Definition CheckTask.h:154
storm::storage::ParameterRegion< ParametricType >::VariableType VariableType
Class to efficiently check a formula on a parametric model with different parameter instantiations.
void specifyFormula(CheckTask< storm::logic::Formula, typename SparseModelType::ValueType > const &checkTask)
virtual void specifyReachabilityRewardFormula(Environment const &env, CheckTask< storm::logic::EventuallyFormula, ConstantType > const &checkTask) override
virtual storm::modelchecker::SparseInstantiationModelChecker< SparseModelType, ConstantType > & getInstantiationChecker() override
virtual void specify(Environment const &env, std::shared_ptr< storm::models::ModelBase > parametricModel, CheckTask< storm::logic::Formula, typename SparseModelType::ValueType > const &checkTask, bool generateRegionSplitEstimates=false, bool allowModelSimplification=true) override
virtual std::unique_ptr< CheckResult > computeQuantitativeValues(Environment const &env, storm::storage::ParameterRegion< typename SparseModelType::ValueType > const &region, storm::solver::OptimizationDirection const &dirForParameters, std::shared_ptr< storm::analysis::LocalMonotonicityResult< typename RegionModelChecker< typename SparseModelType::ValueType >::VariableType > > localMonotonicityResult=nullptr) override
boost::optional< storm::storage::Scheduler< ConstantType > > getCurrentMaxScheduler()
virtual void specifyUntilFormula(Environment const &env, CheckTask< storm::logic::UntilFormula, ConstantType > const &checkTask) override
boost::optional< storm::storage::Scheduler< ConstantType > > getCurrentMinScheduler()
virtual void specifyBoundedUntilFormula(const CheckTask< storm::logic::BoundedUntilFormula, ConstantType > &checkTask) override
virtual void specifyCumulativeRewardFormula(const CheckTask< storm::logic::CumulativeRewardFormula, ConstantType > &checkTask) override
boost::optional< storm::storage::Scheduler< ConstantType > > getCurrentPlayer1Scheduler()
virtual bool canHandle(std::shared_ptr< storm::models::ModelBase > parametricModel, CheckTask< storm::logic::Formula, typename SparseModelType::ValueType > const &checkTask) const override
void specify_internal(Environment const &env, std::shared_ptr< SparseModelType > parametricModel, CheckTask< storm::logic::Formula, typename SparseModelType::ValueType > const &checkTask, bool skipModelSimplification)
virtual bool canHandle(CheckTask< storm::logic::Formula, SolutionType > const &checkTask) const override
Determines whether the model checker can handle the given verification task.
A bit vector that is internally represented as a vector of 64-bit values.
Definition BitVector.h:18
void complement()
Negates all bits in the bit vector.
bool full() const
Retrieves whether all bits are set in this bit vector.
This class defines which action is chosen in a particular state of a non-deterministic model.
Definition Scheduler.h:18
void setChoice(SchedulerChoice< ValueType > const &choice, uint_fast64_t modelState, uint_fast64_t memoryState=0)
Sets the choice defined by the scheduler for the given state.
Definition Scheduler.cpp:37
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.
This class performs different steps to simplify the given (parametric) model.
#define STORM_LOG_ASSERT(cond, message)
Definition macros.h:11
#define STORM_LOG_THROW(cond, exception, message)
Definition macros.h:30
FragmentSpecification reachability()
bool constexpr maximize(OptimizationDirection d)
bool constexpr minimize(OptimizationDirection d)
std::pair< storm::storage::BitVector, storm::storage::BitVector > performProb01Max(storm::storage::SparseMatrix< T > const &transitionMatrix, std::vector< uint_fast64_t > const &nondeterministicChoiceIndices, storm::storage::SparseMatrix< T > const &backwardTransitions, storm::storage::BitVector const &phiStates, storm::storage::BitVector const &psiStates)
Definition graph.cpp:835
storm::storage::BitVector performProbGreater0A(storm::storage::SparseMatrix< T > const &transitionMatrix, std::vector< uint_fast64_t > const &nondeterministicChoiceIndices, storm::storage::SparseMatrix< T > const &backwardTransitions, storm::storage::BitVector const &phiStates, storm::storage::BitVector const &psiStates, bool useStepBound, uint_fast64_t maximalSteps, boost::optional< storm::storage::BitVector > const &choiceConstraint)
Computes the sets of states that have probability greater 0 of satisfying phi until psi under any pos...
Definition graph.cpp:857
storm::storage::BitVector performProb1A(storm::models::sparse::NondeterministicModel< T, RM > const &model, storm::storage::SparseMatrix< T > const &backwardTransitions, storm::storage::BitVector const &phiStates, storm::storage::BitVector const &psiStates)
Computes the sets of states that have probability 1 of satisfying phi until psi under all possible re...
Definition graph.cpp:997
storm::storage::BitVector performProbGreater0E(storm::storage::SparseMatrix< T > const &backwardTransitions, storm::storage::BitVector const &phiStates, storm::storage::BitVector const &psiStates, bool useStepBound, uint_fast64_t maximalSteps)
Computes the sets of states that have probability greater 0 of satisfying phi until psi under at leas...
Definition graph.cpp:689
std::pair< storm::storage::BitVector, storm::storage::BitVector > performProb01Min(storm::storage::SparseMatrix< T > const &transitionMatrix, std::vector< uint_fast64_t > const &nondeterministicChoiceIndices, storm::storage::SparseMatrix< T > const &backwardTransitions, storm::storage::BitVector const &phiStates, storm::storage::BitVector const &psiStates)
Definition graph.cpp:1079
storm::storage::BitVector performProb1E(storm::storage::SparseMatrix< T > const &transitionMatrix, std::vector< uint_fast64_t > const &nondeterministicChoiceIndices, storm::storage::SparseMatrix< T > const &backwardTransitions, storm::storage::BitVector const &phiStates, storm::storage::BitVector const &psiStates, boost::optional< storm::storage::BitVector > const &choiceConstraint)
Computes the sets of states that have probability 1 of satisfying phi until psi under at least one po...
Definition graph.cpp:757
void setVectorValues(std::vector< T > &vector, storm::storage::BitVector const &positions, std::vector< T > const &values)
Sets the provided values at the provided positions in the given vector.
Definition vector.h:83
LabParser.cpp.
Definition cli.cpp:18