Storm 1.14.0.1
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
MonotonicityHelper.h
Go to the documentation of this file.
1#pragma once
2
3#include <map>
4
6
10
12
16
18
26
27namespace storm {
28namespace analysis {
29
30template<typename ValueType, typename ConstantType>
32 public:
37
43 std::shared_ptr<Order> order;
44 std::shared_ptr<MonotonicityResult<VariableType>> monotonicityResult;
45 std::vector<Assumption> assumptions;
46 };
47
60 MonotonicityHelper(Environment const& env, std::shared_ptr<models::sparse::Model<ValueType>> model,
61 std::vector<std::shared_ptr<logic::Formula const>> formulas, std::vector<storage::ParameterRegion<ValueType>> regions,
62 uint_fast64_t numberOfSamples = 0, double const& precision = 0.000001, bool dotOutput = false);
63
73
81 std::vector<ExpectedMonotonicityResult> checkMonotonicityInBuild(std::ostream& outfile, bool usePLA = false, std::string dotOutfileName = "dotOutput");
82
87 std::shared_ptr<LocalMonotonicityResult<VariableType>> createLocalMonotonicityResult(std::shared_ptr<Order> order,
89
90 private:
91 void createOrder();
92
93 void checkMonotonicityOnSamples(Environment const& env, std::shared_ptr<models::sparse::Dtmc<ValueType>> model, uint_fast64_t numberOfSamples);
94
95 void checkMonotonicityOnSamples(Environment const& env, std::shared_ptr<models::sparse::Mdp<ValueType>> model, uint_fast64_t numberOfSamples);
96
97 void extendOrderWithAssumptions(std::shared_ptr<Order> order, uint_fast64_t val1, uint_fast64_t val2, std::vector<Assumption> assumptions,
98 std::shared_ptr<MonotonicityResult<VariableType>> monRes);
99
100 std::shared_ptr<models::ModelBase> model;
101
102 std::vector<std::shared_ptr<logic::Formula const>> formulas;
103
104 bool dotOutput;
105
106 bool checkSamples;
107
108 bool onlyCheckOnOrder;
109
110 MonotonicityResult<VariableType> resultCheckOnSamples;
111
112 std::map<VariableType, std::vector<uint_fast64_t>> occuringStatesAtVariable;
113
114 std::map<std::shared_ptr<Order>, std::pair<std::shared_ptr<MonotonicityResult<VariableType>>, std::vector<Assumption>>> monResults;
115
116 std::unique_ptr<OrderExtender<ValueType, ConstantType>> extender;
117
118 ConstantType precision;
119
120 Region region;
121
123
124 std::unordered_map<ValueType, std::unordered_map<VariableType, ValueType>> derivatives;
125
126 // Environment used for all model checking calls.
127 Environment env;
128
130};
131} // namespace analysis
132} // namespace storm
static std::pair< bool, bool > checkDerivative(ValueType const &derivative, storage::ParameterRegion< ValueType > const &reg)
Checks if a derivative >=0 or/and <=0.
MonotonicityHelper(Environment const &env, std::shared_ptr< models::sparse::Model< ValueType > > model, std::vector< std::shared_ptr< logic::Formula const > > formulas, std::vector< storage::ParameterRegion< ValueType > > regions, uint_fast64_t numberOfSamples=0, double const &precision=0.000001, bool dotOutput=false)
Constructor of MonotonicityHelper.
std::vector< ExpectedMonotonicityResult > checkMonotonicityInBuild(std::ostream &outfile, bool usePLA=false, std::string dotOutfileName="dotOutput")
Builds Reachability Orders for the given model and simultaneously uses them to check for Monotonicity...
MonotonicityResult< VariableType >::Monotonicity Monotonicity
std::shared_ptr< LocalMonotonicityResult< VariableType > > createLocalMonotonicityResult(std::shared_ptr< Order > order, storage::ParameterRegion< ValueType > region)
Builds Reachability Orders for the given model and simultaneously uses them to check for Monotonicity...
storage::ParameterRegion< ValueType > Region
utility::parametric::VariableType< ValueType >::type VariableType
utility::parametric::CoefficientType< ValueType >::type CoefficientType
static std::pair< bool, bool > checkDerivative(ValueType derivative, storage::ParameterRegion< ValueType > reg)
Checks if a derivative >=0 or/and <=0.
storm::analysis::MonotonicityKind Monotonicity
This class represents a discrete-time Markov chain.
Definition Dtmc.h:16
This class represents a (discrete-time) Markov decision process.
Definition Mdp.h:16
Base class for all sparse models.
Definition Model.h:34
A class that holds a possibly non-square matrix in the compressed row storage format.
The result of the order-based monotonicity analysis for one reachability order: the order itself,...
std::shared_ptr< MonotonicityResult< VariableType > > monotonicityResult