Storm 1.11.1.1
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
MonotonicityBackend.cpp
Go to the documentation of this file.
2
5
6namespace storm::modelchecker {
7
8template<typename ParametricType>
10 STORM_LOG_ASSERT(storm::analysis::isMonotone(kind), "Monotonicity kind must be either increasing, decreasing or constant.");
11 globallyKnownMonotonicityInformation[parameter] = kind;
12}
13
14template<typename ParametricType>
17 annotation.globalMonotonicity = std::make_shared<storm::analysis::MonotonicityResult<VariableType>>();
18 bool allMonotone = true;
19 for (auto const& parameter : region.region.getVariables()) {
20 if (auto findRes = globallyKnownMonotonicityInformation.find(parameter); findRes != globallyKnownMonotonicityInformation.end()) {
21 annotation.globalMonotonicity->addMonotonicityResult(parameter, findRes->second);
22 annotation.globalMonotonicity->setDoneForVar(parameter);
23 } else {
24 allMonotone = false;
25 }
26 }
27 annotation.globalMonotonicity->setAllMonotonicity(allMonotone);
28 annotation.globalMonotonicity->setDone();
29 region.monotonicityAnnotation.data = annotation;
30}
31
32template<typename ParametricType>
34 // Nothing to do.
35 // Be aware of potential side effects since monotonicity annotations might be shared among sub-regions.
36}
37
38template<typename ParametricType>
42
43template<typename ParametricType>
47
48template<typename ParametricType>
52
53template<typename ParametricType>
54std::map<typename MonotonicityBackend<ParametricType>::VariableType, typename MonotonicityBackend<ParametricType>::MonotonicityKind>
56 std::map<VariableType, MonotonicityKind> result;
57 if (auto globalMonotonicity = region.monotonicityAnnotation.getGlobalMonotonicityResult(); globalMonotonicity.has_value()) {
58 for (auto const& parameter : region.region.getVariables()) {
59 if (auto monRes = globalMonotonicity->getMonotonicity(parameter); storm::analysis::isMonotone(monRes)) {
60 result.emplace(parameter, monRes);
61 }
62 }
63 }
64 return result;
65}
66
68
69} // namespace storm::modelchecker
virtual void initializeMonotonicity(storm::Environment const &env, AnnotatedRegion< ParametricType > &region)
Initializes the monotonicity information for the given region.
virtual bool requiresInteractionWithRegionModelChecker() const
Returns true, if a region model checker needs to implement specific methods to properly use this back...
void setMonotoneParameter(VariableType const &parameter, MonotonicityKind const &kind)
Sets parameters that are assumed to be monotone throughout the analysis.
virtual bool recommendModelSimplifications() const
Returns whether additional model simplifications are recommended when using this backend.
virtual void updateMonotonicity(storm::Environment const &env, AnnotatedRegion< ParametricType > &region)
Updates the monotonicity information for the given region.
storm::utility::parametric::VariableType_t< ParametricType > VariableType
virtual void updateMonotonicityBeforeSplitting(storm::Environment const &env, AnnotatedRegion< ParametricType > &region)
Updates the monotonicity information for the given region right before splitting it.
virtual std::map< VariableType, MonotonicityKind > getOptimisticMonotonicityApproximation(AnnotatedRegion< ParametricType > const &region)
Returns an optimistic approximation of the monotonicity of the parameters in this region.
std::set< VariableType > const & getVariables() const
#define STORM_LOG_ASSERT(cond, message)
Definition macros.h:11
MonotonicityKind
The results of monotonicity checking for a single Parameter Region.
bool isMonotone(MonotonicityKind kind)
storm::modelchecker::MonotonicityAnnotation< ParametricType > monotonicityAnnotation
Whether the result is known through monotonicity.
Region const region
The subregions of this region.
std::shared_ptr< storm::analysis::MonotonicityResult< VariableType > > globalMonotonicity