27 : type(type), optimizationDirection(dir), rewardModelName(rewardModelName) {
30 "Got a reward model name for a non-reward formula.");
59 "Target states requested for unexpected formula type.");
60 return targetStates.value();
65 return sinkStates.value();
70 "Reward model requested for unexpected formula type.");
71 return rewardModelName.value();
75 return optimizationDirection;
79 return rewardBoundReferences;
90 rewardBounded = newValue;
93template<
typename PomdpType>
96 result.
states = std::move(inputStates);
97 for (uint64_t state : result.
states) {
111template<
typename PomdpType>
114 "Target states updated for unexpected formula type.");
118template<
typename PomdpType>
125 rewardBoundReferences = newRewardBoundReferences;
128template<
typename PomdpType>
131 auto checkResult = mc.
check(propositionalFormula);
132 storm::storage::BitVector resultBitVector(checkResult->template asExplicitQualitativeCheckResult<typename PomdpType::ValueType>().getTruthValuesVector());
133 if (formulaInverted) {
136 return resultBitVector;
139template<
typename PomdpType>
142 "The property does not specify an optimization direction (min/max).");
145 bool bounded =
false;
146 std::vector<storm::logic::TimeBoundReference> rewardBoundReferences;
148 std::shared_ptr<storm::logic::Formula const> targetStatesFormula, constraintsStatesFormula;
149 if (subformula.isEventuallyFormula()) {
150 targetStatesFormula = subformula.asEventuallyFormula().getSubformula().asSharedPointer();
152 }
else if (subformula.isUntilFormula()) {
156 }
else if (subformula.isBoundedUntilFormula()) {
159 "Reward-bounded POMDP properties with dimension-specific state subformulas are not supported.");
160 for (uint64_t i = 0; i < boundedUntilFormula.
getDimension(); ++i) {
162 "Reward-bounded until properties for POMDPs currently require 'true' as the left-hand side, i.e., they must be reward-bounded "
163 "reachability properties.");
168 for (uint64_t i = 0; i < boundedUntilFormula.
getDimension(); ++i) {
170 STORM_LOG_THROW(boundReference.isRewardBound() && !boundReference.hasRewardAccumulation(), storm::exceptions::NotSupportedException,
171 "For POMDPs, only plain reward bounds are supported.");
172 STORM_LOG_THROW(boundReference.hasRewardModelName(), storm::exceptions::NotSupportedException,
173 "For POMDPs, reward-bounded formulae must explicitly name a reward model for each bound.");
174 rewardBoundReferences.push_back(boundReference);
191template<
typename PomdpType>
194 "The property does not specify an optimization direction (min/max).");
196 std::string rewardModelName =
"";
199 STORM_LOG_THROW(
pomdp.hasRewardModel(rewardModelName), storm::exceptions::InvalidPropertyException,
200 "Selected reward model with name '" << rewardModelName <<
"' does not exist.");
203 "Reward operator formula does not specify a reward model and the reward model is not unique.");
204 rewardModelName =
pomdp.getUniqueRewardModelName();
207 if (subformula.isDiscountedTotalRewardFormula()) {
211 std::shared_ptr<storm::logic::Formula const> targetStatesFormula;
212 if (subformula.isEventuallyFormula()) {
213 targetStatesFormula = subformula.asEventuallyFormula().getSubformula().asSharedPointer();
223template<
typename PomdpType>
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.
uint64_t getNextUnsetIndex(uint64_t startingIndex) const
Retrieves the index of the bit that is the next bit set to false in the bit vector.
size_t size() const
Retrieves the number of bits this bit vector can store.
#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)