35std::optional<bool> isMinimizing(storm::logic::OperatorFormula
const& formula) {
46template<
typename SparseModelType>
47std::optional<storm::storage::BitVector> checkPropositional(storm::modelchecker::SparsePropositionalModelChecker<SparseModelType>& checker,
48 storm::logic::Formula
const& subformula) {
52 return std::move(checker.
check(subformula)->template asExplicitQualitativeCheckResult<typename SparseModelType::ValueType>().getTruthValuesVector());
58std::optional<uint64_t> representative(storm::storage::BitVector
const& b) {
60 if (result < b.
size()) {
68template<
typename ValueType>
72 storm::exceptions::NotSupportedException,
"GoalStateMerger does not support models of type " << model.
getType() <<
".");
75template<
typename ValueType>
78 std::vector<std::string>
const& selectedRewardModels, std::optional<storm::storage::BitVector>
const& choiceFilter,
79 std::optional<uint64_t>
const representativeTargetState, std::optional<uint64_t>
const representativeSinkState)
const {
81 storm::exceptions::InvalidArgumentException,
82 "Maybestates, targetstates, and sinkstates are assumed to be disjoint when creating the submodel. However, this is not the case.");
84 auto result = initialize(maybeStates, targetStates, sinkStates, choiceFilter);
87 auto transitionMatrix = buildTransitionMatrix(maybeStates, result.first, result.second);
88 auto labeling = buildStateLabeling(maybeStates, targetStates, sinkStates, result.first, representativeTargetState, representativeSinkState);
89 auto rewardModels = buildRewardModels(maybeStates, result.first, selectedRewardModels);
92 uint64_t
const newStateCount = modelComponents.
transitionMatrix.getRowGroupCount();
93 uint64_t
const newChoiceCount = modelComponents.
transitionMatrix.getRowCount();
97 if (originalModel.isOfType(Ctmc)) {
100 }
else if (originalModel.isOfType(MarkovAutomaton)) {
101 auto const& ma = *originalModel.template as<storm::models::sparse::MarkovAutomaton<ValueType>>();
102 modelComponents.
markovianStates = ma.getMarkovianStates() % maybeStates;
107 STORM_LOG_ASSERT(originalModel.isOfType(
Dtmc) || originalModel.isOfType(
Mdp),
"Unhandled model type: " << originalModel.getType());
111 if (originalModel.hasStateValuations()) {
112 std::vector<uint64_t> newToOldStateIndices(maybeStates.
begin(), maybeStates.
end());
113 if (result.first.targetState.has_value()) {
114 STORM_LOG_ASSERT(result.first.targetState.value() == newToOldStateIndices.size(),
"Unexpected position of target state.");
115 newToOldStateIndices.push_back(representativeTargetState.value_or(*targetStates.
begin()));
117 if (result.first.sinkState.has_value()) {
118 STORM_LOG_ASSERT(result.first.sinkState.value() == newToOldStateIndices.size(),
"Unexpected position of sink state.");
119 newToOldStateIndices.push_back(representativeSinkState.value_or(*sinkStates.
begin()));
121 modelComponents.
stateValuations = originalModel.getStateValuations().selectEntities(newToOldStateIndices);
123 if (originalModel.hasChoiceLabeling()) {
125 for (
auto const& label : originalModel.getChoiceLabeling().getLabels()) {
127 choiceLabels.
resize(newChoiceCount,
false);
128 modelComponents.
choiceLabeling->addLabel(label, std::move(choiceLabels));
131 if (originalModel.hasChoiceOrigins()) {
132 std::vector<uint64_t> newToOldChoiceIndices(result.first.keptChoices.begin(), result.first.keptChoices.end());
133 newToOldChoiceIndices.resize(newChoiceCount, std::numeric_limits<uint64_t>::max());
134 modelComponents.
choiceOrigins = originalModel.getChoiceOrigins()->selectChoices(newToOldChoiceIndices);
142template<
typename ValueType>
144 bool const dropUnreachableFromInit)
const {
147 if (probabilityOperatorFormula.getSubformula().isUntilFormula()) {
148 return mergeForUntilProbabilities(probabilityOperatorFormula, dropUnreachableFromInit);
149 }
else if (probabilityOperatorFormula.getSubformula().isEventuallyFormula()) {
150 return mergeForUntilProbabilities(probabilityOperatorFormula, dropUnreachableFromInit);
151 }
else if (probabilityOperatorFormula.getSubformula().isBoundedUntilFormula()) {
152 return mergeForBoundedUntilProbabilities(probabilityOperatorFormula, dropUnreachableFromInit);
156 if (rewardOperatorFormula.getSubformula().isReachabilityRewardFormula()) {
157 return mergeForReachabilityRewards(rewardOperatorFormula, dropUnreachableFromInit);
158 }
else if (rewardOperatorFormula.getSubformula().isCumulativeRewardFormula()) {
159 return mergeForCumulativeRewards(rewardOperatorFormula, dropUnreachableFromInit);
165template<
typename ValueType>
166std::optional<typename GoalStateMerger<ValueType>::ReturnType> GoalStateMerger<ValueType>::mergeForUntilProbabilities(
168 std::optional<storm::storage::BitVector> phiStates, psiStates;
172 phiStates = checkPropositional(propositionalChecker, untilFormula.getLeftSubformula());
173 psiStates = checkPropositional(propositionalChecker, untilFormula.getRightSubformula());
177 STORM_LOG_ASSERT(eventuallyFormula.isReachabilityProbabilityFormula(),
"Unexpected formula context");
179 phiStates.emplace(originalModel.getNumberOfStates(),
true);
180 psiStates = checkPropositional(propositionalChecker, eventuallyFormula.getSubformula());
182 if (!phiStates || !psiStates) {
186 auto const& transitions = originalModel.getTransitionMatrix();
187 storm::storage::SparseMatrix<ValueType>
const backwardTransitions = originalModel.getBackwardTransitions();
188 std::pair<storm::storage::BitVector, storm::storage::BitVector> statesWithProbability01;
189 if (!originalModel.isNondeterministicModel()) {
191 }
else if (std::optional<bool>
const minimizing = isMinimizing(formula); !minimizing.has_value()) {
193 }
else if (*minimizing) {
194 statesWithProbability01 =
197 statesWithProbability01 =
201 storm::storage::BitVector maybeStates;
202 if (dropUnreachableFromInit) {
205 transitions, originalModel.getInitialStates() & ~statesWithProbability01.first, ~statesWithProbability01.first, statesWithProbability01.second);
206 maybeStates = reachableGreater0States & ~statesWithProbability01.second;
209 maybeStates = ~(statesWithProbability01.first | statesWithProbability01.second);
214 std::optional<uint64_t>
const representativeTarget = representative(*psiStates);
215 std::optional<uint64_t>
const representativeSink = representative(statesWithProbability01.first);
216 return mergeTargetAndSinkStates(maybeStates, statesWithProbability01.second, statesWithProbability01.first, std::vector<std::string>(), std::nullopt,
217 representativeTarget, representativeSink);
220template<
typename ValueType>
221std::optional<typename GoalStateMerger<ValueType>::ReturnType> GoalStateMerger<ValueType>::mergeForBoundedUntilProbabilities(
222 storm::logic::ProbabilityOperatorFormula
const& formula,
bool const dropUnreachableFromInit)
const {
224 if (boundedUntilFormula.isMultiDimensional() || boundedUntilFormula.hasLowerBound()) {
229 std::optional<uint64_t> upperStepBound;
230 if (originalModel.isDiscreteTimeModel() && boundedUntilFormula.hasUpperBound() && !boundedUntilFormula.getTimeBoundReference().isRewardBound() &&
231 boundedUntilFormula.getUpperBound().getBaseExpression().isIntegerLiteralExpression()) {
232 upperStepBound = boundedUntilFormula.getUpperBound().evaluateAsInt();
233 if (boundedUntilFormula.isUpperBoundStrict()) {
234 if (upperStepBound.value() == 0) {
238 --upperStepBound.value();
243 storm::modelchecker::SparsePropositionalModelChecker<storm::models::sparse::Model<ValueType>> propositionalChecker(originalModel);
244 auto phiStates = checkPropositional(propositionalChecker, boundedUntilFormula.getLeftSubformula());
245 auto psiStates = checkPropositional(propositionalChecker, boundedUntilFormula.getRightSubformula());
246 if (!phiStates || !psiStates) {
250 auto const& transitions = originalModel.getTransitionMatrix();
251 storm::storage::SparseMatrix<ValueType>
const backwardTransitions = originalModel.getBackwardTransitions();
252 storm::storage::BitVector probGreater0States;
253 if (!originalModel.isNondeterministicModel()) {
256 }
else if (std::optional<bool>
const minimizing = isMinimizing(formula); !minimizing.has_value()) {
258 }
else if (*minimizing) {
260 *psiStates, upperStepBound.has_value(), upperStepBound.value_or(0));
266 storm::storage::BitVector maybeStates;
267 storm::storage::BitVector prob0States;
268 if (dropUnreachableFromInit) {
271 storm::storage::BitVector reachableGreater0States =
273 upperStepBound.has_value(), upperStepBound.value_or(0));
274 maybeStates = reachableGreater0States & ~*psiStates;
275 prob0States = ~reachableGreater0States & ~*psiStates;
278 maybeStates = probGreater0States & ~*psiStates;
279 prob0States = ~probGreater0States & ~*psiStates;
283 std::vector<std::string> rewardModels;
284 if (boundedUntilFormula.getTimeBoundReference().isRewardBound()) {
285 auto rewName = boundedUntilFormula.getTimeBoundReference().getOptionalRewardModelName();
287 rewName = originalModel.getUniqueRewardModelName();
289 rewardModels.push_back(rewName.value());
293 std::optional<uint64_t>
const representativeTarget = representative(*psiStates);
294 std::optional<uint64_t>
const representativeSink = representative(prob0States);
295 return mergeTargetAndSinkStates(maybeStates, psiStates.value(), prob0States, rewardModels, std::nullopt, representativeTarget, representativeSink);
298template<
typename ValueType>
299std::optional<typename GoalStateMerger<ValueType>::ReturnType> GoalStateMerger<ValueType>::mergeForReachabilityRewards(
300 storm::logic::RewardOperatorFormula
const& formula,
bool const dropUnreachableFromInit)
const {
301 auto const& originalRewardModel =
305 storm::modelchecker::SparsePropositionalModelChecker<storm::models::sparse::Model<ValueType>> propositionalChecker(originalModel);
307 auto checkedTargetStates = checkPropositional(propositionalChecker, eventuallyFormula.getSubformula());
308 if (!checkedTargetStates) {
311 storm::storage::BitVector targetStates = std::move(*checkedTargetStates);
313 auto representativeTargetState = representative(targetStates);
315 auto const& transitions = originalModel.getTransitionMatrix();
316 auto const backwardTransitions = originalModel.getBackwardTransitions();
317 storm::storage::BitVector statesWithProb1;
319 auto const zeroRewardStates = originalRewardModel.getStatesWithZeroReward(originalModel.getTransitionMatrix());
320 storm::storage::BitVector
const allStates(originalModel.getNumberOfStates(),
true);
321 if (!originalModel.isNondeterministicModel()) {
324 }
else if (std::optional<bool>
const minimizing = isMinimizing(formula); !minimizing.has_value()) {
326 }
else if (*minimizing) {
333 storm::storage::BitVector infinityStates = ~statesWithProb1;
334 storm::storage::BitVector maybeStates;
335 if (dropUnreachableFromInit) {
337 storm::storage::BitVector reachableStates =
339 maybeStates = reachableStates & ~targetStates;
342 maybeStates = statesWithProb1 & ~targetStates;
345 std::vector<std::string> rewardModelNameAsVector(
347 return mergeTargetAndSinkStates(maybeStates, targetStates, infinityStates, rewardModelNameAsVector, std::nullopt, representativeTargetState,
348 representative(infinityStates));
351template<
typename ValueType>
352std::optional<typename GoalStateMerger<ValueType>::ReturnType> GoalStateMerger<ValueType>::mergeForCumulativeRewards(
353 storm::logic::RewardOperatorFormula
const& formula,
bool const dropUnreachableFromInit)
const {
355 if (cumulativeRewardFormula.isMultiDimensional()) {
359 std::optional<uint64_t> stepBound;
360 if (originalModel.isDiscreteTimeModel() && !cumulativeRewardFormula.getTimeBoundReference().isRewardBound() &&
361 cumulativeRewardFormula.getBound().getBaseExpression().isIntegerLiteralExpression()) {
362 stepBound = cumulativeRewardFormula.getBound().evaluateAsInt();
363 if (cumulativeRewardFormula.isBoundStrict()) {
364 if (stepBound.value() == 0) {
371 auto const& originalRewardModel =
375 auto const& transitions = originalModel.getTransitionMatrix();
376 auto const backwardTransitions = originalModel.getBackwardTransitions();
377 storm::storage::BitVector maybeStates;
378 storm::storage::BitVector
const statesWithNonZeroRewards = ~originalRewardModel.getStatesWithZeroReward(transitions);
379 storm::storage::BitVector
const allStates(originalModel.getNumberOfStates(),
true);
380 if (!originalModel.isNondeterministicModel()) {
383 }
else if (std::optional<bool>
const minimizing = isMinimizing(formula); !minimizing.has_value()) {
385 }
else if (*minimizing) {
387 statesWithNonZeroRewards, stepBound.has_value(), stepBound.value_or(0));
392 auto const noStates = ~allStates;
393 if (dropUnreachableFromInit) {
397 auto const zeroExpectedRewardStates = ~maybeStates;
401 if (
auto unnamedIt = rewardModels.find(
""); unnamedIt != rewardModels.end()) {
402 if (!originalModel.hasUniqueRewardModel()) {
405 rewardModels.erase(unnamedIt);
406 rewardModels.emplace(originalModel.getUniqueRewardModelName());
408 std::vector<std::string> rewardModelNameAsVector(rewardModels.begin(), rewardModels.end());
409 return mergeTargetAndSinkStates(maybeStates, noStates, zeroExpectedRewardStates, rewardModelNameAsVector, std::nullopt, std::nullopt,
410 representative(zeroExpectedRewardStates));
413template<
typename ValueType>
414std::pair<typename GoalStateMerger<ValueType>::ReturnType, uint64_t> GoalStateMerger<ValueType>::initialize(
415 storm::storage::BitVector
const& maybeStates, storm::storage::BitVector
const& targetStates, storm::storage::BitVector
const& sinkStates,
416 std::optional<storm::storage::BitVector>
const& choiceFilter)
const {
417 storm::storage::SparseMatrix<ValueType>
const& origMatrix = originalModel.getTransitionMatrix();
420 result.keptChoices = storm::storage::BitVector(origMatrix.
getRowCount(),
false);
421 result.oldToNewStateIndexMapping = std::vector<uint64_t>(maybeStates.
size(), std::numeric_limits<uint64_t>::max());
423 uint64_t transitionCount(0), stateCount(0);
424 bool targetStateRequired = !originalModel.getInitialStates().isDisjointFrom(targetStates);
425 bool sinkStateRequired = !originalModel.getInitialStates().isDisjointFrom(sinkStates);
426 for (uint64_t state : maybeStates) {
427 result.oldToNewStateIndexMapping[state] = stateCount;
430 bool stateIsDeadlock =
true;
431 for (uint64_t row = origMatrix.
getRowGroupIndices()[state]; row < endOfRowGroup; ++row) {
432 uint64_t transitionsToMaybeStates = 0;
433 bool keepThisRow(
true), hasTransitionToTarget(
false), hasTransitionToSink(
false);
434 if (!choiceFilter || choiceFilter->get(row)) {
435 for (
auto const& entry : origMatrix.
getRow(row)) {
436 if (maybeStates.get(entry.getColumn())) {
437 ++transitionsToMaybeStates;
438 }
else if (targetStates.
get(entry.getColumn())) {
439 hasTransitionToTarget =
true;
440 }
else if (sinkStates.
get(entry.getColumn())) {
441 hasTransitionToSink =
true;
448 stateIsDeadlock =
false;
449 result.keptChoices.set(row,
true);
450 transitionCount += transitionsToMaybeStates;
451 if (hasTransitionToTarget) {
453 targetStateRequired =
true;
455 if (hasTransitionToSink) {
457 sinkStateRequired =
true;
462 STORM_LOG_THROW(!stateIsDeadlock, storm::exceptions::InvalidArgumentException,
"Merging goal states leads to deadlocks!");
467 if (targetStateRequired) {
468 result.targetState = stateCount;
474 if (sinkStateRequired) {
475 result.sinkState = stateCount;
481 return std::make_pair(std::move(result), std::move(transitionCount));
484template<
typename ValueType>
485storm::storage::SparseMatrix<ValueType> GoalStateMerger<ValueType>::buildTransitionMatrix(storm::storage::BitVector
const& maybeStates,
486 ReturnType
const& resultData, uint64_t transitionCount)
const {
487 storm::storage::SparseMatrix<ValueType>
const& origMatrix = originalModel.getTransitionMatrix();
489 uint64_t rowCount = resultData.keptChoices.getNumberOfSetBits() + (resultData.targetState ? 1 : 0) + (resultData.sinkState ? 1 : 0);
491 uint64_t stateCount = maybeStateCount + (resultData.targetState ? 1 : 0) + (resultData.sinkState ? 1 : 0);
492 storm::storage::SparseMatrixBuilder<ValueType> builder(rowCount, stateCount, transitionCount,
true, !origMatrix.
hasTrivialRowGrouping(),
495 uint64_t currRow = 0;
496 for (uint64_t state : maybeStates) {
498 builder.newRowGroup(currRow);
501 for (uint64_t row = resultData.keptChoices.getNextSetIndex(origMatrix.
getRowGroupIndices()[state]); row < endOfRowGroup;
502 row = resultData.keptChoices.getNextSetIndex(row + 1)) {
503 std::optional<ValueType> targetValue, sinkValue;
504 for (
auto const& entry : origMatrix.
getRow(row)) {
505 uint64_t
const& newColumn = resultData.oldToNewStateIndexMapping[entry.getColumn()];
506 if (newColumn < maybeStateCount) {
507 builder.addNextValue(currRow, newColumn, entry.getValue());
508 }
else if (resultData.targetState && newColumn == resultData.targetState.value()) {
509 targetValue = targetValue.has_value() ? *targetValue + entry.getValue() : entry.getValue();
510 }
else if (resultData.sinkState && newColumn == resultData.sinkState.value()) {
511 sinkValue = sinkValue.has_value() ? *sinkValue + entry.getValue() : entry.getValue();
514 "There is a transition originating from a maybestate that does not lead to a maybe-, target-, or sinkstate.");
528 if (resultData.targetState) {
530 builder.newRowGroup(currRow);
535 if (resultData.sinkState) {
537 builder.newRowGroup(currRow);
543 return builder.build();
546template<
typename ValueType>
547storm::models::sparse::StateLabeling GoalStateMerger<ValueType>::buildStateLabeling(storm::storage::BitVector
const& maybeStates,
548 storm::storage::BitVector
const& targetStates,
549 storm::storage::BitVector
const& sinkStates, ReturnType
const& resultData,
550 std::optional<uint64_t>
const representativeTargetState,
551 std::optional<uint64_t>
const representativeSinkState)
const {
552 uint64_t stateCount = maybeStates.
getNumberOfSetBits() + (resultData.targetState ? 1 : 0) + (resultData.sinkState ? 1 : 0);
553 storm::models::sparse::StateLabeling labeling(stateCount);
555 for (
auto const& label : originalModel.getStateLabeling().getLabels()) {
556 storm::storage::BitVector
const& oldStatesWithLabel = originalModel.getStates(label);
557 storm::storage::BitVector newStatesWithLabel = oldStatesWithLabel % maybeStates;
558 newStatesWithLabel.
resize(stateCount,
false);
565 bool const isInitialStatesLabel = label ==
"init";
566 bool const markTarget = (representativeTargetState && !isInitialStatesLabel) ? oldStatesWithLabel.
get(representativeTargetState.value())
568 if (markTarget && resultData.targetState.has_value()) {
569 newStatesWithLabel.
set(*resultData.targetState,
true);
571 bool const markSink = (representativeSinkState && !isInitialStatesLabel) ? oldStatesWithLabel.
get(representativeSinkState.value())
573 if (markSink && resultData.sinkState.has_value()) {
574 newStatesWithLabel.
set(*resultData.sinkState,
true);
576 labeling.addLabel(label, std::move(newStatesWithLabel));
582template<
typename ValueType>
583std::unordered_map<std::string, models::sparse::StandardRewardModel<ValueType>> GoalStateMerger<ValueType>::buildRewardModels(
584 storm::storage::BitVector
const& maybeStates, ReturnType
const& resultData, std::vector<std::string>
const& selectedRewardModels)
const {
586 uint64_t stateCount = maybeStateCount + (resultData.targetState ? 1 : 0) + (resultData.sinkState ? 1 : 0);
587 uint64_t choiceCount = resultData.keptChoices.getNumberOfSetBits() + (resultData.targetState ? 1 : 0) + (resultData.sinkState ? 1 : 0);
589 std::unordered_map<std::string, models::sparse::StandardRewardModel<ValueType>> rewardModels;
590 for (
auto rewardModelName : selectedRewardModels) {
591 auto origRewardModel = originalModel.getRewardModel(rewardModelName);
593 std::optional<std::vector<ValueType>> stateRewards;
594 if (origRewardModel.hasStateRewards()) {
599 std::optional<std::vector<ValueType>> stateActionRewards;
600 if (origRewardModel.hasStateActionRewards()) {
605 std::optional<storm::storage::SparseMatrix<ValueType>> transitionRewards;
606 if (origRewardModel.hasTransitionRewards()) {
607 storm::storage::SparseMatrixBuilder<ValueType> builder(choiceCount, stateCount, 0,
true);
609 uint64_t currRow = 0;
610 for (
auto row : resultData.keptChoices) {
611 std::optional<ValueType> targetValue, sinkValue;
612 for (
auto const& entry : origRewardModel.getTransitionRewardMatrix().getRow(row)) {
613 uint64_t
const& newColumn = resultData.oldToNewStateIndexMapping[entry.getColumn()];
614 if (newColumn < maybeStateCount) {
615 builder.addNextValue(currRow, newColumn, entry.getValue());
616 }
else if (resultData.targetState && newColumn == resultData.targetState.value()) {
617 targetValue = targetValue.has_value() ? *targetValue + entry.getValue() : entry.getValue();
618 }
else if (resultData.sinkState && newColumn == resultData.sinkState.value()) {
619 sinkValue = sinkValue.has_value() ? *sinkValue + entry.getValue() : entry.getValue();
622 "There is a transition reward originating from a maybestate that does not lead to a maybe-, target-, or sinkstate.");
633 transitionRewards = builder.build();
636 rewardModels.emplace(rewardModelName, models::sparse::StandardRewardModel<ValueType>(std::move(stateRewards), std::move(stateActionRewards),
637 std::move(transitionRewards)));
storm::models::sparse::Dtmc< double > Dtmc
storm::models::sparse::Mdp< double > Mdp
virtual std::unique_ptr< CheckResult > check(Environment const &env, CheckTask< storm::logic::Formula, SolutionType > const &checkTask)
Checks the provided formula.
virtual bool canHandle(CheckTask< storm::logic::Formula, SolutionType > const &checkTask) const override
virtual ModelType getType() const
Return the actual type of the model.
bool isOfType(storm::models::ModelType const &modelType) const
Checks whether the model is of the given type.
Base class for all sparse models.
A bit vector that is internally represented as a vector of 64-bit values.
uint64_t getNextSetIndex(uint64_t startingIndex) const
Retrieves the index of the bit that is the next bit set to true in the bit vector.
bool isDisjointFrom(BitVector const &other) const
Checks whether none of the bits that are set in the current bit vector are also set in the given bit ...
const_iterator end() const
Returns an iterator pointing at the element past the back of the bit vector.
uint64_t getNumberOfSetBits() const
Returns the number of bits that are set to true in this bit vector.
void set(uint64_t index, bool value=true)
Sets the given truth value at the given index.
const_iterator begin() const
Returns an iterator to the indices of the set bits in the bit vector.
size_t size() const
Retrieves the number of bits this bit vector can store.
void resize(uint64_t newLength, bool init=false)
Resizes the bit vector to hold the given new number of bits.
bool get(uint64_t index) const
Retrieves the truth value of the bit at the given index and performs a bound check.
const_rows getRow(index_type row) const
Returns an object representing the given row.
bool hasTrivialRowGrouping() const
Retrieves whether the matrix has a trivial row grouping.
std::vector< index_type > const & getRowGroupIndices() const
Returns the grouping of rows of this matrix.
index_type getRowCount() const
Returns the number of rows of the matrix.
#define STORM_LOG_ASSERT(cond, message)
#define STORM_LOG_THROW(cond, exception, message)
bool isLowerBound(ComparisonType t)
bool constexpr minimize(OptimizationDirection d)
std::shared_ptr< storm::models::sparse::Model< ValueType, RewardModelType > > buildModelFromComponents(storm::models::ModelType modelType, storm::storage::sparse::ModelComponents< ValueType, RewardModelType > &&components)
std::pair< storm::storage::BitVector, storm::storage::BitVector > performProb01(storm::models::sparse::DeterministicModel< T > const &model, storm::storage::BitVector const &phiStates, storm::storage::BitVector const &psiStates)
Computes the sets of states that have probability 0 or 1, respectively, of satisfying phi until psi i...
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)
storm::storage::BitVector getReachableStates(storm::storage::SparseMatrix< T > const &transitionMatrix, storm::storage::BitVector const &initialStates, storm::storage::BitVector const &constraintStates, storm::storage::BitVector const &targetStates, bool useStepBound, uint_fast64_t maximalSteps, boost::optional< storm::storage::BitVector > const &choiceFilter)
Performs a forward depth-first search through the underlying graph structure to identify the states t...
storm::storage::BitVector performProbGreater0(storm::storage::SparseMatrix< T > const &backwardTransitions, storm::storage::BitVector const &phiStates, storm::storage::BitVector const &psiStates, bool useStepBound, uint_fast64_t maximalSteps)
Performs a backward depth-first search trough the underlying graph structure of the given model to de...
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...
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...
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...
storm::storage::BitVector performProb1(storm::storage::SparseMatrix< T > const &backwardTransitions, storm::storage::BitVector const &, storm::storage::BitVector const &psiStates, storm::storage::BitVector const &statesWithProbabilityGreater0)
Computes the set of states of the given model for which all paths lead to the given set of target sta...
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)
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...
void setVectorValues(std::vector< T > &vector, storm::storage::BitVector const &positions, std::vector< S > const &values)
Sets the provided values at the provided positions in the given vector.
std::vector< Type > filterVector(std::vector< Type > const &in, storm::storage::BitVector const &filter)
ValueType simplify(ValueType value)
ComparisonType comparisonType
storm::storage::SparseMatrix< ValueType > transitionMatrix
boost::optional< storm::storage::BitVector > markovianStates
std::optional< std::shared_ptr< storm::storage::sparse::ChoiceOrigins > > choiceOrigins
std::optional< storm::models::sparse::ChoiceLabeling > choiceLabeling
std::optional< storm::storage::sparse::Valuations > stateValuations
boost::optional< std::vector< ValueType > > exitRates