27 : type(type), optimizationDirection(dir), rewardModelName(rewardModelName) {
29 "Got a reward model name for a non-reward formula.");
50 "Target states requested for unexpected formula type.");
51 return targetStates.value();
56 return sinkStates.value();
61 return rewardModelName.value();
65 return optimizationDirection;
76template<
typename PomdpType>
79 result.
states = std::move(inputStates);
80 for (
auto const state : result.
states) {
86 if (result.
observations.count(pomdp.getObservation(state)) > 0) {
94template<
typename PomdpType>
97 "Target states updated for unexpected formula type.");
98 targetStates =
getStateSet(pomdp, std::move(newTargetStates));
101template<
typename PomdpType>
104 sinkStates =
getStateSet(pomdp, std::move(newSinkStates));
107template<
typename PomdpType>
110 auto checkResult = mc.
check(propositionalFormula);
112 if (formulaInverted) {
115 return resultBitVector;
118template<
typename PomdpType>
121 "The property does not specify an optimization direction (min/max)");
124 std::shared_ptr<storm::logic::Formula const> targetStatesFormula, constraintsStatesFormula;
125 if (subformula.isEventuallyFormula()) {
128 }
else if (subformula.isUntilFormula()) {
143template<
typename PomdpType>
146 "The property does not specify an optimization direction (min/max)");
148 std::string rewardModelName =
"";
151 STORM_LOG_THROW(pomdp.hasRewardModel(rewardModelName), storm::exceptions::InvalidPropertyException,
152 "Selected reward model with name '" << rewardModelName <<
"' does not exist.");
154 STORM_LOG_THROW(pomdp.hasUniqueRewardModel(), storm::exceptions::InvalidPropertyException,
155 "Reward operator formula does not specify a reward model and the reward model is not unique.");
156 rewardModelName = pomdp.getUniqueRewardModelName();
159 std::shared_ptr<storm::logic::Formula const> targetStatesFormula;
160 if (subformula.isEventuallyFormula()) {
171template<
typename PomdpType>
187template void FormulaInformation::updateTargetStates<storm::models::sparse::Pomdp<storm::RationalNumber>>(
189template void FormulaInformation::updateSinkStates<storm::models::sparse::Pomdp<storm::RationalNumber>>(
191template FormulaInformation getFormulaInformation<storm::models::sparse::Pomdp<storm::RationalNumber>>(
virtual std::unique_ptr< CheckResult > check(Environment const &env, CheckTask< storm::logic::Formula, SolutionType > const &checkTask)
Checks the provided formula.
This class represents a partially observable Markov decision process.
A bit vector that is internally represented as a vector of 64-bit values.
void complement()
Negates all bits in the bit vector.
bool empty() const
Retrieves whether no bits are set to true in this bit vector.
size_t size() const
Retrieves the number of bits this bit vector can store.
uint_fast64_t getNextUnsetIndex(uint_fast64_t startingIndex) const
Retrieves the index of the bit that is the next bit set to false in the bit vector.
#define STORM_LOG_ASSERT(cond, message)
#define STORM_LOG_WARN_COND(cond, message)
#define STORM_LOG_THROW(cond, exception, message)
FragmentSpecification propositional()
storm::storage::BitVector getStates(storm::logic::Formula const &propositionalFormula, bool formulaInverted, PomdpType const &pomdp)
FormulaInformation::StateSet getStateSet(PomdpType const &pomdp, storm::storage::BitVector &&inputStates)
FormulaInformation getFormulaInformation(PomdpType const &pomdp, storm::logic::ProbabilityOperatorFormula const &formula)
bool constexpr maximize(OptimizationDirection d)
bool constexpr minimize(OptimizationDirection d)