Storm 1.11.1.1
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
SparseMdpParameterLiftingModelChecker.cpp
Go to the documentation of this file.
2
17#include "storm/utility/graph.h"
20
21namespace storm::modelchecker {
22
23template<typename SparseModelType, typename ConstantType>
25 : SparseMdpParameterLiftingModelChecker<SparseModelType, ConstantType>(std::make_unique<storm::solver::GameSolverFactory<ConstantType>>()) {
26 // Intentionally left empty
27}
28
29template<typename SparseModelType, typename ConstantType>
31 std::unique_ptr<storm::solver::GameSolverFactory<ConstantType>>&& solverFactory)
32 : solverFactory(std::move(solverFactory)) {
33 // Intentionally left empty
34}
35
36template<typename SparseModelType, typename ConstantType>
37bool SparseMdpParameterLiftingModelChecker<SparseModelType, ConstantType>::canHandle(std::shared_ptr<storm::models::ModelBase> parametricModel,
39 bool result = parametricModel->isOfType(storm::models::ModelType::Mdp);
40 result &= parametricModel->isSparseModel();
41 result &= parametricModel->supportsParameters();
42 auto mdp = parametricModel->template as<SparseModelType>();
43 result &= static_cast<bool>(mdp);
44 result &= checkTask.getFormula().isInFragment(storm::logic::reachability()
53 return result;
54}
55
56template<typename SparseModelType, typename ConstantType>
58 std::shared_ptr<storm::models::ModelBase> parametricModel,
60 std::optional<RegionSplitEstimateKind> generateRegionSplitEstimates,
61 std::shared_ptr<MonotonicityBackend<ParametricType>> monotonicityBackend,
62 bool allowModelSimplifications, bool graphPreserving) {
63 STORM_LOG_THROW(this->canHandle(parametricModel, checkTask), storm::exceptions::NotSupportedException,
64 "Combination of model " << parametricModel->getType() << " and formula '" << checkTask.getFormula() << "' is not supported.");
65 STORM_LOG_THROW(graphPreserving, storm::exceptions::NotImplementedException, "Non-graph-preserving regions not implemented for MDPs");
66 this->specifySplitEstimates(generateRegionSplitEstimates, checkTask);
67 this->specifyMonotonicity(monotonicityBackend, checkTask);
68 auto mdp = parametricModel->template as<SparseModelType>();
69 reset();
70
71 if (allowModelSimplifications) {
73 if (!simplifier.simplify(checkTask.getFormula())) {
74 STORM_LOG_THROW(false, storm::exceptions::UnexpectedException, "Simplifying the model was not successfull.");
75 }
76 this->parametricModel = simplifier.getSimplifiedModel();
77 this->specifyFormula(env, checkTask.substituteFormula(*simplifier.getSimplifiedFormula()));
78 } else {
79 this->parametricModel = mdp;
80 this->specifyFormula(env, checkTask);
81 }
82
83 std::shared_ptr<storm::logic::Formula> formulaWithoutBounds = this->currentCheckTask->getFormula().clone();
84 formulaWithoutBounds->asOperatorFormula().removeBound();
85 this->currentFormulaNoBound = formulaWithoutBounds->asSharedPointer();
86 this->currentCheckTaskNoBound = std::make_unique<storm::modelchecker::CheckTask<storm::logic::Formula, ParametricType>>(*this->currentFormulaNoBound);
87}
88
89template<typename SparseModelType, typename ConstantType>
92 // get the step bound
93 STORM_LOG_THROW(!checkTask.getFormula().hasLowerBound(), storm::exceptions::NotSupportedException, "Lower step bounds are not supported.");
94 STORM_LOG_THROW(checkTask.getFormula().hasUpperBound(), storm::exceptions::NotSupportedException, "Expected a bounded until formula with an upper bound.");
95 STORM_LOG_THROW(checkTask.getFormula().getTimeBoundReference().isStepBound(), storm::exceptions::NotSupportedException,
96 "Expected a bounded until formula with step bounds.");
97 stepBound = checkTask.getFormula().getUpperBound().evaluateAsInt();
98 STORM_LOG_THROW(*stepBound > 0, storm::exceptions::NotSupportedException,
99 "Can not apply parameter lifting on step bounded formula: The step bound has to be positive.");
100 if (checkTask.getFormula().isUpperBoundStrict()) {
101 STORM_LOG_THROW(*stepBound > 0, storm::exceptions::NotSupportedException, "Expected a strict upper step bound that is greater than zero.");
102 --(*stepBound);
103 }
104 STORM_LOG_THROW(*stepBound > 0, storm::exceptions::NotSupportedException,
105 "Can not apply parameter lifting on step bounded formula: The step bound has to be positive.");
106
107 // get the results for the subformulas
108 storm::modelchecker::SparsePropositionalModelChecker<SparseModelType> propositionalChecker(*this->parametricModel);
109 STORM_LOG_THROW(propositionalChecker.canHandle(checkTask.getFormula().getLeftSubformula()) &&
110 propositionalChecker.canHandle(checkTask.getFormula().getRightSubformula()),
111 storm::exceptions::NotSupportedException, "Parameter lifting with non-propositional subformulas is not supported");
112 storm::storage::BitVector phiStates =
113 std::move(propositionalChecker.check(checkTask.getFormula().getLeftSubformula())->asExplicitQualitativeCheckResult().getTruthValuesVector());
114 storm::storage::BitVector psiStates =
115 std::move(propositionalChecker.check(checkTask.getFormula().getRightSubformula())->asExplicitQualitativeCheckResult().getTruthValuesVector());
116
117 // get the maybeStates
118 maybeStates = storm::solver::minimize(checkTask.getOptimizationDirection())
119 ? storm::utility::graph::performProbGreater0A(this->parametricModel->getTransitionMatrix(),
120 this->parametricModel->getTransitionMatrix().getRowGroupIndices(),
121 this->parametricModel->getBackwardTransitions(), phiStates, psiStates, true, *stepBound)
122 : storm::utility::graph::performProbGreater0E(this->parametricModel->getBackwardTransitions(), phiStates, psiStates, true, *stepBound);
123 maybeStates &= ~psiStates;
124
125 // set the result for all non-maybe states
126 resultsForNonMaybeStates = std::vector<ConstantType>(this->parametricModel->getNumberOfStates(), storm::utility::zero<ConstantType>());
127 storm::utility::vector::setVectorValues(resultsForNonMaybeStates, psiStates, storm::utility::one<ConstantType>());
128
129 // if there are maybestates, create the parameterLifter
130 if (!maybeStates.empty()) {
131 // Create the vector of one-step probabilities to go to target states.
132 std::vector<ParametricType> b = this->parametricModel->getTransitionMatrix().getConstrainedRowSumVector(
133 storm::storage::BitVector(this->parametricModel->getTransitionMatrix().getRowCount(), true), psiStates);
134
135 parameterLifter = std::make_unique<storm::transformer::ParameterLifter<ParametricType, ConstantType>>(
136 this->parametricModel->getTransitionMatrix(), b, this->parametricModel->getTransitionMatrix().getRowFilter(maybeStates), maybeStates);
137 computePlayer1Matrix();
138
139 applyPreviousResultAsHint = false;
140 }
141
142 // We know some bounds for the results
143 lowerResultBound = storm::utility::zero<ConstantType>();
144 upperResultBound = storm::utility::one<ConstantType>();
145}
146
147template<typename SparseModelType, typename ConstantType>
150 // get the results for the subformulas
151 storm::modelchecker::SparsePropositionalModelChecker<SparseModelType> propositionalChecker(*this->parametricModel);
152 STORM_LOG_THROW(propositionalChecker.canHandle(checkTask.getFormula().getLeftSubformula()) &&
153 propositionalChecker.canHandle(checkTask.getFormula().getRightSubformula()),
154 storm::exceptions::NotSupportedException, "Parameter lifting with non-propositional subformulas is not supported");
155 storm::storage::BitVector phiStates =
156 std::move(propositionalChecker.check(checkTask.getFormula().getLeftSubformula())->asExplicitQualitativeCheckResult().getTruthValuesVector());
157 storm::storage::BitVector psiStates =
158 std::move(propositionalChecker.check(checkTask.getFormula().getRightSubformula())->asExplicitQualitativeCheckResult().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<ConstantType>(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
203 storm::modelchecker::SparsePropositionalModelChecker<SparseModelType> propositionalChecker(*this->parametricModel);
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 =
207 std::move(propositionalChecker.check(checkTask.getFormula().getSubformula())->asExplicitQualitativeCheckResult().getTruthValuesVector());
208
209 // get the maybeStates
210 storm::storage::BitVector infinityStates =
213 this->parametricModel->getTransitionMatrix(), this->parametricModel->getTransitionMatrix().getRowGroupIndices(),
214 this->parametricModel->getBackwardTransitions(), storm::storage::BitVector(this->parametricModel->getNumberOfStates(), true), targetStates)
216 this->parametricModel->getTransitionMatrix(), this->parametricModel->getTransitionMatrix().getRowGroupIndices(),
217 this->parametricModel->getBackwardTransitions(), storm::storage::BitVector(this->parametricModel->getNumberOfStates(), true), targetStates);
218 infinityStates.complement();
219 maybeStates = ~(targetStates | infinityStates);
220
221 // set the result for all the non-maybe states
222 resultsForNonMaybeStates = std::vector<ConstantType>(this->parametricModel->getNumberOfStates(), storm::utility::zero<ConstantType>());
223 storm::utility::vector::setVectorValues(resultsForNonMaybeStates, infinityStates, storm::utility::infinity<ConstantType>());
224
225 // if there are maybestates, create the parameterLifter
226 if (!maybeStates.empty()) {
227 // Create the reward vector
228 STORM_LOG_THROW((checkTask.isRewardModelSet() && this->parametricModel->hasRewardModel(checkTask.getRewardModel())) ||
229 (!checkTask.isRewardModelSet() && this->parametricModel->hasUniqueRewardModel()),
230 storm::exceptions::InvalidPropertyException, "The reward model specified by the CheckTask is not available in the given model.");
231
232 typename SparseModelType::RewardModelType const& rewardModel =
233 checkTask.isRewardModelSet() ? this->parametricModel->getRewardModel(checkTask.getRewardModel()) : this->parametricModel->getUniqueRewardModel();
234
235 std::vector<ParametricType> b = rewardModel.getTotalRewardVector(this->parametricModel->getTransitionMatrix());
236
237 // We need to handle choices that lead to an infinity state.
238 // As a maybeState does not have reward infinity, a choice leading to an infinity state will never be picked. Hence, we can unselect the
239 // corresponding rows
240 storm::storage::BitVector selectedRows = this->parametricModel->getTransitionMatrix().getRowFilter(maybeStates, ~infinityStates);
241
242 parameterLifter = std::make_unique<storm::transformer::ParameterLifter<ParametricType, ConstantType>>(this->parametricModel->getTransitionMatrix(), b,
243 selectedRows, maybeStates);
244 computePlayer1Matrix(selectedRows);
245
246 // Check whether there is an EC consisting of maybestates
247 applyPreviousResultAsHint =
248 !storm::solver::minimize(checkTask.getOptimizationDirection()) || // when maximizing, there can not be an EC within the maybestates
249 storm::utility::graph::performProb1A(this->parametricModel->getTransitionMatrix(),
250 this->parametricModel->getTransitionMatrix().getRowGroupIndices(),
251 this->parametricModel->getBackwardTransitions(), maybeStates, ~maybeStates)
252 .full();
253 }
254
255 // We only know a lower bound for the result
256 lowerResultBound = storm::utility::zero<ConstantType>();
257}
258
259template<typename SparseModelType, typename ConstantType>
262 // Obtain the stepBound
263 stepBound = checkTask.getFormula().getBound().evaluateAsInt();
264 if (checkTask.getFormula().isBoundStrict()) {
265 STORM_LOG_THROW(*stepBound > 0, storm::exceptions::NotSupportedException, "Expected a strict upper step bound that is greater than zero.");
266 --(*stepBound);
267 }
268 STORM_LOG_THROW(*stepBound > 0, storm::exceptions::NotSupportedException,
269 "Can not apply parameter lifting on step bounded formula: The step bound has to be positive.");
270
271 // Every state is a maybeState
272 maybeStates = storm::storage::BitVector(this->parametricModel->getTransitionMatrix().getColumnCount(), true);
273 resultsForNonMaybeStates = std::vector<ConstantType>(this->parametricModel->getNumberOfStates());
274
275 // Create the reward vector
276 STORM_LOG_THROW((checkTask.isRewardModelSet() && this->parametricModel->hasRewardModel(checkTask.getRewardModel())) ||
277 (!checkTask.isRewardModelSet() && this->parametricModel->hasUniqueRewardModel()),
278 storm::exceptions::InvalidPropertyException, "The reward model specified by the CheckTask is not available in the given model.");
279 typename SparseModelType::RewardModelType const& rewardModel =
280 checkTask.isRewardModelSet() ? this->parametricModel->getRewardModel(checkTask.getRewardModel()) : this->parametricModel->getUniqueRewardModel();
281 std::vector<ParametricType> b = rewardModel.getTotalRewardVector(this->parametricModel->getTransitionMatrix());
282
283 parameterLifter = std::make_unique<storm::transformer::ParameterLifter<ParametricType, ConstantType>>(
284 this->parametricModel->getTransitionMatrix(), b, storm::storage::BitVector(this->parametricModel->getTransitionMatrix().getRowCount(), true),
285 maybeStates);
286 computePlayer1Matrix();
287
288 applyPreviousResultAsHint = false;
289
290 // We only know a lower bound for the result
291 lowerResultBound = storm::utility::zero<ConstantType>();
292}
293
294template<typename SparseModelType, typename ConstantType>
297 if (!instantiationChecker) {
298 instantiationChecker = std::make_unique<storm::modelchecker::SparseMdpInstantiationModelChecker<SparseModelType, ConstantType>>(*this->parametricModel);
299 instantiationChecker->specifyFormula(quantitative ? *this->currentCheckTaskNoBound
300 : this->currentCheckTask->template convertValueType<ParametricType>());
301 instantiationChecker->setInstantiationsAreGraphPreserving(true);
302 }
303 return *instantiationChecker;
304}
305
306template<typename SparseModelType, typename ConstantType>
309 // Currently, we do not support any interaction with the monotonicity backend
311}
312
313template<typename SparseModelType, typename ConstantType>
315 Environment const& env, AnnotatedRegion<ParametricType>& region, storm::solver::OptimizationDirection const& dirForParameters) {
316 if (maybeStates.empty()) {
317 this->updateKnownValueBoundInRegion(region, dirForParameters, resultsForNonMaybeStates);
318 return resultsForNonMaybeStates;
319 }
320
321 parameterLifter->specifyRegion(region.region, dirForParameters);
322
323 // Set up the solver
324 auto solver = solverFactory->create(env, player1Matrix, parameterLifter->getMatrix());
325 if (lowerResultBound)
326 solver->setLowerBound(lowerResultBound.value());
327 if (upperResultBound)
328 solver->setUpperBound(upperResultBound.value());
329 if (applyPreviousResultAsHint) {
330 solver->setTrackSchedulers(true);
331 x.resize(maybeStates.getNumberOfSetBits(), storm::utility::zero<ConstantType>());
332 if (storm::solver::minimize(dirForParameters) && minSchedChoices && player1SchedChoices)
333 solver->setSchedulerHints(std::move(player1SchedChoices.value()), std::move(minSchedChoices.value()));
334 if (storm::solver::maximize(dirForParameters) && maxSchedChoices && player1SchedChoices)
335 solver->setSchedulerHints(std::move(player1SchedChoices.value()), std::move(maxSchedChoices.value()));
336 } else {
337 x.assign(maybeStates.getNumberOfSetBits(), storm::utility::zero<ConstantType>());
338 }
339 if (this->currentCheckTask->isBoundSet() && this->currentCheckTask->getOptimizationDirection() == dirForParameters && solver->hasSchedulerHints()) {
340 // 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).
341 std::unique_ptr<storm::solver::TerminationCondition<ConstantType>> termCond;
342 storm::storage::BitVector relevantStatesInSubsystem = this->currentCheckTask->isOnlyInitialStatesRelevantSet()
343 ? this->parametricModel->getInitialStates() % maybeStates
344 : storm::storage::BitVector(maybeStates.getNumberOfSetBits(), true);
345 if (storm::solver::minimize(dirForParameters)) {
346 // Terminate if the value for ALL relevant states is already below the threshold
347 termCond = std::make_unique<storm::solver::TerminateIfFilteredExtremumBelowThreshold<ConstantType>>(
348 relevantStatesInSubsystem, true, this->currentCheckTask->getBoundThreshold(), false);
349 } else {
350 // Terminate if the value for ALL relevant states is already above the threshold
351 termCond = std::make_unique<storm::solver::TerminateIfFilteredExtremumExceedsThreshold<ConstantType>>(
352 relevantStatesInSubsystem, true, this->currentCheckTask->getBoundThreshold(), true);
353 }
354 solver->setTerminationCondition(std::move(termCond));
355 }
356
357 // Invoke the solver
358 if (stepBound) {
359 STORM_LOG_ASSERT(*stepBound > 0, "Expected positive step bound.");
360 solver->repeatedMultiply(env, this->currentCheckTask->getOptimizationDirection(), dirForParameters, x, &parameterLifter->getVector(), *stepBound);
361 } else {
362 solver->solveGame(env, this->currentCheckTask->getOptimizationDirection(), dirForParameters, x, parameterLifter->getVector());
363 if (applyPreviousResultAsHint) {
364 if (storm::solver::minimize(dirForParameters)) {
365 minSchedChoices = solver->getPlayer2SchedulerChoices();
366 } else {
367 maxSchedChoices = solver->getPlayer2SchedulerChoices();
368 }
369 player1SchedChoices = solver->getPlayer1SchedulerChoices();
370 }
371 }
372
373 // Get the result for the complete model (including maybestates)
374 std::vector<ConstantType> result = resultsForNonMaybeStates;
375 auto maybeStateResIt = x.begin();
376 for (auto const& maybeState : maybeStates) {
377 result[maybeState] = *maybeStateResIt;
378 ++maybeStateResIt;
379 }
380 this->updateKnownValueBoundInRegion(region, dirForParameters, result);
381 return result;
382}
383
384template<typename SparseModelType, typename ConstantType>
385void SparseMdpParameterLiftingModelChecker<SparseModelType, ConstantType>::computePlayer1Matrix(std::optional<storm::storage::BitVector> const& selectedRows) {
386 uint64_t n = 0;
387 if (selectedRows) {
388 // only count selected rows
389 n = selectedRows->getNumberOfSetBits();
390 } else {
391 for (auto const& maybeState : maybeStates) {
392 n += this->parametricModel->getTransitionMatrix().getRowGroupSize(maybeState);
393 }
394 }
395
396 // 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)
397 storm::storage::SparseMatrixBuilder<storm::storage::sparse::state_type> matrixBuilder(n, n, n, true, true, maybeStates.getNumberOfSetBits());
398 uint64_t p1MatrixRow = 0;
399 for (auto maybeState : maybeStates) {
400 matrixBuilder.newRowGroup(p1MatrixRow);
401 if (selectedRows) {
402 for (uint64_t row = selectedRows->getNextSetIndex(this->parametricModel->getTransitionMatrix().getRowGroupIndices()[maybeState]);
403 row < this->parametricModel->getTransitionMatrix().getRowGroupIndices()[maybeState + 1]; row = selectedRows->getNextSetIndex(row + 1)) {
404 matrixBuilder.addNextValue(p1MatrixRow, p1MatrixRow, storm::utility::one<storm::storage::sparse::state_type>());
405 ++p1MatrixRow;
406 }
407 } else {
408 for (uint64_t endOfGroup = p1MatrixRow + this->parametricModel->getTransitionMatrix().getRowGroupSize(maybeState); p1MatrixRow < endOfGroup;
409 ++p1MatrixRow) {
410 matrixBuilder.addNextValue(p1MatrixRow, p1MatrixRow, storm::utility::one<storm::storage::sparse::state_type>());
411 }
412 }
413 }
414 player1Matrix = matrixBuilder.build();
415}
416
417template<typename SparseModelType, typename ConstantType>
419 maybeStates.resize(0);
420 resultsForNonMaybeStates.clear();
421 stepBound = std::nullopt;
422 instantiationChecker = nullptr;
424 parameterLifter = nullptr;
425 minSchedChoices = std::nullopt;
426 maxSchedChoices = std::nullopt;
427 x.clear();
428 lowerResultBound = std::nullopt;
429 upperResultBound = std::nullopt;
430 applyPreviousResultAsHint = false;
431}
432
433template<typename ConstantType>
434std::optional<storm::storage::Scheduler<ConstantType>> getSchedulerHelper(std::optional<std::vector<uint64_t>> const& choices) {
435 std::optional<storm::storage::Scheduler<ConstantType>> result;
436 if (choices) {
437 result.emplace(choices->size());
438 uint64_t state = 0;
439 for (auto const& choice : choices.value()) {
440 result->setChoice(choice, state);
441 ++state;
442 }
443 }
444 return result;
445}
446
447template<typename SparseModelType, typename ConstantType>
449 return getSchedulerHelper<ConstantType>(minSchedChoices);
450}
451
452template<typename SparseModelType, typename ConstantType>
454 return getSchedulerHelper<ConstantType>(maxSchedChoices);
455}
456
457template<typename SparseModelType, typename ConstantType>
459 return getSchedulerHelper<ConstantType>(player1SchedChoices);
460}
461
464} // namespace storm::modelchecker
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
virtual bool requiresInteractionWithRegionModelChecker() const
Returns true, if a region model checker needs to implement specific methods to properly use this back...
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)
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()
std::optional< storm::storage::Scheduler< ConstantType > > getCurrentMaxScheduler()
virtual std::vector< ConstantType > 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 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, bool graphPreserving=true) override
virtual void specifyBoundedUntilFormula(const CheckTask< storm::logic::BoundedUntilFormula, ConstantType > &checkTask) override
virtual storm::modelchecker::SparseInstantiationModelChecker< SparseModelType, ConstantType > & getInstantiationChecker(bool quantitative) override
virtual void specifyCumulativeRewardFormula(const CheckTask< storm::logic::CumulativeRewardFormula, ConstantType > &checkTask) override
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: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 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()
std::optional< storm::storage::Scheduler< ConstantType > > getSchedulerHelper(std::optional< std::vector< uint64_t > > const &choices)
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:825
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:847
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:987
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:679
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:1069
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:747
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:82
Region const region
The subregions of this region.