Storm 1.14.0.1
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
FormulaInformation.h
Go to the documentation of this file.
1#pragma once
2
3#include <optional>
4#include <set>
5#include <string>
9
10namespace storm {
11
12namespace logic {
13class Formula;
14}
15
16namespace pomdp {
17namespace analysis {
19 public:
21 struct StateSet {
22 storm::storage::BitVector states; // The set of states
23 std::set<uint32_t> observations; // The set of the observations that are assigned to at least one state of the set
24 bool observationClosed; // True iff this state set can be uniquely characterized by the observations
25 bool empty() const;
26 };
27
29 enum class Type {
30 NonNestedReachabilityProbability, // e.g. 'Pmax=? [F "target"]' or 'Pmin=? [!"sink" U "target"]'
31 NonNestedExpectedRewardFormula, // e.g. 'Rmin=? [F x>0 ]'
32 DiscountedTotalRewardFormula, // e.g. 'Rmax=? [Cdiscount=9/10}]'
33 Unsupported // The formula type is unsupported
34 };
35
36 FormulaInformation(); // Unsupported
37 FormulaInformation(Type const& type, storm::solver::OptimizationDirection const& dir, std::optional<std::string> const& rewardModelName = std::nullopt);
38
39 Type const& getType() const;
43 bool isBounded() const;
44 bool isUnsupported() const;
45 StateSet const& getTargetStates() const;
46 StateSet const& getSinkStates() const; // Shall not be called for reward formulas
47 std::string const& getRewardModelName() const; // Shall not be called for probability formulas
49 std::vector<logic::TimeBoundReference> const& getRewardBoundReferences() const;
50 bool minimize() const;
51 bool maximize() const;
52
53 template<typename PomdpType>
54 void updateTargetStates(PomdpType const& pomdp, storm::storage::BitVector&& newTargetStates);
55
56 template<typename PomdpType>
57 void updateSinkStates(PomdpType const& pomdp, storm::storage::BitVector&& newSinkStates);
58
59 void setRewardBounded(bool newValue);
60
61 void setRewardBoundReferences(std::vector<logic::TimeBoundReference>& newRewardBoundReferences);
62
63 private:
64 Type type;
65 storm::solver::OptimizationDirection optimizationDirection;
66 std::optional<StateSet> targetStates;
67 std::optional<StateSet> sinkStates;
68 std::optional<std::string> rewardModelName;
69 std::vector<logic::TimeBoundReference> rewardBoundReferences;
70 bool rewardBounded = false;
71};
72
73template<typename PomdpType>
74FormulaInformation getFormulaInformation(PomdpType const& pomdp, storm::logic::Formula const& formula);
75
76} // namespace analysis
77} // namespace pomdp
78} // namespace storm
void updateSinkStates(PomdpType const &pomdp, storm::storage::BitVector &&newSinkStates)
storm::solver::OptimizationDirection const & getOptimizationDirection() const
Type
Possible supported formula types.
void setRewardBoundReferences(std::vector< logic::TimeBoundReference > &newRewardBoundReferences)
void updateTargetStates(PomdpType const &pomdp, storm::storage::BitVector &&newTargetStates)
std::vector< logic::TimeBoundReference > const & getRewardBoundReferences() const
A bit vector that is internally represented as a vector of 64-bit values.
Definition BitVector.h:16
FormulaInformation getFormulaInformation(PomdpType const &pomdp, storm::logic::ProbabilityOperatorFormula const &formula)