Storm 1.14.0.1
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
SparseMdpParameterLiftingModelChecker.cpp
Go to the documentation of this file.
2
16#include "storm/utility/graph.h"
19
20namespace storm::modelchecker {
21
22template<typename SparseModelType, typename ConstantType>
24 : SparseMdpParameterLiftingModelChecker<SparseModelType, ConstantType>(std::make_unique<storm::solver::GameSolverFactory<ConstantType>>()) {
25 // Intentionally left empty
26}
27
28template<typename SparseModelType, typename ConstantType>
30 std::unique_ptr<storm::solver::GameSolverFactory<ConstantType>>&& solverFactory)
31 : solverFactory(std::move(solverFactory)) {
32 // Intentionally left empty
33}
34
35template<typename SparseModelType, typename ConstantType>
38 bool result = parametricModel->isOfType(storm::models::ModelType::Mdp);
39 result &= parametricModel->isSparseModel();
40 result &= parametricModel->supportsParameters();
41 auto mdp = parametricModel->template as<SparseModelType>();
42 result &= static_cast<bool>(mdp);
43 result &= checkTask.getFormula().isInFragment(storm::logic::reachability()
44 .setRewardOperatorsAllowed(true)
45 .setReachabilityRewardFormulasAllowed(true)
46 .setBoundedUntilFormulasAllowed(true)
47 .setCumulativeRewardFormulasAllowed(true)
48 .setStepBoundedUntilFormulasAllowed(true)
49 .setTimeBoundedCumulativeRewardFormulasAllowed(true)
50 .setStepBoundedCumulativeRewardFormulasAllowed(true)
51 .setTimeBoundedUntilFormulasAllowed(true));
52 return result;
53}
54
55template<typename SparseModelType, typename ConstantType>
57 Environment const& env, std::shared_ptr<storm::models::ModelBase> parametricModel, CheckTask<storm::logic::Formula, ParametricType> const& checkTask,
58 std::optional<RegionSplitEstimateKind> generateRegionSplitEstimates, std::shared_ptr<MonotonicityBackend<ParametricType>> monotonicityBackend,
59 bool allowModelSimplifications, storm::pars::analysis::GraphPreservationStatus graphPreservationStatus) {
60 STORM_LOG_THROW(this->canHandle(parametricModel, checkTask), storm::exceptions::NotSupportedException,
61 "Combination of model " << parametricModel->getType() << " and formula '" << checkTask.getFormula() << "' is not supported.");
62 STORM_LOG_THROW(storm::pars::analysis::isGraphPreserving(graphPreservationStatus), storm::exceptions::NotImplementedException,
63 "Non-graph-preserving regions not implemented for MDPs.");
64 this->specifySplitEstimates(generateRegionSplitEstimates, checkTask);
66 auto mdp = parametricModel->template as<SparseModelType>();
67 reset();
68
69 if (allowModelSimplifications) {
71 STORM_LOG_THROW(simplifier.simplify(checkTask.getFormula()), storm::exceptions::UnexpectedException, "Simplifying the model was not successfull.");
72 this->parametricModel = simplifier.getSimplifiedModel();
73 this->specifyFormula(env, checkTask.substituteFormula(*simplifier.getSimplifiedFormula()));
74 } else {
75 this->parametricModel = mdp;
76 this->specifyFormula(env, checkTask);
77 }
78
79 std::shared_ptr<storm::logic::Formula> formulaWithoutBounds = this->currentCheckTask->getFormula().clone();
80 formulaWithoutBounds->asOperatorFormula().removeBound();
81 this->currentFormulaNoBound = formulaWithoutBounds->asSharedPointer();
82 this->currentCheckTaskNoBound = std::make_unique<storm::modelchecker::CheckTask<storm::logic::Formula, ParametricType>>(*this->currentFormulaNoBound);
83}
84
85template<typename SparseModelType, typename ConstantType>
88 // get the step bound
89 STORM_LOG_THROW(!checkTask.getFormula().hasLowerBound(), storm::exceptions::NotSupportedException, "Lower step bounds are not supported.");
90 STORM_LOG_THROW(checkTask.getFormula().hasUpperBound(), storm::exceptions::NotSupportedException, "Expected a bounded until formula with an upper bound.");
91 STORM_LOG_THROW(checkTask.getFormula().getTimeBoundReference().isStepBound(), storm::exceptions::NotSupportedException,
92 "Expected a bounded until formula with step bounds.");
93 stepBound = checkTask.getFormula().getUpperBound().evaluateAsInt();
94 STORM_LOG_THROW(*stepBound > 0, storm::exceptions::NotSupportedException,
95 "Can not apply parameter lifting on step bounded formula: The step bound has to be positive.");
96 if (checkTask.getFormula().isUpperBoundStrict()) {
97 STORM_LOG_THROW(*stepBound > 0, storm::exceptions::NotSupportedException, "Expected a strict upper step bound that is greater than zero.");
98 --(*stepBound);
99 }
100 STORM_LOG_THROW(*stepBound > 0, storm::exceptions::NotSupportedException,
101 "Can not apply parameter lifting on step bounded formula: The step bound has to be positive.");
102
103 // get the results for the subformulas
105 STORM_LOG_THROW(propositionalChecker.canHandle(checkTask.getFormula().getLeftSubformula()) &&
106 propositionalChecker.canHandle(checkTask.getFormula().getRightSubformula()),
107 storm::exceptions::NotSupportedException, "Parameter lifting with non-propositional subformulas is not supported.");
108 storm::storage::BitVector phiStates = std::move(propositionalChecker.check(checkTask.getFormula().getLeftSubformula())
109 ->template asExplicitQualitativeCheckResult<typename SparseModelType::ValueType>()
110 .getTruthValuesVector());
111 storm::storage::BitVector psiStates = std::move(propositionalChecker.check(checkTask.getFormula().getRightSubformula())
112 ->template asExplicitQualitativeCheckResult<typename SparseModelType::ValueType>()
113 .getTruthValuesVector());
114
115 // get the maybeStates
116 maybeStates = storm::solver::minimize(checkTask.getOptimizationDirection())
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<ExtendedConstantType>(this->parametricModel->getNumberOfStates(), storm::utility::zero<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<ParametricType> b = this->parametricModel->getTransitionMatrix().getConstrainedRowSumVector(
131 storm::storage::BitVector(this->parametricModel->getTransitionMatrix().getRowCount(), true), psiStates);
132
133 parameterLifter = std::make_unique<storm::transformer::ParameterLifter<ParametricType, 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
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 = std::move(propositionalChecker.check(checkTask.getFormula().getLeftSubformula())
154 ->template asExplicitQualitativeCheckResult<typename SparseModelType::ValueType>()
155 .getTruthValuesVector());
156 storm::storage::BitVector psiStates = std::move(propositionalChecker.check(checkTask.getFormula().getRightSubformula())
157 ->template asExplicitQualitativeCheckResult<typename SparseModelType::ValueType>()
158 .getTruthValuesVector());
159
160 // get the maybeStates
161 std::pair<storm::storage::BitVector, storm::storage::BitVector> statesWithProbability01 =
163 ? storm::utility::graph::performProb01Min(this->parametricModel->getTransitionMatrix(),
164 this->parametricModel->getTransitionMatrix().getRowGroupIndices(),
165 this->parametricModel->getBackwardTransitions(), phiStates, psiStates)
166 : storm::utility::graph::performProb01Max(this->parametricModel->getTransitionMatrix(),
167 this->parametricModel->getTransitionMatrix().getRowGroupIndices(),
168 this->parametricModel->getBackwardTransitions(), phiStates, psiStates);
169 maybeStates = ~(statesWithProbability01.first | statesWithProbability01.second);
170
171 // set the result for all non-maybe states
172 resultsForNonMaybeStates = std::vector<ExtendedConstantType>(this->parametricModel->getNumberOfStates(), storm::utility::zero<ConstantType>());
173 storm::utility::vector::setVectorValues(resultsForNonMaybeStates, statesWithProbability01.second, storm::utility::one<ConstantType>());
174
175 // if there are maybestates, create the parameterLifter
176 if (!maybeStates.empty()) {
177 // Create the vector of one-step probabilities to go to target states.
178 std::vector<ParametricType> b = this->parametricModel->getTransitionMatrix().getConstrainedRowSumVector(
179 storm::storage::BitVector(this->parametricModel->getTransitionMatrix().getRowCount(), true), statesWithProbability01.second);
180
181 parameterLifter = std::make_unique<storm::transformer::ParameterLifter<ParametricType, ConstantType>>(
182 this->parametricModel->getTransitionMatrix(), b, this->parametricModel->getTransitionMatrix().getRowFilter(maybeStates), maybeStates);
183 computePlayer1Matrix();
184
185 // Check whether there is an EC consisting of maybestates
186 applyPreviousResultAsHint =
187 storm::solver::minimize(checkTask.getOptimizationDirection()) || // when minimizing, there can not be an EC within the maybestates
188 storm::utility::graph::performProb1A(this->parametricModel->getTransitionMatrix(),
189 this->parametricModel->getTransitionMatrix().getRowGroupIndices(),
190 this->parametricModel->getBackwardTransitions(), maybeStates, ~maybeStates)
191 .full();
192 }
193
194 // We know some bounds for the results
195 lowerResultBound = storm::utility::zero<ConstantType>();
196 upperResultBound = storm::utility::one<ConstantType>();
197}
198
199template<typename SparseModelType, typename ConstantType>
202 // get the results for the subformula
204 STORM_LOG_THROW(propositionalChecker.canHandle(checkTask.getFormula().getSubformula()), storm::exceptions::NotSupportedException,
205 "Parameter lifting with non-propositional subformulas is not supported.");
206 storm::storage::BitVector targetStates = std::move(propositionalChecker.check(checkTask.getFormula().getSubformula())
207 ->template asExplicitQualitativeCheckResult<typename SparseModelType::ValueType>()
208 .getTruthValuesVector());
209
210 // get the maybeStates
211 storm::storage::BitVector infinityStates =
214 this->parametricModel->getTransitionMatrix(), this->parametricModel->getTransitionMatrix().getRowGroupIndices(),
215 this->parametricModel->getBackwardTransitions(), storm::storage::BitVector(this->parametricModel->getNumberOfStates(), true), targetStates)
217 this->parametricModel->getTransitionMatrix(), this->parametricModel->getTransitionMatrix().getRowGroupIndices(),
218 this->parametricModel->getBackwardTransitions(), storm::storage::BitVector(this->parametricModel->getNumberOfStates(), true), targetStates);
219 infinityStates.complement();
220 maybeStates = ~(targetStates | infinityStates);
221
222 // set the result for all the non-maybe states
223 resultsForNonMaybeStates = std::vector<ExtendedConstantType>(this->parametricModel->getNumberOfStates(), storm::utility::zero<ConstantType>());
225
226 // if there are maybestates, create the parameterLifter
227 if (!maybeStates.empty()) {
228 // Create the reward vector
229 STORM_LOG_THROW((checkTask.isRewardModelSet() && this->parametricModel->hasRewardModel(checkTask.getRewardModel())) ||
230 (!checkTask.isRewardModelSet() && this->parametricModel->hasUniqueRewardModel()),
231 storm::exceptions::InvalidPropertyException, "The reward model specified by the CheckTask is not available in the given model.");
232
233 typename SparseModelType::RewardModelType const& rewardModel =
234 checkTask.isRewardModelSet() ? this->parametricModel->getRewardModel(checkTask.getRewardModel()) : this->parametricModel->getUniqueRewardModel();
235
236 std::vector<ParametricType> b = rewardModel.getTotalRewardVector(this->parametricModel->getTransitionMatrix());
237
238 // We need to handle choices that lead to an infinity state.
239 // As a maybeState does not have reward infinity, a choice leading to an infinity state will never be picked. Hence, we can unselect the
240 // corresponding rows
241 storm::storage::BitVector selectedRows = this->parametricModel->getTransitionMatrix().getRowFilter(maybeStates, ~infinityStates);
242
243 parameterLifter = std::make_unique<storm::transformer::ParameterLifter<ParametricType, ConstantType>>(this->parametricModel->getTransitionMatrix(), b,
244 selectedRows, maybeStates);
245 computePlayer1Matrix(selectedRows);
246
247 // Check whether there is an EC consisting of maybestates
248 applyPreviousResultAsHint =
249 !storm::solver::minimize(checkTask.getOptimizationDirection()) || // when maximizing, there can not be an EC within the maybestates
250 storm::utility::graph::performProb1A(this->parametricModel->getTransitionMatrix(),
251 this->parametricModel->getTransitionMatrix().getRowGroupIndices(),
252 this->parametricModel->getBackwardTransitions(), maybeStates, ~maybeStates)
253 .full();
254 }
255
256 // We only know a lower bound for the result
257 lowerResultBound = storm::utility::zero<ConstantType>();
258}
259
260template<typename SparseModelType, typename ConstantType>
263 // Obtain the stepBound
264 stepBound = checkTask.getFormula().getBound().evaluateAsInt();
265 if (checkTask.getFormula().isBoundStrict()) {
266 STORM_LOG_THROW(*stepBound > 0, storm::exceptions::NotSupportedException, "Expected a strict upper step bound that is greater than zero.");
267 --(*stepBound);
268 }
269 STORM_LOG_THROW(*stepBound > 0, storm::exceptions::NotSupportedException,
270 "Can not apply parameter lifting on step bounded formula: The step bound has to be positive.");
271
272 // Every state is a maybeState
273 maybeStates = storm::storage::BitVector(this->parametricModel->getTransitionMatrix().getColumnCount(), true);
274 resultsForNonMaybeStates = std::vector<ExtendedConstantType>(this->parametricModel->getNumberOfStates());
275
276 // Create the reward vector
277 STORM_LOG_THROW((checkTask.isRewardModelSet() && this->parametricModel->hasRewardModel(checkTask.getRewardModel())) ||
278 (!checkTask.isRewardModelSet() && this->parametricModel->hasUniqueRewardModel()),
279 storm::exceptions::InvalidPropertyException, "The reward model specified by the CheckTask is not available in the given model.");
280 typename SparseModelType::RewardModelType const& rewardModel =
281 checkTask.isRewardModelSet() ? this->parametricModel->getRewardModel(checkTask.getRewardModel()) : this->parametricModel->getUniqueRewardModel();
282 std::vector<ParametricType> b = rewardModel.getTotalRewardVector(this->parametricModel->getTransitionMatrix());
283
284 parameterLifter = std::make_unique<storm::transformer::ParameterLifter<ParametricType, ConstantType>>(
285 this->parametricModel->getTransitionMatrix(), b, storm::storage::BitVector(this->parametricModel->getTransitionMatrix().getRowCount(), true),
286 maybeStates);
287 computePlayer1Matrix();
288
289 applyPreviousResultAsHint = false;
290
291 // We only know a lower bound for the result
292 lowerResultBound = storm::utility::zero<ConstantType>();
293}
294
295template<typename SparseModelType, typename ConstantType>
298 if (!instantiationChecker) {
299 instantiationChecker =
300 std::make_unique<storm::modelchecker::SparseMdpInstantiationModelChecker<SparseModelType, ConstantType>>(env, *this->parametricModel);
301 instantiationChecker->specifyFormula(quantitative ? *this->currentCheckTaskNoBound
302 : this->currentCheckTask->template convertValueType<ParametricType>());
303 instantiationChecker->setInstantiationsAreGraphPreserving(true);
304 }
305 return *instantiationChecker;
306}
307
308template<typename SparseModelType, typename ConstantType>
311 // Currently, we do not support any interaction with the monotonicity backend
313}
314
315template<typename SparseModelType, typename ConstantType>
316std::vector<typename SparseMdpParameterLiftingModelChecker<SparseModelType, ConstantType>::ExtendedConstantType>
318 storm::solver::OptimizationDirection const& dirForParameters) {
319 if (maybeStates.empty()) {
320 this->updateKnownValueBoundInRegion(region, dirForParameters, resultsForNonMaybeStates);
321 return resultsForNonMaybeStates;
322 }
323
324 parameterLifter->specifyRegion(region.region, dirForParameters);
325
326 // Set up the solver
327 auto solver = solverFactory->create(env, player1Matrix, parameterLifter->getMatrix());
328 if (lowerResultBound) {
329 solver->setLowerBound(lowerResultBound.value());
330 }
331 if (upperResultBound) {
332 solver->setUpperBound(upperResultBound.value());
333 }
334 if (applyPreviousResultAsHint) {
335 solver->setTrackSchedulers(true);
336 x.resize(maybeStates.getNumberOfSetBits(), storm::utility::zero<ConstantType>());
337 if (storm::solver::minimize(dirForParameters) && minSchedChoices && player1SchedChoices) {
338 solver->setSchedulerHints(std::move(player1SchedChoices.value()), std::move(minSchedChoices.value()));
339 }
340 if (storm::solver::maximize(dirForParameters) && maxSchedChoices && player1SchedChoices) {
341 solver->setSchedulerHints(std::move(player1SchedChoices.value()), std::move(maxSchedChoices.value()));
342 }
343 } else {
344 x.assign(maybeStates.getNumberOfSetBits(), storm::utility::zero<ConstantType>());
345 }
346 if (this->currentCheckTask->isBoundSet() && this->currentCheckTask->getOptimizationDirection() == dirForParameters && solver->hasSchedulerHints()) {
347 // 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).
348 std::unique_ptr<storm::solver::TerminationCondition<ConstantType>> termCond;
349 storm::storage::BitVector relevantStatesInSubsystem = this->currentCheckTask->isOnlyInitialStatesRelevantSet()
350 ? this->parametricModel->getInitialStates() % maybeStates
351 : storm::storage::BitVector(maybeStates.getNumberOfSetBits(), true);
352 if (storm::solver::minimize(dirForParameters)) {
353 // Terminate if the value for ALL relevant states is already below the threshold
354 termCond = std::make_unique<storm::solver::TerminateIfFilteredExtremumBelowThreshold<ConstantType>>(
355 relevantStatesInSubsystem, true, this->currentCheckTask->getBoundThreshold(), false);
356 } else {
357 // Terminate if the value for ALL relevant states is already above the threshold
358 termCond = std::make_unique<storm::solver::TerminateIfFilteredExtremumExceedsThreshold<ConstantType>>(
359 relevantStatesInSubsystem, true, this->currentCheckTask->getBoundThreshold(), true);
360 }
361 solver->setTerminationCondition(std::move(termCond));
362 }
363
364 // Invoke the solver
365 if (stepBound) {
366 STORM_LOG_ASSERT(*stepBound > 0, "Expected positive step bound.");
367 solver->repeatedMultiply(env, this->currentCheckTask->getOptimizationDirection(), dirForParameters, x, &parameterLifter->getVector(), *stepBound);
368 } else {
369 solver->solveGame(env, this->currentCheckTask->getOptimizationDirection(), dirForParameters, x, parameterLifter->getVector());
370 if (applyPreviousResultAsHint) {
371 if (storm::solver::minimize(dirForParameters)) {
372 minSchedChoices = solver->getPlayer2SchedulerChoices();
373 } else {
374 maxSchedChoices = solver->getPlayer2SchedulerChoices();
375 }
376 player1SchedChoices = solver->getPlayer1SchedulerChoices();
377 }
378 }
379
380 // Get the result for the complete model (including maybestates)
381 std::vector<ExtendedConstantType> result = resultsForNonMaybeStates;
382 auto maybeStateResIt = x.begin();
383 for (uint64_t maybeState : maybeStates) {
384 result[maybeState] = *maybeStateResIt;
385 ++maybeStateResIt;
386 }
387 this->updateKnownValueBoundInRegion(region, dirForParameters, result);
388 return result;
389}
390
391template<typename SparseModelType, typename ConstantType>
392void SparseMdpParameterLiftingModelChecker<SparseModelType, ConstantType>::computePlayer1Matrix(std::optional<storm::storage::BitVector> const& selectedRows) {
393 uint64_t n = 0;
394 if (selectedRows) {
395 // only count selected rows
396 n = selectedRows->getNumberOfSetBits();
397 } else {
398 for (uint64_t maybeState : maybeStates) {
399 n += this->parametricModel->getTransitionMatrix().getRowGroupSize(maybeState);
400 }
401 }
402
403 // 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)
404 storm::storage::SparseMatrixBuilder<storm::storage::sparse::state_type> matrixBuilder(n, n, n, true, true, maybeStates.getNumberOfSetBits());
405 uint64_t p1MatrixRow = 0;
406 for (uint64_t maybeState : maybeStates) {
407 matrixBuilder.newRowGroup(p1MatrixRow);
408 if (selectedRows) {
409 for (uint64_t row = selectedRows->getNextSetIndex(this->parametricModel->getTransitionMatrix().getRowGroupIndices()[maybeState]);
410 row < this->parametricModel->getTransitionMatrix().getRowGroupIndices()[maybeState + 1]; row = selectedRows->getNextSetIndex(row + 1)) {
411 matrixBuilder.addNextValue(p1MatrixRow, p1MatrixRow, storm::utility::one<storm::storage::sparse::state_type>());
412 ++p1MatrixRow;
413 }
414 } else {
415 for (uint64_t endOfGroup = p1MatrixRow + this->parametricModel->getTransitionMatrix().getRowGroupSize(maybeState); p1MatrixRow < endOfGroup;
416 ++p1MatrixRow) {
417 matrixBuilder.addNextValue(p1MatrixRow, p1MatrixRow, storm::utility::one<storm::storage::sparse::state_type>());
418 }
419 }
420 }
421 player1Matrix = matrixBuilder.build();
422}
423
424template<typename SparseModelType, typename ConstantType>
426 maybeStates.resize(0);
427 resultsForNonMaybeStates.clear();
428 stepBound = std::nullopt;
429 instantiationChecker = nullptr;
431 parameterLifter = nullptr;
432 minSchedChoices = std::nullopt;
433 maxSchedChoices = std::nullopt;
434 x.clear();
435 lowerResultBound = std::nullopt;
436 upperResultBound = std::nullopt;
437 applyPreviousResultAsHint = false;
438}
439
440template<typename ConstantType>
441std::optional<storm::storage::Scheduler<ConstantType>> getSchedulerHelper(std::optional<std::vector<uint64_t>> const& choices) {
442 std::optional<storm::storage::Scheduler<ConstantType>> result;
443 if (choices) {
444 result.emplace(choices->size());
445 uint64_t state = 0;
446 for (auto const& choice : choices.value()) {
447 result->setChoice(choice, state);
448 ++state;
449 }
450 }
451 return result;
452}
453
454template<typename SparseModelType, typename ConstantType>
456 return getSchedulerHelper<ConstantType>(minSchedChoices);
457}
458
459template<typename SparseModelType, typename ConstantType>
461 return getSchedulerHelper<ConstantType>(maxSchedChoices);
462}
463
464template<typename SparseModelType, typename ConstantType>
466 return getSchedulerHelper<ConstantType>(player1SchedChoices);
467}
468
471} // namespace storm::modelchecker
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:53
bool isRewardModelSet() const
Retrieves whether a reward model was set.
Definition CheckTask.h:191
std::string const & getRewardModel() const
Retrieves the reward model over which to perform the checking (if set).
Definition CheckTask.h:198
FormulaType const & getFormula() const
Retrieves the formula from this task.
Definition CheckTask.h:141
storm::OptimizationDirection const & getOptimizationDirection() const
Retrieves the optimization direction (if set).
Definition CheckTask.h:155
virtual bool requiresInteractionWithRegionModelChecker() const
Returns true, if a region model checker needs to implement specific methods to properly use this back...
virtual void specifyMonotonicity(std::shared_ptr< MonotonicityBackend< SparseModelType::ValueType > > backend, CheckTask< storm::logic::Formula, SparseModelType::ValueType > const &checkTask)
std::shared_ptr< MonotonicityBackend< SparseModelType::ValueType > > monotonicityBackend
virtual void specifySplitEstimates(std::optional< RegionSplitEstimateKind > splitEstimates, CheckTask< storm::logic::Formula, SparseModelType::ValueType > const &checkTask)
Class to efficiently check a formula on a parametric model with different parameter instantiations.
std::optional< storm::storage::Scheduler< ConstantType > > getCurrentMinScheduler()
virtual void specifyReachabilityRewardFormula(Environment const &env, CheckTask< storm::logic::EventuallyFormula, ConstantType > const &checkTask) override
std::optional< storm::storage::Scheduler< ConstantType > > getCurrentPlayer1Scheduler()
virtual void specify(Environment const &env, std::shared_ptr< storm::models::ModelBase > parametricModel, CheckTask< storm::logic::Formula, ParametricType > const &checkTask, std::optional< RegionSplitEstimateKind > generateRegionSplitEstimates=std::nullopt, std::shared_ptr< MonotonicityBackend< ParametricType > > monotonicityBackend={}, bool allowModelSimplifications=true, storm::pars::analysis::GraphPreservationStatus graphPreservationStatus=storm::pars::analysis::GraphPreservationStatus::GraphPreserving) override
std::optional< storm::storage::Scheduler< ConstantType > > getCurrentMaxScheduler()
virtual std::vector< ExtendedConstantType > computeQuantitativeValues(Environment const &env, AnnotatedRegion< ParametricType > &region, storm::solver::OptimizationDirection const &dirForParameters) override
virtual bool isMonotonicitySupported(MonotonicityBackend< ParametricType > const &backend, CheckTask< storm::logic::Formula, ParametricType > const &checkTask) const override
Returns whether this region model checker can work together with the given monotonicity backend.
virtual bool canHandle(std::shared_ptr< storm::models::ModelBase > parametricModel, CheckTask< storm::logic::Formula, ParametricType > const &checkTask) const override
virtual void specifyUntilFormula(Environment const &env, CheckTask< storm::logic::UntilFormula, ConstantType > const &checkTask) override
virtual storm::modelchecker::SparseInstantiationModelChecker< SparseModelType, ConstantType > & getInstantiationChecker(Environment const &env, bool quantitative) override
virtual void specifyBoundedUntilFormula(const CheckTask< storm::logic::BoundedUntilFormula, ConstantType > &checkTask) override
virtual void specifyCumulativeRewardFormula(const CheckTask< storm::logic::CumulativeRewardFormula, ConstantType > &checkTask) override
void updateKnownValueBoundInRegion(AnnotatedRegion< ParametricType > &region, storm::solver::OptimizationDirection dir, std::vector< ExtendedConstantType > const &newValues)
std::unique_ptr< CheckTask< storm::logic::Formula, ConstantType > > currentCheckTask
void specifyFormula(Environment const &env, CheckTask< storm::logic::Formula, ParametricType > const &checkTask)
virtual bool canHandle(CheckTask< storm::logic::Formula, SolutionType > const &checkTask) const override
A bit vector that is internally represented as a vector of 64-bit values.
Definition BitVector.h:16
void complement()
Negates all bits in the bit vector.
bool full() const
Retrieves whether all bits are set in this bit vector.
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:9
#define STORM_LOG_THROW(cond, exception, message)
Definition macros.h:39
FragmentSpecification reachability()
std::optional< storm::storage::Scheduler< ConstantType > > getSchedulerHelper(std::optional< std::vector< uint64_t > > const &choices)
GraphPreservationStatus
Describes to what extent a set of regions is known to be well-defined and to preserve the graph struc...
bool isGraphPreserving(GraphPreservationStatus status)
Returns whether the given status guarantees that the graph structure of the model is preserved.
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:855
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:881
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:1019
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:674
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:1101
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:740
void setVectorValues(std::vector< T > &vector, storm::storage::BitVector const &positions, std::vector< S > const &values)
Sets the provided values at the provided positions in the given vector.
Definition vector.h:79
ExtendedValueType< ValueType > positiveInfinity()
ValueType zero()
Definition constants.cpp:26
ValueType one()
Definition constants.cpp:21