Storm 2.0.0.3
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
19
27
28namespace storm {
29namespace analysis {
30
31template<typename ValueType, typename ConstantType>
33 public:
38
44 std::shared_ptr<Order> order;
45 std::shared_ptr<MonotonicityResult<VariableType>> monotonicityResult;
46 std::vector<Assumption> assumptions;
47 };
48
61 MonotonicityHelper(Environment const& env, std::shared_ptr<models::sparse::Model<ValueType>> model,
62 std::vector<std::shared_ptr<logic::Formula const>> formulas, std::vector<storage::ParameterRegion<ValueType>> regions,
63 uint_fast64_t numberOfSamples = 0, double const& precision = 0.000001, bool dotOutput = false);
64
74
82 std::vector<ExpectedMonotonicityResult> checkMonotonicityInBuild(std::ostream& outfile, bool usePLA = false, std::string dotOutfileName = "dotOutput");
83
88 std::shared_ptr<LocalMonotonicityResult<VariableType>> createLocalMonotonicityResult(std::shared_ptr<Order> order,
90
91 private:
92 void createOrder();
93
94 void checkMonotonicityOnSamples(Environment const& env, std::shared_ptr<models::sparse::Dtmc<ValueType>> model, uint_fast64_t numberOfSamples);
95
96 void checkMonotonicityOnSamples(Environment const& env, std::shared_ptr<models::sparse::Mdp<ValueType>> model, uint_fast64_t numberOfSamples);
97
98 void extendOrderWithAssumptions(std::shared_ptr<Order> order, uint_fast64_t val1, uint_fast64_t val2, std::vector<Assumption> assumptions,
99 std::shared_ptr<MonotonicityResult<VariableType>> monRes);
100
101 std::shared_ptr<models::ModelBase> model;
102
103 std::vector<std::shared_ptr<logic::Formula const>> formulas;
104
105 bool dotOutput;
106
107 bool checkSamples;
108
109 bool onlyCheckOnOrder;
110
111 MonotonicityResult<VariableType> resultCheckOnSamples;
112
113 std::map<VariableType, std::vector<uint_fast64_t>> occuringStatesAtVariable;
114
115 std::map<std::shared_ptr<Order>, std::pair<std::shared_ptr<MonotonicityResult<VariableType>>, std::vector<Assumption>>> monResults;
116
117 std::unique_ptr<OrderExtender<ValueType, ConstantType>> extender;
118
119 ConstantType precision;
120
121 Region region;
122
124
125 std::unordered_map<ValueType, std::unordered_map<VariableType, ValueType>> derivatives;
126
127 // Environment used for all model checking calls.
128 Environment env;
129
131};
132} // namespace analysis
133} // 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 contract of a DD backend.
The result of the order-based monotonicity analysis for one reachability order: the order itself,...
std::shared_ptr< MonotonicityResult< VariableType > > monotonicityResult