Storm 1.11.1.1
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
MonotonicityBackend.cpp
Go to the documentation of this file.
2
6
7namespace storm::modelchecker {
8
9template<typename ParametricType>
11 STORM_LOG_ASSERT(storm::analysis::isMonotone(kind), "Monotonicity kind must be either increasing, decreasing or constant.");
12 globallyKnownMonotonicityInformation[parameter] = kind;
13}
14
15template<typename ParametricType>
18 annotation.globalMonotonicity = std::make_shared<storm::analysis::MonotonicityResult<VariableType>>();
19 bool allMonotone = true;
20 for (auto const& parameter : region.region.getVariables()) {
21 if (auto findRes = globallyKnownMonotonicityInformation.find(parameter); findRes != globallyKnownMonotonicityInformation.end()) {
22 annotation.globalMonotonicity->addMonotonicityResult(parameter, findRes->second);
23 annotation.globalMonotonicity->setDoneForVar(parameter);
24 } else {
25 allMonotone = false;
26 }
27 }
28 annotation.globalMonotonicity->setAllMonotonicity(allMonotone);
29 annotation.globalMonotonicity->setDone();
30 region.monotonicityAnnotation.data = annotation;
31}
32
33template<typename ParametricType>
35 // Nothing to do.
36 // Be aware of potential side effects since monotonicity annotations might be shared among sub-regions.
37}
38
39template<typename ParametricType>
43
44template<typename ParametricType>
48
49template<typename ParametricType>
53
54template<typename ParametricType>
55std::map<typename MonotonicityBackend<ParametricType>::VariableType, typename MonotonicityBackend<ParametricType>::MonotonicityKind>
57 std::map<VariableType, MonotonicityKind> result;
58 if (auto globalMonotonicity = region.monotonicityAnnotation.getGlobalMonotonicityResult(); globalMonotonicity.has_value()) {
59 for (auto const& parameter : region.region.getVariables()) {
60 if (auto monRes = globalMonotonicity->getMonotonicity(parameter); storm::analysis::isMonotone(monRes)) {
61 result.emplace(parameter, monRes);
62 }
63 }
64 }
65 return result;
66}
67
69
70} // 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