18template<
typename SparseModelType>
24template<
typename SparseModelType>
30 STORM_LOG_DEBUG(
"Can not simplify when Until-formula has non-propositional subformula(s). Formula: " << formula);
34 ->template asExplicitQualitativeCheckResult<typename SparseModelType::ValueType>()
35 .getTruthValuesVector());
37 ->template asExplicitQualitativeCheckResult<typename SparseModelType::ValueType>()
38 .getTruthValuesVector());
39 std::pair<storm::storage::BitVector, storm::storage::BitVector> statesWithProbability01 =
43 this->
originalModel.getTransitionMatrix(), this->originalModel.getInitialStates() & ~statesWithProbability01.first, ~statesWithProbability01.first,
44 statesWithProbability01.second);
50 goalStateMerger.
mergeTargetAndSinkStates(maybeStates, statesWithProbability01.second, statesWithProbability01.first);
54 statesWithProbability01.second.set(mergerResult.
targetState.get(),
true);
56 std::string targetLabel =
"target";
58 targetLabel =
"_" + targetLabel;
60 this->
simplifiedModel->getStateLabeling().addLabel(targetLabel, std::move(statesWithProbability01.second));
63 auto labelFormula = std::make_shared<storm::logic::AtomicLabelFormula const>(targetLabel);
73 considerForElimination.
set(*mergerResult.
sinkState,
false);
80template<
typename SparseModelType>
83 "Lower step bounds are not supported.");
85 "Expected a bounded until formula with an upper bound.");
87 storm::exceptions::UnexpectedException,
"Expected a bounded until formula with integral bounds.");
91 STORM_LOG_THROW(upperStepBound > 0, storm::exceptions::UnexpectedException,
"Expected a strict upper bound that is greater than zero.");
99 STORM_LOG_DEBUG(
"Can not simplify when Until-formula has non-propositional subformula(s). Formula: " << formula);
103 ->template asExplicitQualitativeCheckResult<typename SparseModelType::ValueType>()
104 .getTruthValuesVector());
106 ->template asExplicitQualitativeCheckResult<typename SparseModelType::ValueType>()
107 .getTruthValuesVector());
115 probGreater0States, psiStates,
true, upperStepBound);
128 std::string targetLabel =
"target";
130 targetLabel =
"_" + targetLabel;
132 this->
simplifiedModel->getStateLabeling().addLabel(targetLabel, std::move(psiStates));
135 auto labelFormula = std::make_shared<storm::logic::AtomicLabelFormula const>(targetLabel);
136 auto boundedUntilFormula =
146template<
typename SparseModelType>
148 typename SparseModelType::RewardModelType
const& originalRewardModel =
154 STORM_LOG_DEBUG(
"Can not simplify when reachability reward formula has non-propositional subformula(s). Formula: " << formula);
158 ->template asExplicitQualitativeCheckResult<typename SparseModelType::ValueType>()
159 .getTruthValuesVector());
162 originalRewardModel.getStatesWithZeroReward(this->originalModel.getTransitionMatrix()), targetStates);
168 this->
originalModel.getTransitionMatrix(), this->originalModel.getInitialStates() & statesWithProb1, statesWithProb1, targetStates);
172 std::vector<std::string> rewardModelNameAsVector(
182 std::string targetLabel =
"target";
184 targetLabel =
"_" + targetLabel;
186 this->
simplifiedModel->getStateLabeling().addLabel(targetLabel, std::move(targetStates));
189 auto labelFormula = std::make_shared<storm::logic::AtomicLabelFormula const>(targetLabel);
192 std::make_shared<storm::logic::RewardOperatorFormula const>(eventuallyFormula, rewardModelNameAsVector.front(), formula.
getOperatorInformation());
200 considerForElimination.
set(*mergerResult.
sinkState,
false);
207template<
typename SparseModelType>
210 storm::exceptions::UnexpectedException,
"Expected a cumulative reward formula with integral bound.");
212 typename SparseModelType::RewardModelType
const& originalRewardModel =
217 STORM_LOG_THROW(stepBound > 0, storm::exceptions::UnexpectedException,
"Expected a strict upper bound that is greater than zero.");
224 ~originalRewardModel.getStatesWithZeroReward(this->originalModel.getTransitionMatrix()),
true, stepBound);
229 std::vector<std::string> rewardModelNameAsVector(
virtual bool isIntegerLiteralExpression() const
int_fast64_t evaluateAsInt(Valuation const *valuation=nullptr) const
Evaluates the expression under the valuation of variables given by the valuation and returns the resu...
BaseExpression const & getBaseExpression() const
Retrieves the base expression underlying this expression object.
std::shared_ptr< Formula > clone(Formula const &f) const
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
A bit vector that is internally represented as a vector of 64-bit values.
void set(uint64_t index, bool value=true)
Sets the given truth value at the given index.
#define STORM_LOG_DEBUG(message)
#define STORM_LOG_THROW(cond, exception, message)
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...