Storm 1.13.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 std::shared_ptr<storm::models::ModelBase> parametricModel,
59 std::optional<RegionSplitEstimateKind> generateRegionSplitEstimates,
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);
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
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 = std::move(propositionalChecker.check(checkTask.getFormula().getLeftSubformula())
112 ->template asExplicitQualitativeCheckResult<typename SparseModelType::ValueType>()
113 .getTruthValuesVector());
114 storm::storage::BitVector psiStates = std::move(propositionalChecker.check(checkTask.getFormula().getRightSubformula())
115 ->template asExplicitQualitativeCheckResult<typename SparseModelType::ValueType>()
116 .getTruthValuesVector());
117
118 // get the maybeStates
119 maybeStates = storm::solver::minimize(checkTask.getOptimizationDirection())
121 this->parametricModel->getTransitionMatrix().getRowGroupIndices(),
122 this->parametricModel->getBackwardTransitions(), phiStates, psiStates, true, *stepBound)
123 : storm::utility::graph::performProbGreater0E(this->parametricModel->getBackwardTransitions(), phiStates, psiStates, true, *stepBound);
124 maybeStates &= ~psiStates;
125
126 // set the result for all non-maybe states
127 resultsForNonMaybeStates = std::vector<ConstantType>(this->parametricModel->getNumberOfStates(), storm::utility::zero<ConstantType>());
129
130 // if there are maybestates, create the parameterLifter
131 if (!maybeStates.empty()) {
132 // Create the vector of one-step probabilities to go to target states.
133 std::vector<ParametricType> b = this->parametricModel->getTransitionMatrix().getConstrainedRowSumVector(
134 storm::storage::BitVector(this->parametricModel->getTransitionMatrix().getRowCount(), true), psiStates);
135
136 parameterLifter = std::make_unique<storm::transformer::ParameterLifter<ParametricType, ConstantType>>(
137 this->parametricModel->getTransitionMatrix(), b, this->parametricModel->getTransitionMatrix().getRowFilter(maybeStates), maybeStates);
138 computePlayer1Matrix();
139
140 applyPreviousResultAsHint = false;
141 }
142
143 // We know some bounds for the results
144 lowerResultBound = storm::utility::zero<ConstantType>();
145 upperResultBound = storm::utility::one<ConstantType>();
146}
147
148template<typename SparseModelType, typename ConstantType>
151 // get the results for the subformulas
153 STORM_LOG_THROW(propositionalChecker.canHandle(checkTask.getFormula().getLeftSubformula()) &&
154 propositionalChecker.canHandle(checkTask.getFormula().getRightSubformula()),
155 storm::exceptions::NotSupportedException, "Parameter lifting with non-propositional subformulas is not supported");
156 storm::storage::BitVector phiStates = std::move(propositionalChecker.check(checkTask.getFormula().getLeftSubformula())
157 ->template asExplicitQualitativeCheckResult<typename SparseModelType::ValueType>()
158 .getTruthValuesVector());
159 storm::storage::BitVector psiStates = std::move(propositionalChecker.check(checkTask.getFormula().getRightSubformula())
160 ->template asExplicitQualitativeCheckResult<typename SparseModelType::ValueType>()
161 .getTruthValuesVector());
162
163 // get the maybeStates
164 std::pair<storm::storage::BitVector, storm::storage::BitVector> statesWithProbability01 =
166 ? storm::utility::graph::performProb01Min(this->parametricModel->getTransitionMatrix(),
167 this->parametricModel->getTransitionMatrix().getRowGroupIndices(),
168 this->parametricModel->getBackwardTransitions(), phiStates, psiStates)
169 : storm::utility::graph::performProb01Max(this->parametricModel->getTransitionMatrix(),
170 this->parametricModel->getTransitionMatrix().getRowGroupIndices(),
171 this->parametricModel->getBackwardTransitions(), phiStates, psiStates);
172 maybeStates = ~(statesWithProbability01.first | statesWithProbability01.second);
173
174 // set the result for all non-maybe states
175 resultsForNonMaybeStates = std::vector<ConstantType>(this->parametricModel->getNumberOfStates(), storm::utility::zero<ConstantType>());
176 storm::utility::vector::setVectorValues(resultsForNonMaybeStates, statesWithProbability01.second, storm::utility::one<ConstantType>());
177
178 // if there are maybestates, create the parameterLifter
179 if (!maybeStates.empty()) {
180 // Create the vector of one-step probabilities to go to target states.
181 std::vector<ParametricType> b = this->parametricModel->getTransitionMatrix().getConstrainedRowSumVector(
182 storm::storage::BitVector(this->parametricModel->getTransitionMatrix().getRowCount(), true), statesWithProbability01.second);
183
184 parameterLifter = std::make_unique<storm::transformer::ParameterLifter<ParametricType, ConstantType>>(
185 this->parametricModel->getTransitionMatrix(), b, this->parametricModel->getTransitionMatrix().getRowFilter(maybeStates), maybeStates);
186 computePlayer1Matrix();
187
188 // Check whether there is an EC consisting of maybestates
189 applyPreviousResultAsHint =
190 storm::solver::minimize(checkTask.getOptimizationDirection()) || // when minimizing, there can not be an EC within the maybestates
191 storm::utility::graph::performProb1A(this->parametricModel->getTransitionMatrix(),
192 this->parametricModel->getTransitionMatrix().getRowGroupIndices(),
193 this->parametricModel->getBackwardTransitions(), maybeStates, ~maybeStates)
194 .full();
195 }
196
197 // We know some bounds for the results
198 lowerResultBound = storm::utility::zero<ConstantType>();
199 upperResultBound = storm::utility::one<ConstantType>();
200}
201
202template<typename SparseModelType, typename ConstantType>
205 // get the results for the subformula
207 STORM_LOG_THROW(propositionalChecker.canHandle(checkTask.getFormula().getSubformula()), storm::exceptions::NotSupportedException,
208 "Parameter lifting with non-propositional subformulas is not supported");
209 storm::storage::BitVector targetStates = std::move(propositionalChecker.check(checkTask.getFormula().getSubformula())
210 ->template asExplicitQualitativeCheckResult<typename SparseModelType::ValueType>()
211 .getTruthValuesVector());
212
213 // get the maybeStates
214 storm::storage::BitVector infinityStates =
217 this->parametricModel->getTransitionMatrix(), this->parametricModel->getTransitionMatrix().getRowGroupIndices(),
218 this->parametricModel->getBackwardTransitions(), storm::storage::BitVector(this->parametricModel->getNumberOfStates(), true), targetStates)
220 this->parametricModel->getTransitionMatrix(), this->parametricModel->getTransitionMatrix().getRowGroupIndices(),
221 this->parametricModel->getBackwardTransitions(), storm::storage::BitVector(this->parametricModel->getNumberOfStates(), true), targetStates);
222 infinityStates.complement();
223 maybeStates = ~(targetStates | infinityStates);
224
225 // set the result for all the non-maybe states
226 resultsForNonMaybeStates = std::vector<ConstantType>(this->parametricModel->getNumberOfStates(), storm::utility::zero<ConstantType>());
227 storm::utility::vector::setVectorValues(resultsForNonMaybeStates, infinityStates, storm::utility::infinity<ConstantType>());
228
229 // if there are maybestates, create the parameterLifter
230 if (!maybeStates.empty()) {
231 // Create the reward vector
232 STORM_LOG_THROW((checkTask.isRewardModelSet() && this->parametricModel->hasRewardModel(checkTask.getRewardModel())) ||
233 (!checkTask.isRewardModelSet() && this->parametricModel->hasUniqueRewardModel()),
234 storm::exceptions::InvalidPropertyException, "The reward model specified by the CheckTask is not available in the given model.");
235
236 typename SparseModelType::RewardModelType const& rewardModel =
237 checkTask.isRewardModelSet() ? this->parametricModel->getRewardModel(checkTask.getRewardModel()) : this->parametricModel->getUniqueRewardModel();
238
239 std::vector<ParametricType> b = rewardModel.getTotalRewardVector(this->parametricModel->getTransitionMatrix());
240
241 // We need to handle choices that lead to an infinity state.
242 // As a maybeState does not have reward infinity, a choice leading to an infinity state will never be picked. Hence, we can unselect the
243 // corresponding rows
244 storm::storage::BitVector selectedRows = this->parametricModel->getTransitionMatrix().getRowFilter(maybeStates, ~infinityStates);
245
246 parameterLifter = std::make_unique<storm::transformer::ParameterLifter<ParametricType, ConstantType>>(this->parametricModel->getTransitionMatrix(), b,
247 selectedRows, maybeStates);
248 computePlayer1Matrix(selectedRows);
249
250 // Check whether there is an EC consisting of maybestates
251 applyPreviousResultAsHint =
252 !storm::solver::minimize(checkTask.getOptimizationDirection()) || // when maximizing, there can not be an EC within the maybestates
253 storm::utility::graph::performProb1A(this->parametricModel->getTransitionMatrix(),
254 this->parametricModel->getTransitionMatrix().getRowGroupIndices(),
255 this->parametricModel->getBackwardTransitions(), maybeStates, ~maybeStates)
256 .full();
257 }
258
259 // We only know a lower bound for the result
260 lowerResultBound = storm::utility::zero<ConstantType>();
261}
262
263template<typename SparseModelType, typename ConstantType>
266 // Obtain the stepBound
267 stepBound = checkTask.getFormula().getBound().evaluateAsInt();
268 if (checkTask.getFormula().isBoundStrict()) {
269 STORM_LOG_THROW(*stepBound > 0, storm::exceptions::NotSupportedException, "Expected a strict upper step bound that is greater than zero.");
270 --(*stepBound);
271 }
272 STORM_LOG_THROW(*stepBound > 0, storm::exceptions::NotSupportedException,
273 "Can not apply parameter lifting on step bounded formula: The step bound has to be positive.");
274
275 // Every state is a maybeState
276 maybeStates = storm::storage::BitVector(this->parametricModel->getTransitionMatrix().getColumnCount(), true);
277 resultsForNonMaybeStates = std::vector<ConstantType>(this->parametricModel->getNumberOfStates());
278
279 // Create the reward vector
280 STORM_LOG_THROW((checkTask.isRewardModelSet() && this->parametricModel->hasRewardModel(checkTask.getRewardModel())) ||
281 (!checkTask.isRewardModelSet() && this->parametricModel->hasUniqueRewardModel()),
282 storm::exceptions::InvalidPropertyException, "The reward model specified by the CheckTask is not available in the given model.");
283 typename SparseModelType::RewardModelType const& rewardModel =
284 checkTask.isRewardModelSet() ? this->parametricModel->getRewardModel(checkTask.getRewardModel()) : this->parametricModel->getUniqueRewardModel();
285 std::vector<ParametricType> b = rewardModel.getTotalRewardVector(this->parametricModel->getTransitionMatrix());
286
287 parameterLifter = std::make_unique<storm::transformer::ParameterLifter<ParametricType, ConstantType>>(
288 this->parametricModel->getTransitionMatrix(), b, storm::storage::BitVector(this->parametricModel->getTransitionMatrix().getRowCount(), true),
289 maybeStates);
290 computePlayer1Matrix();
291
292 applyPreviousResultAsHint = false;
293
294 // We only know a lower bound for the result
295 lowerResultBound = storm::utility::zero<ConstantType>();
296}
297
298template<typename SparseModelType, typename ConstantType>
301 if (!instantiationChecker) {
302 instantiationChecker = std::make_unique<storm::modelchecker::SparseMdpInstantiationModelChecker<SparseModelType, ConstantType>>(*this->parametricModel);
303 instantiationChecker->specifyFormula(quantitative ? *this->currentCheckTaskNoBound
304 : this->currentCheckTask->template convertValueType<ParametricType>());
305 instantiationChecker->setInstantiationsAreGraphPreserving(true);
306 }
307 return *instantiationChecker;
308}
309
310template<typename SparseModelType, typename ConstantType>
313 // Currently, we do not support any interaction with the monotonicity backend
315}
316
317template<typename SparseModelType, typename ConstantType>
320 if (maybeStates.empty()) {
321 this->updateKnownValueBoundInRegion(region, dirForParameters, resultsForNonMaybeStates);
322 return resultsForNonMaybeStates;
323 }
324
325 parameterLifter->specifyRegion(region.region, dirForParameters);
326
327 // Set up the solver
328 auto solver = solverFactory->create(env, player1Matrix, parameterLifter->getMatrix());
329 if (lowerResultBound)
330 solver->setLowerBound(lowerResultBound.value());
331 if (upperResultBound)
332 solver->setUpperBound(upperResultBound.value());
333 if (applyPreviousResultAsHint) {
334 solver->setTrackSchedulers(true);
335 x.resize(maybeStates.getNumberOfSetBits(), storm::utility::zero<ConstantType>());
336 if (storm::solver::minimize(dirForParameters) && minSchedChoices && player1SchedChoices)
337 solver->setSchedulerHints(std::move(player1SchedChoices.value()), std::move(minSchedChoices.value()));
338 if (storm::solver::maximize(dirForParameters) && maxSchedChoices && player1SchedChoices)
339 solver->setSchedulerHints(std::move(player1SchedChoices.value()), std::move(maxSchedChoices.value()));
340 } else {
341 x.assign(maybeStates.getNumberOfSetBits(), storm::utility::zero<ConstantType>());
342 }
343 if (this->currentCheckTask->isBoundSet() && this->currentCheckTask->getOptimizationDirection() == dirForParameters && solver->hasSchedulerHints()) {
344 // 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).
345 std::unique_ptr<storm::solver::TerminationCondition<ConstantType>> termCond;
346 storm::storage::BitVector relevantStatesInSubsystem = this->currentCheckTask->isOnlyInitialStatesRelevantSet()
347 ? this->parametricModel->getInitialStates() % maybeStates
348 : storm::storage::BitVector(maybeStates.getNumberOfSetBits(), true);
349 if (storm::solver::minimize(dirForParameters)) {
350 // Terminate if the value for ALL relevant states is already below the threshold
351 termCond = std::make_unique<storm::solver::TerminateIfFilteredExtremumBelowThreshold<ConstantType>>(
352 relevantStatesInSubsystem, true, this->currentCheckTask->getBoundThreshold(), false);
353 } else {
354 // Terminate if the value for ALL relevant states is already above the threshold
355 termCond = std::make_unique<storm::solver::TerminateIfFilteredExtremumExceedsThreshold<ConstantType>>(
356 relevantStatesInSubsystem, true, this->currentCheckTask->getBoundThreshold(), true);
357 }
358 solver->setTerminationCondition(std::move(termCond));
359 }
360
361 // Invoke the solver
362 if (stepBound) {
363 STORM_LOG_ASSERT(*stepBound > 0, "Expected positive step bound.");
364 solver->repeatedMultiply(env, this->currentCheckTask->getOptimizationDirection(), dirForParameters, x, &parameterLifter->getVector(), *stepBound);
365 } else {
366 solver->solveGame(env, this->currentCheckTask->getOptimizationDirection(), dirForParameters, x, parameterLifter->getVector());
367 if (applyPreviousResultAsHint) {
368 if (storm::solver::minimize(dirForParameters)) {
369 minSchedChoices = solver->getPlayer2SchedulerChoices();
370 } else {
371 maxSchedChoices = solver->getPlayer2SchedulerChoices();
372 }
373 player1SchedChoices = solver->getPlayer1SchedulerChoices();
374 }
375 }
376
377 // Get the result for the complete model (including maybestates)
378 std::vector<ConstantType> result = resultsForNonMaybeStates;
379 auto maybeStateResIt = x.begin();
380 for (auto const& maybeState : maybeStates) {
381 result[maybeState] = *maybeStateResIt;
382 ++maybeStateResIt;
383 }
384 this->updateKnownValueBoundInRegion(region, dirForParameters, result);
385 return result;
386}
387
388template<typename SparseModelType, typename ConstantType>
389void SparseMdpParameterLiftingModelChecker<SparseModelType, ConstantType>::computePlayer1Matrix(std::optional<storm::storage::BitVector> const& selectedRows) {
390 uint64_t n = 0;
391 if (selectedRows) {
392 // only count selected rows
393 n = selectedRows->getNumberOfSetBits();
394 } else {
395 for (auto const& maybeState : maybeStates) {
396 n += this->parametricModel->getTransitionMatrix().getRowGroupSize(maybeState);
397 }
398 }
399
400 // 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)
401 storm::storage::SparseMatrixBuilder<storm::storage::sparse::state_type> matrixBuilder(n, n, n, true, true, maybeStates.getNumberOfSetBits());
402 uint64_t p1MatrixRow = 0;
403 for (auto maybeState : maybeStates) {
404 matrixBuilder.newRowGroup(p1MatrixRow);
405 if (selectedRows) {
406 for (uint64_t row = selectedRows->getNextSetIndex(this->parametricModel->getTransitionMatrix().getRowGroupIndices()[maybeState]);
407 row < this->parametricModel->getTransitionMatrix().getRowGroupIndices()[maybeState + 1]; row = selectedRows->getNextSetIndex(row + 1)) {
408 matrixBuilder.addNextValue(p1MatrixRow, p1MatrixRow, storm::utility::one<storm::storage::sparse::state_type>());
409 ++p1MatrixRow;
410 }
411 } else {
412 for (uint64_t endOfGroup = p1MatrixRow + this->parametricModel->getTransitionMatrix().getRowGroupSize(maybeState); p1MatrixRow < endOfGroup;
413 ++p1MatrixRow) {
414 matrixBuilder.addNextValue(p1MatrixRow, p1MatrixRow, storm::utility::one<storm::storage::sparse::state_type>());
415 }
416 }
417 }
418 player1Matrix = matrixBuilder.build();
419}
420
421template<typename SparseModelType, typename ConstantType>
423 maybeStates.resize(0);
424 resultsForNonMaybeStates.clear();
425 stepBound = std::nullopt;
426 instantiationChecker = nullptr;
428 parameterLifter = nullptr;
429 minSchedChoices = std::nullopt;
430 maxSchedChoices = std::nullopt;
431 x.clear();
432 lowerResultBound = std::nullopt;
433 upperResultBound = std::nullopt;
434 applyPreviousResultAsHint = false;
435}
436
437template<typename ConstantType>
438std::optional<storm::storage::Scheduler<ConstantType>> getSchedulerHelper(std::optional<std::vector<uint64_t>> const& choices) {
439 std::optional<storm::storage::Scheduler<ConstantType>> result;
440 if (choices) {
441 result.emplace(choices->size());
442 uint64_t state = 0;
443 for (auto const& choice : choices.value()) {
444 result->setChoice(choice, state);
445 ++state;
446 }
447 }
448 return result;
449}
450
451template<typename SparseModelType, typename ConstantType>
453 return getSchedulerHelper<ConstantType>(minSchedChoices);
454}
455
456template<typename SparseModelType, typename ConstantType>
458 return getSchedulerHelper<ConstantType>(maxSchedChoices);
459}
460
461template<typename SparseModelType, typename ConstantType>
463 return getSchedulerHelper<ConstantType>(player1SchedChoices);
464}
465
468} // 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:54
bool isRewardModelSet() const
Retrieves whether a reward model was set.
Definition CheckTask.h:192
std::string const & getRewardModel() const
Retrieves the reward model over which to perform the checking (if set).
Definition CheckTask.h:199
FormulaType const & getFormula() const
Retrieves the formula from this task.
Definition CheckTask.h:142
storm::OptimizationDirection const & getOptimizationDirection() const
Retrieves the optimization direction (if set).
Definition CheckTask.h:156
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()
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
std::unique_ptr< CheckTask< storm::logic::Formula, ConstantType > > currentCheckTask
void specifyFormula(Environment const &env, CheckTask< storm::logic::Formula, ParametricType > const &checkTask)
void updateKnownValueBoundInRegion(AnnotatedRegion< ParametricType > &region, storm::solver::OptimizationDirection dir, std::vector< ConstantType > const &newValues)
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: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
ValueType zero()
Definition constants.cpp:24
ValueType infinity()
Definition constants.cpp:29
ValueType one()
Definition constants.cpp:19