Storm 1.14.0.1
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
OrderExtender.h
Go to the documentation of this file.
1#pragma once
2
3#include <boost/container/flat_set.hpp>
9
15
16namespace storm {
17namespace analysis {
18template<typename ValueType, typename ConstantType>
20 public:
24
32 OrderExtender(std::shared_ptr<models::sparse::Model<ValueType>> model, std::shared_ptr<logic::Formula const> formula);
33
42
51 std::tuple<std::shared_ptr<Order>, uint_fast64_t, uint_fast64_t> toOrder(storage::ParameterRegion<ValueType> region,
52 std::shared_ptr<MonotonicityResult<VariableType>> monRes = nullptr);
53
63 std::tuple<std::shared_ptr<Order>, uint_fast64_t, uint_fast64_t> extendOrder(std::shared_ptr<Order> order,
65 std::shared_ptr<MonotonicityResult<VariableType>> monRes = nullptr,
66 std::shared_ptr<expressions::BinaryRelationExpression> assumption = nullptr);
67
68 void setMinMaxValues(std::shared_ptr<Order> order, std::vector<ConstantType>&& minValues, std::vector<ConstantType>&& maxValues);
69 void setMinValues(std::shared_ptr<Order> order, std::vector<ConstantType>&& minValues);
70 void setMaxValues(std::shared_ptr<Order> order, std::vector<ConstantType>&& maxValues);
71 void setMinValuesInit(std::vector<ConstantType>&& minValues);
72 void setMaxValuesInit(std::vector<ConstantType>&& minValues);
73
74 void setUnknownStates(std::shared_ptr<Order> order, uint_fast64_t state1, uint_fast64_t state2);
75
76 std::pair<uint_fast64_t, uint_fast64_t> getUnknownStates(std::shared_ptr<Order> order) const;
77 void setUnknownStates(std::shared_ptr<Order> orderOriginal, std::shared_ptr<Order> orderCopy);
78 void copyMinMax(std::shared_ptr<Order> orderOriginal, std::shared_ptr<Order> orderCopy);
80 void checkParOnStateMonRes(uint_fast64_t s, std::shared_ptr<Order> order, typename OrderExtender<ValueType, ConstantType>::VariableType param,
81 std::shared_ptr<MonotonicityResult<VariableType>> monResult);
82
83 bool isHope(std::shared_ptr<Order> order);
84
86 std::vector<std::set<VariableType>> const& getVariablesOccuringAtState();
87
88 private:
89 Order::NodeComparison addStatesBasedOnMinMax(std::shared_ptr<Order> order, uint_fast64_t state1, uint_fast64_t state2) const;
90 std::tuple<std::shared_ptr<Order>, uint_fast64_t, uint_fast64_t> extendOrder(std::shared_ptr<Order> order,
91 std::shared_ptr<MonotonicityResult<VariableType>> monRes,
92 std::shared_ptr<expressions::BinaryRelationExpression> assumption = nullptr);
93 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,
94 bool allowMerge);
95 std::pair<uint_fast64_t, uint_fast64_t> extendByBackwardReasoning(std::shared_ptr<Order> order, uint_fast64_t currentState,
96 std::vector<uint_fast64_t> const& successors, bool allowMerge);
97 std::pair<uint_fast64_t, uint_fast64_t> extendByForwardReasoning(std::shared_ptr<Order> order, uint_fast64_t currentState,
98 std::vector<uint_fast64_t> const& successors, bool allowMerge);
99 bool extendByAssumption(std::shared_ptr<Order> order, uint_fast64_t state1, uint_fast64_t state2);
100
101 void handleOneSuccessor(std::shared_ptr<Order> order, uint_fast64_t currentState, uint_fast64_t successor);
102 void handleAssumption(std::shared_ptr<Order> order, std::shared_ptr<expressions::BinaryRelationExpression> assumption) const;
103
104 std::pair<uint_fast64_t, bool> getNextState(std::shared_ptr<Order> order, uint_fast64_t stateNumber, bool done);
105 std::shared_ptr<Order> getBottomTopOrder();
106
107 std::shared_ptr<Order> bottomTopOrder = nullptr;
108
109 std::map<std::shared_ptr<Order>, std::vector<ConstantType>> minValues;
110 boost::optional<std::vector<ConstantType>> minValuesInit;
111 boost::optional<std::vector<ConstantType>> maxValuesInit;
112 std::map<std::shared_ptr<Order>, std::vector<ConstantType>> maxValues;
113
115 std::shared_ptr<models::sparse::Model<ValueType>> model;
116
117 std::map<uint_fast64_t, std::vector<uint_fast64_t>> stateMap;
118 std::map<std::shared_ptr<Order>, std::pair<uint_fast64_t, uint_fast64_t>> unknownStatesMap;
119
120 std::map<std::shared_ptr<Order>, bool> usePLA;
121 std::map<std::shared_ptr<Order>, bool> continueExtending;
122 bool cyclic;
123
124 std::shared_ptr<logic::Formula const> formula;
125
127
128 uint_fast64_t numberOfStates;
129
131
132 boost::container::flat_set<uint_fast64_t> nonParametricStates;
133
134 std::map<VariableType, std::vector<uint_fast64_t>> occuringStatesAtVariable;
135 std::vector<std::set<VariableType>> occuringVariablesAtState;
136 MonotonicityChecker<ValueType> monotonicityChecker;
137};
138} // namespace analysis
139} // namespace storm
storm::analysis::MonotonicityKind Monotonicity
void copyMinMax(std::shared_ptr< Order > orderOriginal, std::shared_ptr< Order > orderCopy)
void setMaxValuesInit(std::vector< ConstantType > &&minValues)
std::vector< std::set< VariableType > > const & getVariablesOccuringAtState()
std::pair< uint_fast64_t, uint_fast64_t > getUnknownStates(std::shared_ptr< Order > order) const
void setMaxValues(std::shared_ptr< Order > order, std::vector< ConstantType > &&maxValues)
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 setMinValues(std::shared_ptr< Order > order, std::vector< ConstantType > &&minValues)
void setMinValuesInit(std::vector< ConstantType > &&minValues)
void setUnknownStates(std::shared_ptr< Order > order, uint_fast64_t state1, uint_fast64_t state2)
OrderExtender(std::shared_ptr< models::sparse::Model< ValueType > > model, std::shared_ptr< logic::Formula const > formula)
Constructs a new OrderExtender.
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 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 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:30
A bit vector that is internally represented as a vector of 64-bit values.
Definition BitVector.h:16
A class that holds a possibly non-square matrix in the compressed row storage format.