Storm
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
OrderExtender.h
Go to the documentation of this file.
1#ifndef STORM_ORDEREXTENDER_H
2#define STORM_ORDEREXTENDER_H
3
4#include <boost/container/flat_set.hpp>
10
16
17namespace storm {
18namespace analysis {
19template<typename ValueType, typename ConstantType>
21 public:
25
33 OrderExtender(std::shared_ptr<models::sparse::Model<ValueType>> model, std::shared_ptr<logic::Formula const> formula);
34
43
52 std::tuple<std::shared_ptr<Order>, uint_fast64_t, uint_fast64_t> toOrder(storage::ParameterRegion<ValueType> region,
53 std::shared_ptr<MonotonicityResult<VariableType>> monRes = nullptr);
54
64 std::tuple<std::shared_ptr<Order>, uint_fast64_t, uint_fast64_t> extendOrder(std::shared_ptr<Order> order,
66 std::shared_ptr<MonotonicityResult<VariableType>> monRes = nullptr,
67 std::shared_ptr<expressions::BinaryRelationExpression> assumption = nullptr);
68
69 void setMinMaxValues(std::shared_ptr<Order> order, std::vector<ConstantType>& minValues, std::vector<ConstantType>& maxValues);
70 void setMinValues(std::shared_ptr<Order> order, std::vector<ConstantType>& minValues);
71 void setMaxValues(std::shared_ptr<Order> order, std::vector<ConstantType>& maxValues);
72 void setMinValuesInit(std::vector<ConstantType>& minValues);
73 void setMaxValuesInit(std::vector<ConstantType>& minValues);
74
75 void setUnknownStates(std::shared_ptr<Order> order, uint_fast64_t state1, uint_fast64_t state2);
76
77 std::pair<uint_fast64_t, uint_fast64_t> getUnknownStates(std::shared_ptr<Order> order) const;
78 void setUnknownStates(std::shared_ptr<Order> orderOriginal, std::shared_ptr<Order> orderCopy);
79 void copyMinMax(std::shared_ptr<Order> orderOriginal, std::shared_ptr<Order> orderCopy);
81 void checkParOnStateMonRes(uint_fast64_t s, std::shared_ptr<Order> order, typename OrderExtender<ValueType, ConstantType>::VariableType param,
82 std::shared_ptr<MonotonicityResult<VariableType>> monResult);
83
84 bool isHope(std::shared_ptr<Order> order);
85
87 std::vector<std::set<VariableType>> const& getVariablesOccuringAtState();
88
89 private:
90 Order::NodeComparison addStatesBasedOnMinMax(std::shared_ptr<Order> order, uint_fast64_t state1, uint_fast64_t state2) const;
91 std::tuple<std::shared_ptr<Order>, uint_fast64_t, uint_fast64_t> extendOrder(std::shared_ptr<Order> order,
92 std::shared_ptr<MonotonicityResult<VariableType>> monRes,
93 std::shared_ptr<expressions::BinaryRelationExpression> assumption = nullptr);
94 std::pair<uint_fast64_t, uint_fast64_t> extendNormal(std::shared_ptr<Order> order, uint_fast64_t currentState, std::vector<uint_fast64_t> const& successors,
95 bool allowMerge);
96 std::pair<uint_fast64_t, uint_fast64_t> extendByBackwardReasoning(std::shared_ptr<Order> order, uint_fast64_t currentState,
97 std::vector<uint_fast64_t> const& successors, bool allowMerge);
98 std::pair<uint_fast64_t, uint_fast64_t> extendByForwardReasoning(std::shared_ptr<Order> order, uint_fast64_t currentState,
99 std::vector<uint_fast64_t> const& successors, bool allowMerge);
100 bool extendByAssumption(std::shared_ptr<Order> order, uint_fast64_t state1, uint_fast64_t state2);
101
102 void handleOneSuccessor(std::shared_ptr<Order> order, uint_fast64_t currentState, uint_fast64_t successor);
103 void handleAssumption(std::shared_ptr<Order> order, std::shared_ptr<expressions::BinaryRelationExpression> assumption) const;
104
105 std::pair<uint_fast64_t, bool> getNextState(std::shared_ptr<Order> order, uint_fast64_t stateNumber, bool done);
106 std::shared_ptr<Order> getBottomTopOrder();
107
108 std::shared_ptr<Order> bottomTopOrder = nullptr;
109
110 std::map<std::shared_ptr<Order>, std::vector<ConstantType>> minValues;
111 boost::optional<std::vector<ConstantType>> minValuesInit;
112 boost::optional<std::vector<ConstantType>> maxValuesInit;
113 std::map<std::shared_ptr<Order>, std::vector<ConstantType>> maxValues;
114
116 std::shared_ptr<models::sparse::Model<ValueType>> model;
117
118 std::map<uint_fast64_t, std::vector<uint_fast64_t>> stateMap;
119 std::map<std::shared_ptr<Order>, std::pair<uint_fast64_t, uint_fast64_t>> unknownStatesMap;
120
121 std::map<std::shared_ptr<Order>, bool> usePLA;
122 std::map<std::shared_ptr<Order>, bool> continueExtending;
123 bool cyclic;
124
125 std::shared_ptr<logic::Formula const> formula;
126
128
129 uint_fast64_t numberOfStates;
130
132
133 boost::container::flat_set<uint_fast64_t> nonParametricStates;
134
135 std::map<VariableType, std::vector<uint_fast64_t>> occuringStatesAtVariable;
136 std::vector<std::set<VariableType>> occuringVariablesAtState;
137 MonotonicityChecker<ValueType> monotonicityChecker;
138};
139} // namespace analysis
140} // namespace storm
141
142#endif // STORM_ORDEREXTENDER_H
Monotonicity
The results of monotonicity checking for a single Parameter Region.
void copyMinMax(std::shared_ptr< Order > orderOriginal, std::shared_ptr< Order > orderCopy)
std::vector< std::set< VariableType > > const & getVariablesOccuringAtState()
std::pair< uint_fast64_t, uint_fast64_t > getUnknownStates(std::shared_ptr< Order > order) const
void setMaxValuesInit(std::vector< ConstantType > &minValues)
void setMinValuesInit(std::vector< ConstantType > &minValues)
std::tuple< std::shared_ptr< Order >, uint_fast64_t, uint_fast64_t > extendOrder(std::shared_ptr< Order > order, storm::storage::ParameterRegion< ValueType > region, std::shared_ptr< MonotonicityResult< VariableType > > monRes=nullptr, std::shared_ptr< expressions::BinaryRelationExpression > assumption=nullptr)
Extends the order for the given region.
MonotonicityChecker< ValueType > & getMonotoncityChecker()
void setUnknownStates(std::shared_ptr< Order > order, uint_fast64_t state1, uint_fast64_t state2)
utility::parametric::VariableType< ValueType >::type VariableType
MonotonicityResult< VariableType >::Monotonicity Monotonicity
std::tuple< std::shared_ptr< Order >, uint_fast64_t, uint_fast64_t > toOrder(storage::ParameterRegion< ValueType > region, std::shared_ptr< MonotonicityResult< VariableType > > monRes=nullptr)
Creates an order based on the given formula.
void setMaxValues(std::shared_ptr< Order > order, std::vector< ConstantType > &maxValues)
void setMinMaxValues(std::shared_ptr< Order > order, std::vector< ConstantType > &minValues, std::vector< ConstantType > &maxValues)
void checkParOnStateMonRes(uint_fast64_t s, std::shared_ptr< Order > order, typename OrderExtender< ValueType, ConstantType >::VariableType param, std::shared_ptr< MonotonicityResult< VariableType > > monResult)
void setMinValues(std::shared_ptr< Order > order, std::vector< ConstantType > &minValues)
void initializeMinMaxValues(storage::ParameterRegion< ValueType > region)
bool isHope(std::shared_ptr< Order > order)
utility::parametric::CoefficientType< ValueType >::type CoefficientType
NodeComparison
Constants for comparison of nodes/states.
Definition Order.h:18
Base class for all sparse models.
Definition Model.h:33
A bit vector that is internally represented as a vector of 64-bit values.
Definition BitVector.h:18
A class that holds a possibly non-square matrix in the compressed row storage format.
LabParser.cpp.
Definition cli.cpp:18