34 std::shared_ptr<storm::logic::OperatorFormula const> ) {
35 STORM_LOG_THROW(
false, storm::exceptions::NotSupportedException,
"The specified property is not supported by this value type.");
36 return std::vector<storm::RationalFunction>();
39template<
typename ValueType,
typename RewardModelType,
typename SolutionType>
43 STORM_LOG_THROW(
false, storm::exceptions::NotImplementedException,
"We do not support computing reward bounded values with interval models.");
58 std::vector<ValueType> x, b;
59 std::unique_ptr<storm::solver::LinearEquationSolver<ValueType>> linEqSolver;
64 linearEquationSolverPrecision) {
71 std::vector<std::vector<ValueType>> cdfData;
80 uint64_t numCheckedEpochs = 0;
81 for (
auto const& epoch : epochOrder) {
86 rewardUnfolding.
setSolutionForCurrentEpoch(epochModel.analyzeSingleObjective(preciseEnv, x, b, linEqSolver, lowerBound, upperBound));
89 std::vector<ValueType> cdfEntry;
90 for (uint64_t i = 0; i < rewardUnfolding.
getEpochManager().getDimensionCount(); ++i) {
96 cdfData.push_back(std::move(cdfEntry));
105 std::vector<ValueType> result;
114 std::vector<std::string> headers;
115 for (uint64_t i = 0; i < rewardUnfolding.
getEpochManager().getDimensionCount(); ++i) {
116 headers.push_back(rewardUnfolding.
getDimension(i).formula->toString());
118 headers.push_back(
"Result");
135template<
typename ValueType,
typename SolutionType>
145 auto const uncertaintyResolutionMode = goal.getUncertaintyResolutionMode();
147 env, std::move(goal), minMaxLinearEquationSolverFactory, std::move(submatrix),
148 convert(OptimizationDirection::Maximize));
149 solver->setUncertaintyResolutionMode(uncertaintyResolutionMode);
150 solver->setHasUniqueSolution(computeReward);
151 solver->setHasNoEndComponents(
false);
154 auto req =
solver->getRequirements(env);
155 if (!computeReward) {
160 STORM_LOG_THROW(!req.hasEnabledCriticalRequirement(), storm::exceptions::UncheckedRequirementException,
161 "Solver requirements " + req.getEnabledRequirementsAsString() +
" not checked.");
163 solver->setRequirementsChecked();
166 solver->solveEquations(env, x, b);
169 solutionBounds =
solver->getSolutionBounds();
174template<
typename ValueType,
typename RewardModelType,
typename SolutionType>
187 maybeStates = hint.template asExplicitModelCheckerHint<ValueType>().getMaybeStates();
190 std::vector<ExtendedSolutionType>
const& resultsForNonMaybeStates = hint.template asExplicitModelCheckerHint<SolutionType>().getResultHint();
193 for (uint64_t state : nonMaybeStates) {
195 statesWithProbability1.
set(state,
true);
199 "Expected that the result hint specifies probabilities in {0,1} for non-maybe states.");
204 <<
" states remaining).");
207 std::pair<storm::storage::BitVector, storm::storage::BitVector> statesWithProbability01 =
210 statesWithProbability1 = std::move(statesWithProbability01.second);
211 maybeStates = ~(statesWithProbability0 | statesWithProbability1);
215 <<
" states remaining).");
223 bool maybeStatesNotRelevant = goal.hasRelevantValues() && goal.relevantValues().
isDisjointFrom(maybeStates);
226 if (qualitative || maybeStatesNotRelevant) {
230 if (!maybeStates.
empty()) {
235 std::vector<ValueType> b;
243 std::vector<SolutionType> resultForMaybeStates =
248 result = std::move(resultForMaybeStates);
252 bool convertToEquationSystem =
257 if (convertToEquationSystem) {
266 std::vector<SolutionType> x;
279 goal.restrictRelevantValues(maybeStates);
280 std::unique_ptr<storm::solver::LinearEquationSolver<ValueType>>
solver =
283 solver->solveEquations(env, x, b);
286 auto embedBound = [&result, &maybeStates](std::vector<SolutionType>
const& boundForMaybeStates) {
287 std::vector<SolutionType> bound(result);
291 solutionBounds =
solver->getSolutionBounds().transform(embedBound);
298 if (maybeStates.
empty()) {
307template<
typename ValueType,
typename RewardModelType,
typename SolutionType>
312 STORM_LOG_THROW(
false, storm::exceptions::NotImplementedException,
"We do not support computing all until probabilities with interval models.");
314 uint_fast64_t numberOfStates = transitionMatrix.
getRowCount();
321 if (!relevantStates.
empty()) {
324 bool convertToEquationSystem =
335 submatrix = submatrix.
getSubmatrix(
true, relevantStates, relevantStates, convertToEquationSystem);
337 if (convertToEquationSystem) {
353 for (uint64_t state : relevantStates) {
354 if (initialStates.
get(state)) {
361 goal.restrictRelevantValues(relevantStates);
362 std::unique_ptr<storm::solver::LinearEquationSolver<ValueType>>
solver =
365 solver->solveEquations(env, x, b);
374template<
typename ValueType,
typename RewardModelType,
typename SolutionType>
379 STORM_LOG_THROW(
false, storm::exceptions::NotImplementedException,
"We do not support computing globally probabilities with interval models.");
391template<
typename ValueType,
typename RewardModelType,
typename SolutionType>
395 STORM_LOG_THROW(
false, storm::exceptions::NotImplementedException,
"We do not support next probabilities with interval models.");
398 std::vector<ValueType> result(transitionMatrix.
getRowCount());
403 multiplier->multiply(env, result,
nullptr, result);
408template<
typename ValueType,
typename RewardModelType,
typename SolutionType>
411 RewardModelType
const& rewardModel, uint_fast64_t stepBound) {
414 STORM_LOG_THROW(!rewardModel.hasTransitionRewards(), storm::exceptions::NotSupportedException,
415 "Cumulative rewards on interval models do not support transition rewards.");
422 std::vector<ValueType> totalRewardVector = rewardModel.getTotalRewardVector(transitionMatrix);
428 multiplier->repeatedMultiplyAndReduce(env, storm::OptimizationDirection::Maximize, result, &totalRewardVector, stepBound,
429 goal.getUncertaintyResolutionMode());
431 multiplier->repeatedMultiply(env, result, &totalRewardVector, stepBound);
436template<
typename ValueType,
typename RewardModelType,
typename SolutionType>
439 RewardModelType
const& rewardModel, uint_fast64_t stepCount) {
441 STORM_LOG_THROW(
false, storm::exceptions::NotImplementedException,
"We do not support instantaneous rewards with interval models.");
444 STORM_LOG_THROW(rewardModel.hasStateRewards(), storm::exceptions::InvalidPropertyException,
445 "Computing instantaneous rewards for a reward model that does not define any state-rewards. The result is trivially 0.");
448 std::vector<ValueType> result = rewardModel.getStateRewardVector();
452 multiplier->repeatedMultiply(env, result,
nullptr, stepCount);
458template<
typename ValueType,
typename RewardModelType,
typename SolutionType>
464 STORM_LOG_THROW(
false, storm::exceptions::NotImplementedException,
"We do not support computing total rewards with interval models.");
471 return computeReachabilityRewards(env, std::move(goal), transitionMatrix, backwardTransitions, rewardModel, rew0States, qualitative, hint);
480 STORM_LOG_THROW(
false, storm::exceptions::NotSupportedException,
"The specified property is not supported by this value type.");
484template<
typename ValueType,
typename RewardModelType,
typename SolutionType>
487 RewardModelType
const& rewardModel, uint_fast64_t stepBound, ValueType discountFactor) {
489 STORM_LOG_THROW(
false, storm::exceptions::NotImplementedException,
"We do not support discounted cumulative rewards with interval models.");
492 STORM_LOG_THROW(!rewardModel.empty(), storm::exceptions::InvalidPropertyException,
"Missing reward model for formula. Skipping formula.");
495 std::vector<ValueType> totalRewardVector = rewardModel.getTotalRewardVector(transitionMatrix);
501 multiplier->repeatedMultiplyWithFactor(env, result, &totalRewardVector, stepBound, discountFactor);
514 STORM_LOG_THROW(
false, storm::exceptions::NotSupportedException,
"The specified property is not supported by this value type.");
518template<
typename ValueType,
typename RewardModelType,
typename SolutionType>
524 STORM_LOG_THROW(
false, storm::exceptions::NotImplementedException,
"We do not support discounted total rewards with interval models.");
528 "Exact solving of discounted total reward objectives is currently not supported.");
531 std::vector<ValueType> b;
534 b = rewardModel.getTotalRewardVector(transitionMatrix);
537 return std::vector<SolutionType>(std::move(x));
541template<
typename ValueType,
typename RewardModelType,
typename SolutionType>
548 env, std::move(goal), transitionMatrix, backwardTransitions,
550 return rewardModel.getTotalRewardVector(numberOfRows, transitionMatrix, maybeStates);
552 targetStates, qualitative, [&]() {
return rewardModel.getStatesWithZeroReward(transitionMatrix); }, hint);
555template<
typename ValueType,
typename RewardModelType,
typename SolutionType>
562 env, std::move(goal), transitionMatrix, backwardTransitions,
571template<
typename ValueType,
typename RewardModelType,
typename SolutionType>
580 env, std::move(goal), transitionMatrix, backwardTransitions,
588template<
typename ValueType,
typename SolutionType>
590 std::vector<SolutionType>
const& oneStepTargetProbabilities) {
592 STORM_LOG_THROW(
false, storm::exceptions::NotImplementedException,
"We do not support computing upper reward bounds with interval models.");
602 std::vector<storm::RationalFunction>
const& ,
603 std::vector<storm::RationalFunction>
const& ) {
604 STORM_LOG_THROW(
false, storm::exceptions::NotSupportedException,
"Computing upper reward bounds is not supported for rational functions.");
607template<
typename ValueType,
typename RewardModelType,
typename SolutionType>
608DTMCSparseModelCheckingHelperReturnType<typename SparseDtmcPrctlHelper<ValueType, RewardModelType, SolutionType>::ExtendedSolutionType>
613 totalStateRewardVectorGetter,
624 rew0States = targetStates;
630 maybeStates = hint.template asExplicitModelCheckerHint<ValueType>().getMaybeStates();
634 <<
" states remaining).");
636 storm::storage::BitVector trueStates(transitionMatrix.
getRowCount(),
true);
639 maybeStates = ~(rew0States | infinityStates);
642 <<
" states with reward zero (" << maybeStates.
getNumberOfSetBits() <<
" states remaining).");
648 bool maybeStatesNotRelevant = goal.hasRelevantValues() && goal.relevantValues().
isDisjointFrom(maybeStates);
651 if (qualitative || maybeStatesNotRelevant) {
656 if (!maybeStates.
empty()) {
660 storm::storage::SparseMatrix<ValueType> submatrix = transitionMatrix.
filterEntries(transitionMatrix.
getRowFilter(maybeStates));
665 std::vector<ValueType> b = totalStateRewardVectorGetter(submatrix.
getRowCount(), transitionMatrix,
670 storm::solver::SolutionBounds<SolutionType> boundsForMaybeStates;
674 auto embedBound = [&result, &maybeStates](std::vector<SolutionType>
const& boundForMaybeStates) {
675 std::vector<ExtendedSolutionType> bound(result);
676 STORM_LOG_ASSERT(boundForMaybeStates.size() == bound.size(),
"Dimensions do not match.");
677 for (
auto const state : maybeStates) {
678 bound[state] = boundForMaybeStates[state];
682 solutionBounds = boundsForMaybeStates.
transform(embedBound);
686 for (
auto const state : maybeStates) {
687 result[state] = x[state];
691 storm::solver::GeneralLinearEquationSolverFactory<ValueType> linearEquationSolverFactory;
692 bool convertToEquationSystem =
697 storm::storage::SparseMatrix<ValueType> submatrix = transitionMatrix.
getSubmatrix(
true, maybeStates, maybeStates, convertToEquationSystem);
701 std::vector<ValueType> x;
711 std::vector<ValueType> b = totalStateRewardVectorGetter(submatrix.
getRowCount(), transitionMatrix, maybeStates);
713 storm::solver::LinearEquationSolverRequirements requirements = linearEquationSolverFactory.
getRequirements(env);
714 boost::optional<std::vector<ValueType>> upperRewardBounds;
724 if (convertToEquationSystem) {
730 goal.restrictRelevantValues(maybeStates);
731 std::unique_ptr<storm::solver::LinearEquationSolver<ValueType>> solver =
734 if (upperRewardBounds) {
735 solver->setUpperBounds(std::move(upperRewardBounds.get()));
739 solver->solveEquations(env, x, b);
742 auto embedBound = [&result, &maybeStates](std::vector<ValueType>
const& boundForMaybeStates) {
743 std::vector<ExtendedSolutionType> bound(result);
747 solutionBounds = solver->getSolutionBounds().
transform(embedBound);
754 if (maybeStates.
empty()) {
759 returnValue.solutionBounds = std::move(solutionBounds);
763template<
typename ValueType,
typename RewardModelType,
typename SolutionType>
764typename SparseDtmcPrctlHelper<ValueType, RewardModelType, SolutionType>::BaierTransformedModel
765SparseDtmcPrctlHelper<ValueType, RewardModelType, SolutionType>::computeBaierTransformation(Environment
const& env,
766 storm::storage::SparseMatrix<ValueType>
const& transitionMatrix,
767 storm::storage::SparseMatrix<ValueType>
const& backwardTransitions,
768 storm::storage::BitVector
const& targetStates,
769 storm::storage::BitVector
const& conditionStates,
770 boost::optional<std::vector<ValueType>>
const& stateRewards) {
772 STORM_LOG_THROW(
false, storm::exceptions::NotImplementedException,
"We do not support baier transformation with interval models.");
774 BaierTransformedModel result;
777 std::vector<ValueType> probabilitiesToReachConditionStates =
778 computeUntilProbabilities(env, storm::solver::SolveGoal<ValueType>(), transitionMatrix, backwardTransitions,
779 storm::storage::BitVector(transitionMatrix.
getRowCount(),
true), conditionStates,
false)
782 result.beforeStates = storm::storage::BitVector(targetStates.
size(),
true);
783 uint_fast64_t state = 0;
784 uint_fast64_t beforeStateIndex = 0;
785 for (
auto const& value : probabilitiesToReachConditionStates) {
787 result.beforeStates.set(state,
false);
789 probabilitiesToReachConditionStates[beforeStateIndex] = value;
794 probabilitiesToReachConditionStates.resize(beforeStateIndex);
796 if (targetStates.
empty()) {
797 result.noTargetStates =
true;
799 }
else if (!result.beforeStates.empty()) {
805 storm::storage::BitVector allStates(targetStates.
size(),
true);
806 std::vector<uint_fast64_t> numberOfBeforeStatesUpToState = result.beforeStates.getNumberOfSetBitsBeforeIndices();
809 uint_fast64_t normalStatesOffset = result.beforeStates.getNumberOfSetBits();
813 bool addDeadlockState =
false;
814 uint_fast64_t deadlockState = normalStatesOffset + statesWithProbabilityGreater0.
getNumberOfSetBits();
817 storm::storage::SparseMatrixBuilder<ValueType> builder;
820 uint_fast64_t currentRow = 0;
821 for (
auto beforeState : result.beforeStates) {
822 if (conditionStates.
get(beforeState)) {
825 for (
auto const& successorEntry : transitionMatrix.
getRow(beforeState)) {
826 if (statesWithProbabilityGreater0.
get(successorEntry.getColumn())) {
827 builder.
addNextValue(currentRow, normalStatesOffset + numberOfNormalStatesUpToState[successorEntry.getColumn()],
828 successorEntry.getValue());
830 zeroProbability += successorEntry.getValue();
834 builder.
addNextValue(currentRow, deadlockState, zeroProbability);
838 for (
auto const& successorEntry : transitionMatrix.
getRow(beforeState)) {
839 if (result.beforeStates.get(successorEntry.getColumn())) {
840 builder.
addNextValue(currentRow, numberOfBeforeStatesUpToState[successorEntry.getColumn()],
841 successorEntry.getValue() *
842 probabilitiesToReachConditionStates[numberOfBeforeStatesUpToState[successorEntry.getColumn()]] /
843 probabilitiesToReachConditionStates[currentRow]);
851 for (uint64_t state : statesWithProbabilityGreater0) {
853 for (
auto const& successorEntry : transitionMatrix.
getRow(state)) {
854 if (statesWithProbabilityGreater0.get(successorEntry.getColumn())) {
855 builder.
addNextValue(currentRow, normalStatesOffset + numberOfNormalStatesUpToState[successorEntry.getColumn()],
856 successorEntry.getValue());
858 zeroProbability += successorEntry.getValue();
862 addDeadlockState =
true;
863 builder.
addNextValue(currentRow, deadlockState, zeroProbability);
867 if (addDeadlockState) {
872 result.transitionMatrix = builder.
build(addDeadlockState ? (deadlockState + 1) : deadlockState);
873 storm::storage::BitVector newTargetStates = targetStates % result.beforeStates;
874 newTargetStates.
resize(result.transitionMatrix.get().getRowCount());
875 for (uint64_t state : targetStates % statesWithProbabilityGreater0) {
876 newTargetStates.
set(normalStatesOffset + state,
true);
878 result.targetStates = std::move(newTargetStates);
882 std::vector<ValueType> newStateRewards(result.beforeStates.getNumberOfSetBits());
885 newStateRewards.reserve(result.transitionMatrix.get().getRowCount());
886 for (uint64_t state : statesWithProbabilityGreater0) {
887 newStateRewards.push_back(stateRewards.get()[state]);
890 if (addDeadlockState) {
893 result.stateRewards = std::move(newStateRewards);
901template<
typename ValueType,
typename RewardModelType,
typename SolutionType>
902storm::storage::BitVector SparseDtmcPrctlHelper<ValueType, RewardModelType, SolutionType>::BaierTransformedModel::getNewRelevantStates()
const {
903 storm::storage::BitVector newRelevantStates(transitionMatrix.get().getRowCount());
904 for (uint64_t i = 0;
i < this->beforeStates.getNumberOfSetBits(); ++
i) {
905 newRelevantStates.set(i);
907 return newRelevantStates;
910template<
typename ValueType,
typename RewardModelType,
typename SolutionType>
911storm::storage::BitVector SparseDtmcPrctlHelper<ValueType, RewardModelType, SolutionType>::BaierTransformedModel::getNewRelevantStates(
912 storm::storage::BitVector
const& oldRelevantStates)
const {
913 storm::storage::BitVector result = oldRelevantStates % this->beforeStates;
918template<
typename ValueType,
typename RewardModelType,
typename SolutionType>
919std::vector<typename SparseDtmcPrctlHelper<ValueType, RewardModelType, SolutionType>::ExtendedSolutionType>
925 STORM_LOG_THROW(
false, storm::exceptions::NotImplementedException,
"We do not support computing conditional probabilities with interval models.");
930 STORM_LOG_THROW(goal.hasRelevantValues() ? goal.relevantValues().isSubsetOf(conditionProbGreater0States) : !conditionProbGreater0States.
empty(),
931 storm::exceptions::InvalidPropertyException,
"Trying to compute an undefined conditional value: the condition is not reachable.");
936 BaierTransformedModel transformedModel =
937 computeBaierTransformation(env, transitionMatrix, backwardTransitions, targetStates, conditionStates, boost::none);
939 if (transformedModel.noTargetStates) {
949 if (goal.hasRelevantValues()) {
950 newRelevantValues = transformedModel.getNewRelevantStates(goal.relevantValues());
952 newRelevantValues = transformedModel.getNewRelevantStates();
954 goal.setRelevantValues(std::move(newRelevantValues));
955 std::vector<ValueType> conditionalProbabilities =
967template<
typename ValueType,
typename RewardModelType,
typename SolutionType>
968std::vector<typename SparseDtmcPrctlHelper<ValueType, RewardModelType, SolutionType>::ExtendedSolutionType>
974 STORM_LOG_THROW(
false, storm::exceptions::NotImplementedException,
"We do not support computing conditional rewards with interval models.");
979 STORM_LOG_THROW(goal.hasRelevantValues() ? goal.relevantValues().isSubsetOf(conditionProbGreater0States) : !conditionProbGreater0States.
empty(),
980 storm::exceptions::InvalidPropertyException,
"Trying to compute an undefined conditional value: the condition is not reachable.");
985 BaierTransformedModel transformedModel = computeBaierTransformation(env, transitionMatrix, backwardTransitions, targetStates, conditionStates,
986 rewardModel.getTotalRewardVector(transitionMatrix));
988 if (transformedModel.noTargetStates) {
998 if (goal.hasRelevantValues()) {
999 newRelevantValues = transformedModel.getNewRelevantStates(goal.relevantValues());
1001 newRelevantValues = transformedModel.getNewRelevantStates();
1003 goal.setRelevantValues(std::move(newRelevantValues));
1004 std::vector<ExtendedSolutionType> conditionalRewards =
1006 transformedModel.targetStates.get(), qualitative)
SolverEnvironment & solver()
ModelCheckerEnvironment & modelchecker()
std::string const & getExportCdfDirectory() const
bool isExportCdfSet() const
bool isFilterRewZeroSet() const
storm::solver::EquationSolverType const & getLinearEquationSolverType() const
void setLinearEquationSolverPrecision(boost::optional< storm::RationalNumber > const &newPrecision, boost::optional< bool > const &relativePrecision=boost::none)
uint64_t getShowProgressDelay() const
bool isForceExact() const
std::pair< boost::optional< storm::RationalNumber >, boost::optional< bool > > getPrecisionOfLinearEquationSolver(storm::solver::EquationSolverType const &solverType) const
This class contains information that might accelerate the model checking process.
virtual bool isExplicitModelCheckerHint() const
bool solveWithDiscountedValueIteration(Environment const &env, std::optional< OptimizationDirection > dir, std::vector< ValueType > &x, std::vector< ValueType > const &b) const
std::vector< ValueType > computeUpperBounds()
Computes upper bounds on the expected rewards.
static std::vector< SolutionType > computeDiscountedCumulativeRewards(Environment const &env, storm::solver::SolveGoal< ValueType, SolutionType > &&goal, storm::storage::SparseMatrix< ValueType > const &transitionMatrix, RewardModelType const &rewardModel, uint_fast64_t stepBound, ValueType discountFactor)
static DTMCSparseModelCheckingHelperReturnType< ExtendedSolutionType > computeTotalRewards(Environment const &env, storm::solver::SolveGoal< ValueType, SolutionType > &&goal, storm::storage::SparseMatrix< ValueType > const &transitionMatrix, storm::storage::SparseMatrix< ValueType > const &backwardTransitions, RewardModelType const &rewardModel, bool qualitative, ModelCheckerHint const &hint=ModelCheckerHint())
static std::vector< SolutionType > computeDiscountedTotalRewards(Environment const &env, storm::solver::SolveGoal< ValueType, SolutionType > &&goal, storm::storage::SparseMatrix< ValueType > const &transitionMatrix, storm::storage::SparseMatrix< ValueType > const &backwardTransitions, RewardModelType const &rewardModel, bool qualitative, ValueType discountFactor, ModelCheckerHint const &hint=ModelCheckerHint())
static std::vector< SolutionType > computeRewardBoundedValues(Environment const &env, storm::models::sparse::Dtmc< ValueType > const &model, std::shared_ptr< storm::logic::OperatorFormula const > rewardBoundedFormula)
static std::vector< SolutionType > computeAllUntilProbabilities(Environment const &env, storm::solver::SolveGoal< ValueType, SolutionType > &&goal, storm::storage::SparseMatrix< ValueType > const &transitionMatrix, storm::storage::BitVector const &initialStates, storm::storage::BitVector const &phiStates, storm::storage::BitVector const &psiStates)
static std::vector< SolutionType > computeCumulativeRewards(Environment const &env, storm::solver::SolveGoal< ValueType, SolutionType > &&goal, storm::storage::SparseMatrix< ValueType > const &transitionMatrix, RewardModelType const &rewardModel, uint_fast64_t stepBound)
static std::vector< SolutionType > computeInstantaneousRewards(Environment const &env, storm::solver::SolveGoal< ValueType, SolutionType > &&goal, storm::storage::SparseMatrix< ValueType > const &transitionMatrix, RewardModelType const &rewardModel, uint_fast64_t stepCount)
static DTMCSparseModelCheckingHelperReturnType< ExtendedSolutionType > computeReachabilityTimes(Environment const &env, storm::solver::SolveGoal< ValueType, SolutionType > &&goal, storm::storage::SparseMatrix< ValueType > const &transitionMatrix, storm::storage::SparseMatrix< ValueType > const &backwardTransitions, storm::storage::BitVector const &targetStates, bool qualitative, ModelCheckerHint const &hint=ModelCheckerHint())
static std::vector< ExtendedSolutionType > computeConditionalProbabilities(Environment const &env, storm::solver::SolveGoal< ValueType, SolutionType > &&goal, storm::storage::SparseMatrix< ValueType > const &transitionMatrix, storm::storage::SparseMatrix< ValueType > const &backwardTransitions, storm::storage::BitVector const &targetStates, storm::storage::BitVector const &conditionStates, bool qualitative)
static std::vector< SolutionType > computeNextProbabilities(Environment const &env, storm::storage::SparseMatrix< ValueType > const &transitionMatrix, storm::storage::BitVector const &nextStates)
static DTMCSparseModelCheckingHelperReturnType< ExtendedSolutionType > computeReachabilityRewards(Environment const &env, storm::solver::SolveGoal< ValueType, SolutionType > &&goal, storm::storage::SparseMatrix< ValueType > const &transitionMatrix, storm::storage::SparseMatrix< ValueType > const &backwardTransitions, RewardModelType const &rewardModel, storm::storage::BitVector const &targetStates, bool qualitative, ModelCheckerHint const &hint=ModelCheckerHint())
static DTMCSparseModelCheckingHelperReturnType< SolutionType > computeUntilProbabilities(Environment const &env, storm::solver::SolveGoal< ValueType, SolutionType > &&goal, storm::storage::SparseMatrix< ValueType > const &transitionMatrix, storm::storage::SparseMatrix< ValueType > const &backwardTransitions, storm::storage::BitVector const &phiStates, storm::storage::BitVector const &psiStates, bool qualitative, ModelCheckerHint const &hint=ModelCheckerHint())
static DTMCSparseModelCheckingHelperReturnType< SolutionType > computeGloballyProbabilities(Environment const &env, storm::solver::SolveGoal< ValueType, SolutionType > &&goal, storm::storage::SparseMatrix< ValueType > const &transitionMatrix, storm::storage::SparseMatrix< ValueType > const &backwardTransitions, storm::storage::BitVector const &psiStates, bool qualitative)
static std::vector< ExtendedSolutionType > computeConditionalRewards(Environment const &env, storm::solver::SolveGoal< ValueType, SolutionType > &&goal, storm::storage::SparseMatrix< ValueType > const &transitionMatrix, storm::storage::SparseMatrix< ValueType > const &backwardTransitions, RewardModelType const &rewardModel, storm::storage::BitVector const &targetStates, storm::storage::BitVector const &conditionStates, bool qualitative)
bool hasBottomDimension(Epoch const &epoch) const
uint64_t getDimensionOfEpoch(Epoch const &epoch, uint64_t const &dimension) const
Epoch getStartEpoch(bool setUnknownDimsToBottom=false)
Retrieves the desired epoch that needs to be analyzed to compute the reward bounded values.
SolutionType getInitialStateResult(Epoch const &epoch)
Dimension< ValueType > const & getDimension(uint64_t dim) const
EpochManager const & getEpochManager() const
EpochModel< ValueType, SingleObjectiveMode > & setCurrentEpoch(Epoch const &epoch)
std::vector< Epoch > getEpochComputationOrder(Epoch const &startEpoch, bool stopAtComputedEpochs=false)
Computes a sequence of epochs that need to be analyzed to get a result at the start epoch.
ValueType getRequiredEpochModelPrecision(Epoch const &startEpoch, ValueType const &precision)
Returns the precision required for the analyzis of each epoch model in order to achieve the given ove...
boost::optional< ValueType > getLowerObjectiveBound(uint64_t objectiveIndex=0)
void setSolutionForCurrentEpoch(std::vector< SolutionType > &&inStateSolutions)
boost::optional< ValueType > getUpperObjectiveBound(uint64_t objectiveIndex=0)
Returns an upper/lower bound for the objective result in every state (if this bound could be computed...
void setEquationSystemFormatForEpochModel(storm::solver::LinearEquationSolverProblemFormat eqSysFormat)
This class represents a discrete-time Markov chain.
storm::storage::BitVector const & getInitialStates() const
Retrieves the initial states of the model.
LinearEquationSolverRequirements getRequirements(Environment const &env) const
Retrieves the requirements of the solver if it was created with the current settings.
virtual LinearEquationSolverProblemFormat getEquationProblemFormat(Environment const &env) const
Retrieves the problem format that the solver expects if it was created with the current settings.
SolverRequirement const & upperBounds() const
std::string getEnabledRequirementsAsString() const
Checks whether there are no critical requirements left.
bool hasEnabledCriticalRequirement() const
std::unique_ptr< Multiplier< ValueType, SolutionType > > create(Environment const &env, storm::storage::SparseMatrix< ValueType > const &matrix)
A bit vector that is internally represented as a vector of 64-bit values.
void complement()
Negates all bits 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 ...
std::vector< uint64_t > getNumberOfSetBitsBeforeIndices() const
Retrieves a vector that holds at position i the number of bits set before index i.
bool empty() const
Retrieves whether no bits are set to true in this 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.
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.
void addNextValue(index_type row, index_type column, value_type const &value)
Sets the matrix entry at the given row and column to the given value.
SparseMatrix< value_type > build(index_type overriddenRowCount=0, index_type overriddenColumnCount=0, index_type overriddenRowGroupCount=0)
A class that holds a possibly non-square matrix in the compressed row storage format.
void convertToEquationSystem()
Transforms the matrix into an equation system.
const_rows getRow(index_type row) const
Returns an object representing the given row.
void makeRowsAbsorbing(storm::storage::BitVector const &rows, bool dropZeroEntries=false)
This function makes the given rows absorbing.
SparseMatrix getSubmatrix(bool useGroups, storm::storage::BitVector const &rowConstraint, storm::storage::BitVector const &columnConstraint, bool insertDiagonalEntries=false, storm::storage::BitVector const &makeZeroColumns=storm::storage::BitVector()) const
Creates a submatrix of the current matrix by dropping all rows and columns whose bits are not set to ...
std::vector< value_type > getConstrainedRowSumVector(storm::storage::BitVector const &rowConstraint, storm::storage::BitVector const &columnConstraint) const
Computes a vector whose i-th entry is the sum of the entries in the i-th selected row where only thos...
index_type getRowGroupCount() const
Returns the number of row groups in the matrix.
index_type getColumnCount() const
Returns the number of columns of the matrix.
void deleteDiagonalEntries(bool dropZeroEntries=false)
Sets all diagonal elements to zero.
storm::storage::SparseMatrix< value_type > transpose(bool joinGroups=false, bool keepZeros=false) const
Transposes the matrix.
index_type getRowCount() const
Returns the number of rows of the matrix.
storm::storage::BitVector getRowFilter(storm::storage::BitVector const &groupConstraint) const
Returns a bitvector representing the set of rows, with all indices set that correspond to one of the ...
SparseMatrix filterEntries(storm::storage::BitVector const &rowFilter) const
Returns a copy of this matrix that only considers entries in the selected rows.
A class that provides convenience operations to display run times.
bool updateProgress(uint64_t count)
Updates the progress to the current count and logs it (on the progress log channel) if the delay pass...
void setMaxCount(uint64_t maxCount)
Sets the maximal possible count.
void startNewMeasurement(uint64_t startCount)
Starts a new measurement, dropping all progress information collected so far.
A class that provides convenience operations to display run times.
void start()
Start stopwatch (again) and start measuring time.
void stop()
Stop stopwatch and add measured time to total time.
#define STORM_LOG_INFO(message)
#define STORM_LOG_STATISTICS(message)
#define STORM_LOG_ASSERT(cond, message)
#define STORM_LOG_THROW(cond, exception, message)
SFTBDDChecker::ValueType ValueType
void exportDataToCSVFile(std::string filepath, std::vector< std::vector< DataType > > const &data, boost::optional< std::vector< Header1Type > > const &header1=boost::none, boost::optional< std::vector< Header2Type > > const &header2=boost::none)
std::vector< SolutionType > computeRobustValuesForMaybeStates(Environment const &env, storm::solver::SolveGoal< ValueType, SolutionType > &&goal, storm::storage::SparseMatrix< ValueType > &&submatrix, std::vector< ValueType > const &b, bool computeReward, storm::solver::SolutionBounds< SolutionType > &solutionBounds)
std::vector< ValueType > computeUpperRewardBounds(storm::storage::SparseMatrix< ValueType > const &transitionMatrix, std::vector< ValueType > const &rewards, std::vector< ValueType > const &oneStepTargetProbabilities)
bool isSet(OptimizationDirectionSetting s)
std::unique_ptr< storm::solver::MinMaxLinearEquationSolver< ValueType, SolutionType > > configureMinMaxLinearEquationSolver(Environment const &env, SolveGoal< ValueType, SolutionType > &&goal, storm::solver::MinMaxLinearEquationSolverFactory< ValueType, SolutionType > const &factory, MatrixType &&matrix, OptimizationDirectionSetting optimizationDirectionSetting=OptimizationDirectionSetting::Unset)
std::unique_ptr< storm::solver::LinearEquationSolver< ValueType > > configureLinearEquationSolver(Environment const &env, SolveGoal< ValueType, SolutionType > &&goal, storm::solver::LinearEquationSolverFactory< ValueType > const &factory, MatrixType &&matrix)
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...
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 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...
bool isTerminate()
Check whether the program should terminate (due to some abort signal).
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.
void setAllValues(std::vector< T > &vec, storm::storage::BitVector const &positions, T const &positiveValue=storm::utility::one< T >(), T const &negativeValue=storm::utility::zero< T >())
void selectVectorValues(std::vector< T > &vector, storm::storage::BitVector const &positions, std::vector< T > const &values)
Selects the elements from a vector at the specified positions and writes them consecutively into anot...
storm::storage::BitVector filterZero(std::vector< T > const &values)
Retrieves a bit vector containing all the indices for which the value at this position is equal to ze...
void subtractFromConstantOneVector(std::vector< T > &vector)
Subtracts the given vector from the constant one-vector and writes the result to the input vector.
std::vector< Type > filterVector(std::vector< Type > const &in, storm::storage::BitVector const &filter)
ExtendedValueType< ValueType > positiveInfinity()
bool isOne(ValueType const &a)
bool isZero(ValueType const &a)
std::vector< ValueType > narrowFinite(std::vector< ExtendedValueType< ValueType > > &&values)
The counterpart of widen for a vector all of whose values are finite.
TargetType convertNumber(SourceType const &number)
The contract of a DD backend.
constexpr bool IsIntervalType
Helper to check if a type is an interval.
carl::RationalFunction< Polynomial, true > RationalFunction
The outcome of a quantitative model checking query on a sparse DTMC.
std::vector< ValueType > values
storm::solver::SolutionBounds< ValueType > solutionBounds
Sound lower and upper bounds on a solution vector.
auto transform(Function const &function) const
Applies the given function to whichever of the bounds are set, e.g.
void setExact(std::vector< ValueType > const &values)
Sets both bounds to the given values, i.e.