Storm 1.11.1.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>
36bool SparseMdpParameterLiftingModelChecker<SparseModelType, ConstantType>::canHandle(std::shared_ptr<storm::models::ModelBase> parametricModel,
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()
52 return result;
53}
54
55template<typename SparseModelType, typename ConstantType>
57 std::shared_ptr<storm::models::ModelBase> parametricModel,
59 std::optional<RegionSplitEstimateKind> generateRegionSplitEstimates,
60 std::shared_ptr<MonotonicityBackend<ParametricType>> monotonicityBackend,
61 bool allowModelSimplifications, bool graphPreserving) {
62 STORM_LOG_THROW(this->canHandle(parametricModel, checkTask), storm::exceptions::NotSupportedException,
63 "Combination of model " << parametricModel->getType() << " and formula '" << checkTask.getFormula() << "' is not supported.");
64 STORM_LOG_THROW(graphPreserving, storm::exceptions::NotImplementedException, "Non-graph-preserving regions not implemented for MDPs");
65 this->specifySplitEstimates(generateRegionSplitEstimates, checkTask);
66 this->specifyMonotonicity(monotonicityBackend, checkTask);
67 auto mdp = parametricModel->template as<SparseModelType>();
68 reset();
69
70 if (allowModelSimplifications) {
72 if (!simplifier.simplify(checkTask.getFormula())) {
73 STORM_LOG_THROW(false, storm::exceptions::UnexpectedException, "Simplifying the model was not successfull.");
74 }
75 this->parametricModel = simplifier.getSimplifiedModel();
76 this->specifyFormula(env, checkTask.substituteFormula(*simplifier.getSimplifiedFormula()));
77 } else {
78 this->parametricModel = mdp;
79 this->specifyFormula(env, checkTask);
80 }
81
82 std::shared_ptr<storm::logic::Formula> formulaWithoutBounds = this->currentCheckTask->getFormula().clone();
83 formulaWithoutBounds->asOperatorFormula().removeBound();
84 this->currentFormulaNoBound = formulaWithoutBounds->asSharedPointer();
85 this->currentCheckTaskNoBound = std::make_unique<storm::modelchecker::CheckTask<storm::logic::Formula, ParametricType>>(*this->currentFormulaNoBound);
86}
87
88template<typename SparseModelType, typename ConstantType>
91 // get the step bound
92 STORM_LOG_THROW(!checkTask.getFormula().hasLowerBound(), storm::exceptions::NotSupportedException, "Lower step bounds are not supported.");
93 STORM_LOG_THROW(checkTask.getFormula().hasUpperBound(), storm::exceptions::NotSupportedException, "Expected a bounded until formula with an upper bound.");
94 STORM_LOG_THROW(checkTask.getFormula().getTimeBoundReference().isStepBound(), storm::exceptions::NotSupportedException,
95 "Expected a bounded until formula with step bounds.");
96 stepBound = checkTask.getFormula().getUpperBound().evaluateAsInt();
97 STORM_LOG_THROW(*stepBound > 0, storm::exceptions::NotSupportedException,
98 "Can not apply parameter lifting on step bounded formula: The step bound has to be positive.");
99 if (checkTask.getFormula().isUpperBoundStrict()) {
100 STORM_LOG_THROW(*stepBound > 0, storm::exceptions::NotSupportedException, "Expected a strict upper step bound that is greater than zero.");
101 --(*stepBound);
102 }
103 STORM_LOG_THROW(*stepBound > 0, storm::exceptions::NotSupportedException,
104 "Can not apply parameter lifting on step bounded formula: The step bound has to be positive.");
105
106 // get the results for the subformulas
107 storm::modelchecker::SparsePropositionalModelChecker<SparseModelType> propositionalChecker(*this->parametricModel);
108 STORM_LOG_THROW(propositionalChecker.canHandle(checkTask.getFormula().getLeftSubformula()) &&
109 propositionalChecker.canHandle(checkTask.getFormula().getRightSubformula()),
110 storm::exceptions::NotSupportedException, "Parameter lifting with non-propositional subformulas is not supported");
111 storm::storage::BitVector phiStates =
112 std::move(propositionalChecker.check(checkTask.getFormula().getLeftSubformula())->asExplicitQualitativeCheckResult().getTruthValuesVector());
113 storm::storage::BitVector psiStates =
114 std::move(propositionalChecker.check(checkTask.getFormula().getRightSubformula())->asExplicitQualitativeCheckResult().getTruthValuesVector());
115
116 // get the maybeStates
117 maybeStates = storm::solver::minimize(checkTask.getOptimizationDirection())
118 ? storm::utility::graph::performProbGreater0A(this->parametricModel->getTransitionMatrix(),
119 this->parametricModel->getTransitionMatrix().getRowGroupIndices(),
120 this->parametricModel->getBackwardTransitions(), phiStates, psiStates, true, *stepBound)
121 : storm::utility::graph::performProbGreater0E(this->parametricModel->getBackwardTransitions(), phiStates, psiStates, true, *stepBound);
122 maybeStates &= ~psiStates;
123
124 // set the result for all non-maybe states
125 resultsForNonMaybeStates = std::vector<ConstantType>(this->parametricModel->getNumberOfStates(), storm::utility::zero<ConstantType>());
126 storm::utility::vector::setVectorValues(resultsForNonMaybeStates, psiStates, storm::utility::one<ConstantType>());
127
128 // if there are maybestates, create the parameterLifter
129 if (!maybeStates.empty()) {
130 // Create the vector of one-step probabilities to go to target states.
131 std::vector<ParametricType> b = this->parametricModel->getTransitionMatrix().getConstrainedRowSumVector(
132 storm::storage::BitVector(this->parametricModel->getTransitionMatrix().getRowCount(), true), psiStates);
133
134 parameterLifter = std::make_unique<storm::transformer::ParameterLifter<ParametricType, ConstantType>>(
135 this->parametricModel->getTransitionMatrix(), b, this->parametricModel->getTransitionMatrix().getRowFilter(maybeStates), maybeStates);
136 computePlayer1Matrix();
137
138 applyPreviousResultAsHint = false;
139 }
140
141 // We know some bounds for the results
142 lowerResultBound = storm::utility::zero<ConstantType>();
143 upperResultBound = storm::utility::one<ConstantType>();
144}
145
146template<typename SparseModelType, typename ConstantType>
149 // get the results for the subformulas
150 storm::modelchecker::SparsePropositionalModelChecker<SparseModelType> propositionalChecker(*this->parametricModel);
151 STORM_LOG_THROW(propositionalChecker.canHandle(checkTask.getFormula().getLeftSubformula()) &&
152 propositionalChecker.canHandle(checkTask.getFormula().getRightSubformula()),
153 storm::exceptions::NotSupportedException, "Parameter lifting with non-propositional subformulas is not supported");
154 storm::storage::BitVector phiStates =
155 std::move(propositionalChecker.check(checkTask.getFormula().getLeftSubformula())->asExplicitQualitativeCheckResult().getTruthValuesVector());
156 storm::storage::BitVector psiStates =
157 std::move(propositionalChecker.check(checkTask.getFormula().getRightSubformula())->asExplicitQualitativeCheckResult().getTruthValuesVector());
158
159 // get the maybeStates
160 std::pair<storm::storage::BitVector, storm::storage::BitVector> statesWithProbability01 =
162 ? storm::utility::graph::performProb01Min(this->parametricModel->getTransitionMatrix(),
163 this->parametricModel->getTransitionMatrix().getRowGroupIndices(),
164 this->parametricModel->getBackwardTransitions(), phiStates, psiStates)
165 : storm::utility::graph::performProb01Max(this->parametricModel->getTransitionMatrix(),
166 this->parametricModel->getTransitionMatrix().getRowGroupIndices(),
167 this->parametricModel->getBackwardTransitions(), phiStates, psiStates);
168 maybeStates = ~(statesWithProbability01.first | statesWithProbability01.second);
169
170 // set the result for all non-maybe states
171 resultsForNonMaybeStates = std::vector<ConstantType>(this->parametricModel->getNumberOfStates(), storm::utility::zero<ConstantType>());
172 storm::utility::vector::setVectorValues(resultsForNonMaybeStates, statesWithProbability01.second, storm::utility::one<ConstantType>());
173
174 // if there are maybestates, create the parameterLifter
175 if (!maybeStates.empty()) {
176 // Create the vector of one-step probabilities to go to target states.
177 std::vector<ParametricType> b = this->parametricModel->getTransitionMatrix().getConstrainedRowSumVector(
178 storm::storage::BitVector(this->parametricModel->getTransitionMatrix().getRowCount(), true), statesWithProbability01.second);
179
180 parameterLifter = std::make_unique<storm::transformer::ParameterLifter<ParametricType, ConstantType>>(
181 this->parametricModel->getTransitionMatrix(), b, this->parametricModel->getTransitionMatrix().getRowFilter(maybeStates), maybeStates);
182 computePlayer1Matrix();
183
184 // Check whether there is an EC consisting of maybestates
185 applyPreviousResultAsHint =
186 storm::solver::minimize(checkTask.getOptimizationDirection()) || // when minimizing, there can not be an EC within the maybestates
187 storm::utility::graph::performProb1A(this->parametricModel->getTransitionMatrix(),
188 this->parametricModel->getTransitionMatrix().getRowGroupIndices(),
189 this->parametricModel->getBackwardTransitions(), maybeStates, ~maybeStates)
190 .full();
191 }
192
193 // We know some bounds for the results
194 lowerResultBound = storm::utility::zero<ConstantType>();
195 upperResultBound = storm::utility::one<ConstantType>();
196}
197
198template<typename SparseModelType, typename ConstantType>
201 // get the results for the subformula
202 storm::modelchecker::SparsePropositionalModelChecker<SparseModelType> propositionalChecker(*this->parametricModel);
203 STORM_LOG_THROW(propositionalChecker.canHandle(checkTask.getFormula().getSubformula()), storm::exceptions::NotSupportedException,
204 "Parameter lifting with non-propositional subformulas is not supported");
205 storm::storage::BitVector targetStates =
206 std::move(propositionalChecker.check(checkTask.getFormula().getSubformula())->asExplicitQualitativeCheckResult().getTruthValuesVector());
207
208 // get the maybeStates
209 storm::storage::BitVector infinityStates =
212 this->parametricModel->getTransitionMatrix(), this->parametricModel->getTransitionMatrix().getRowGroupIndices(),
213 this->parametricModel->getBackwardTransitions(), storm::storage::BitVector(this->parametricModel->getNumberOfStates(), true), targetStates)
215 this->parametricModel->getTransitionMatrix(), this->parametricModel->getTransitionMatrix().getRowGroupIndices(),
216 this->parametricModel->getBackwardTransitions(), storm::storage::BitVector(this->parametricModel->getNumberOfStates(), true), targetStates);
217 infinityStates.complement();
218 maybeStates = ~(targetStates | infinityStates);
219
220 // set the result for all the non-maybe states
221 resultsForNonMaybeStates = std::vector<ConstantType>(this->parametricModel->getNumberOfStates(), storm::utility::zero<ConstantType>());
222 storm::utility::vector::setVectorValues(resultsForNonMaybeStates, infinityStates, storm::utility::infinity<ConstantType>());
223
224 // if there are maybestates, create the parameterLifter
225 if (!maybeStates.empty()) {
226 // Create the reward vector
227 STORM_LOG_THROW((checkTask.isRewardModelSet() && this->parametricModel->hasRewardModel(checkTask.getRewardModel())) ||
228 (!checkTask.isRewardModelSet() && this->parametricModel->hasUniqueRewardModel()),
229 storm::exceptions::InvalidPropertyException, "The reward model specified by the CheckTask is not available in the given model.");
230
231 typename SparseModelType::RewardModelType const& rewardModel =
232 checkTask.isRewardModelSet() ? this->parametricModel->getRewardModel(checkTask.getRewardModel()) : this->parametricModel->getUniqueRewardModel();
233
234 std::vector<ParametricType> b = rewardModel.getTotalRewardVector(this->parametricModel->getTransitionMatrix());
235
236 // We need to handle choices that lead to an infinity state.
237 // As a maybeState does not have reward infinity, a choice leading to an infinity state will never be picked. Hence, we can unselect the
238 // corresponding rows
239 storm::storage::BitVector selectedRows = this->parametricModel->getTransitionMatrix().getRowFilter(maybeStates, ~infinityStates);
240
241 parameterLifter = std::make_unique<storm::transformer::ParameterLifter<ParametricType, ConstantType>>(this->parametricModel->getTransitionMatrix(), b,
242 selectedRows, maybeStates);
243 computePlayer1Matrix(selectedRows);
244
245 // Check whether there is an EC consisting of maybestates
246 applyPreviousResultAsHint =
247 !storm::solver::minimize(checkTask.getOptimizationDirection()) || // when maximizing, there can not be an EC within the maybestates
248 storm::utility::graph::performProb1A(this->parametricModel->getTransitionMatrix(),
249 this->parametricModel->getTransitionMatrix().getRowGroupIndices(),
250 this->parametricModel->getBackwardTransitions(), maybeStates, ~maybeStates)
251 .full();
252 }
253
254 // We only know a lower bound for the result
255 lowerResultBound = storm::utility::zero<ConstantType>();
256}
257
258template<typename SparseModelType, typename ConstantType>
261 // Obtain the stepBound
262 stepBound = checkTask.getFormula().getBound().evaluateAsInt();
263 if (checkTask.getFormula().isBoundStrict()) {
264 STORM_LOG_THROW(*stepBound > 0, storm::exceptions::NotSupportedException, "Expected a strict upper step bound that is greater than zero.");
265 --(*stepBound);
266 }
267 STORM_LOG_THROW(*stepBound > 0, storm::exceptions::NotSupportedException,
268 "Can not apply parameter lifting on step bounded formula: The step bound has to be positive.");
269
270 // Every state is a maybeState
271 maybeStates = storm::storage::BitVector(this->parametricModel->getTransitionMatrix().getColumnCount(), true);
272 resultsForNonMaybeStates = std::vector<ConstantType>(this->parametricModel->getNumberOfStates());
273
274 // Create the reward vector
275 STORM_LOG_THROW((checkTask.isRewardModelSet() && this->parametricModel->hasRewardModel(checkTask.getRewardModel())) ||
276 (!checkTask.isRewardModelSet() && this->parametricModel->hasUniqueRewardModel()),
277 storm::exceptions::InvalidPropertyException, "The reward model specified by the CheckTask is not available in the given model.");
278 typename SparseModelType::RewardModelType const& rewardModel =
279 checkTask.isRewardModelSet() ? this->parametricModel->getRewardModel(checkTask.getRewardModel()) : this->parametricModel->getUniqueRewardModel();
280 std::vector<ParametricType> b = rewardModel.getTotalRewardVector(this->parametricModel->getTransitionMatrix());
281
282 parameterLifter = std::make_unique<storm::transformer::ParameterLifter<ParametricType, ConstantType>>(
283 this->parametricModel->getTransitionMatrix(), b, storm::storage::BitVector(this->parametricModel->getTransitionMatrix().getRowCount(), true),
284 maybeStates);
285 computePlayer1Matrix();
286
287 applyPreviousResultAsHint = false;
288
289 // We only know a lower bound for the result
290 lowerResultBound = storm::utility::zero<ConstantType>();
291}
292
293template<typename SparseModelType, typename ConstantType>
296 if (!instantiationChecker) {
297 instantiationChecker = std::make_unique<storm::modelchecker::SparseMdpInstantiationModelChecker<SparseModelType, ConstantType>>(*this->parametricModel);
298 instantiationChecker->specifyFormula(quantitative ? *this->currentCheckTaskNoBound
299 : this->currentCheckTask->template convertValueType<ParametricType>());
300 instantiationChecker->setInstantiationsAreGraphPreserving(true);
301 }
302 return *instantiationChecker;
303}
304
305template<typename SparseModelType, typename ConstantType>
308 // Currently, we do not support any interaction with the monotonicity backend
310}
311
312template<typename SparseModelType, typename ConstantType>
314 Environment const& env, AnnotatedRegion<ParametricType>& region, storm::solver::OptimizationDirection const& dirForParameters) {
315 if (maybeStates.empty()) {
316 this->updateKnownValueBoundInRegion(region, dirForParameters, resultsForNonMaybeStates);
317 return resultsForNonMaybeStates;
318 }
319
320 parameterLifter->specifyRegion(region.region, dirForParameters);
321
322 // Set up the solver
323 auto solver = solverFactory->create(env, player1Matrix, parameterLifter->getMatrix());
324 if (lowerResultBound)
325 solver->setLowerBound(lowerResultBound.value());
326 if (upperResultBound)
327 solver->setUpperBound(upperResultBound.value());
328 if (applyPreviousResultAsHint) {
329 solver->setTrackSchedulers(true);
330 x.resize(maybeStates.getNumberOfSetBits(), storm::utility::zero<ConstantType>());
331 if (storm::solver::minimize(dirForParameters) && minSchedChoices && player1SchedChoices)
332 solver->setSchedulerHints(std::move(player1SchedChoices.value()), std::move(minSchedChoices.value()));
333 if (storm::solver::maximize(dirForParameters) && maxSchedChoices && player1SchedChoices)
334 solver->setSchedulerHints(std::move(player1SchedChoices.value()), std::move(maxSchedChoices.value()));
335 } else {
336 x.assign(maybeStates.getNumberOfSetBits(), storm::utility::zero<ConstantType>());
337 }
338 if (this->currentCheckTask->isBoundSet() && this->currentCheckTask->getOptimizationDirection() == dirForParameters && solver->hasSchedulerHints()) {
339 // 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).
340 std::unique_ptr<storm::solver::TerminationCondition<ConstantType>> termCond;
341 storm::storage::BitVector relevantStatesInSubsystem = this->currentCheckTask->isOnlyInitialStatesRelevantSet()
342 ? this->parametricModel->getInitialStates() % maybeStates
343 : storm::storage::BitVector(maybeStates.getNumberOfSetBits(), true);
344 if (storm::solver::minimize(dirForParameters)) {
345 // Terminate if the value for ALL relevant states is already below the threshold
346 termCond = std::make_unique<storm::solver::TerminateIfFilteredExtremumBelowThreshold<ConstantType>>(
347 relevantStatesInSubsystem, true, this->currentCheckTask->getBoundThreshold(), false);
348 } else {
349 // Terminate if the value for ALL relevant states is already above the threshold
350 termCond = std::make_unique<storm::solver::TerminateIfFilteredExtremumExceedsThreshold<ConstantType>>(
351 relevantStatesInSubsystem, true, this->currentCheckTask->getBoundThreshold(), true);
352 }
353 solver->setTerminationCondition(std::move(termCond));
354 }
355
356 // Invoke the solver
357 if (stepBound) {
358 STORM_LOG_ASSERT(*stepBound > 0, "Expected positive step bound.");
359 solver->repeatedMultiply(env, this->currentCheckTask->getOptimizationDirection(), dirForParameters, x, &parameterLifter->getVector(), *stepBound);
360 } else {
361 solver->solveGame(env, this->currentCheckTask->getOptimizationDirection(), dirForParameters, x, parameterLifter->getVector());
362 if (applyPreviousResultAsHint) {
363 if (storm::solver::minimize(dirForParameters)) {
364 minSchedChoices = solver->getPlayer2SchedulerChoices();
365 } else {
366 maxSchedChoices = solver->getPlayer2SchedulerChoices();
367 }
368 player1SchedChoices = solver->getPlayer1SchedulerChoices();
369 }
370 }
371
372 // Get the result for the complete model (including maybestates)
373 std::vector<ConstantType> result = resultsForNonMaybeStates;
374 auto maybeStateResIt = x.begin();
375 for (auto const& maybeState : maybeStates) {
376 result[maybeState] = *maybeStateResIt;
377 ++maybeStateResIt;
378 }
379 this->updateKnownValueBoundInRegion(region, dirForParameters, result);
380 return result;
381}
382
383template<typename SparseModelType, typename ConstantType>
384void SparseMdpParameterLiftingModelChecker<SparseModelType, ConstantType>::computePlayer1Matrix(std::optional<storm::storage::BitVector> const& selectedRows) {
385 uint64_t n = 0;
386 if (selectedRows) {
387 // only count selected rows
388 n = selectedRows->getNumberOfSetBits();
389 } else {
390 for (auto const& maybeState : maybeStates) {
391 n += this->parametricModel->getTransitionMatrix().getRowGroupSize(maybeState);
392 }
393 }
394
395 // 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)
396 storm::storage::SparseMatrixBuilder<storm::storage::sparse::state_type> matrixBuilder(n, n, n, true, true, maybeStates.getNumberOfSetBits());
397 uint64_t p1MatrixRow = 0;
398 for (auto maybeState : maybeStates) {
399 matrixBuilder.newRowGroup(p1MatrixRow);
400 if (selectedRows) {
401 for (uint64_t row = selectedRows->getNextSetIndex(this->parametricModel->getTransitionMatrix().getRowGroupIndices()[maybeState]);
402 row < this->parametricModel->getTransitionMatrix().getRowGroupIndices()[maybeState + 1]; row = selectedRows->getNextSetIndex(row + 1)) {
403 matrixBuilder.addNextValue(p1MatrixRow, p1MatrixRow, storm::utility::one<storm::storage::sparse::state_type>());
404 ++p1MatrixRow;
405 }
406 } else {
407 for (uint64_t endOfGroup = p1MatrixRow + this->parametricModel->getTransitionMatrix().getRowGroupSize(maybeState); p1MatrixRow < endOfGroup;
408 ++p1MatrixRow) {
409 matrixBuilder.addNextValue(p1MatrixRow, p1MatrixRow, storm::utility::one<storm::storage::sparse::state_type>());
410 }
411 }
412 }
413 player1Matrix = matrixBuilder.build();
414}
415
416template<typename SparseModelType, typename ConstantType>
418 maybeStates.resize(0);
419 resultsForNonMaybeStates.clear();
420 stepBound = std::nullopt;
421 instantiationChecker = nullptr;
423 parameterLifter = nullptr;
424 minSchedChoices = std::nullopt;
425 maxSchedChoices = std::nullopt;
426 x.clear();
427 lowerResultBound = std::nullopt;
428 upperResultBound = std::nullopt;
429 applyPreviousResultAsHint = false;
430}
431
432template<typename ConstantType>
433std::optional<storm::storage::Scheduler<ConstantType>> getSchedulerHelper(std::optional<std::vector<uint64_t>> const& choices) {
434 std::optional<storm::storage::Scheduler<ConstantType>> result;
435 if (choices) {
436 result.emplace(choices->size());
437 uint64_t state = 0;
438 for (auto const& choice : choices.value()) {
439 result->setChoice(choice, state);
440 ++state;
441 }
442 }
443 return result;
444}
445
446template<typename SparseModelType, typename ConstantType>
448 return getSchedulerHelper<ConstantType>(minSchedChoices);
449}
450
451template<typename SparseModelType, typename ConstantType>
453 return getSchedulerHelper<ConstantType>(maxSchedChoices);
454}
455
456template<typename SparseModelType, typename ConstantType>
458 return getSchedulerHelper<ConstantType>(player1SchedChoices);
459}
460
463} // 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:819
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:841
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:981
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:673
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:1063
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:741
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:78
Region const region
The subregions of this region.