Storm 1.11.1.1
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
AnnotatedRegion.cpp
Go to the documentation of this file.
2
3namespace storm::modelchecker {
4
5template<typename ParametricType>
7 // Intentionally left empty
8}
9
10template<typename ParametricType>
12 for (auto& r : subRegions) {
14 r.result = result;
16 r.result == storm::modelchecker::RegionResult::Unknown && r.region.contains(region.getCenterPoint())) {
19 }
20 if (r.refinementDepth == 0) {
21 r.refinementDepth = refinementDepth + 1;
22 }
23 r.monotonicityAnnotation =
24 monotonicityAnnotation; // Potentially shared for all subregions! Creating actual copies is handled via the monotonicity backend
25 r.knownLowerValueBound &= knownLowerValueBound;
26 r.knownUpperValueBound &= knownUpperValueBound;
27 }
28 if (allowDeleteAnnotationsOfThis) {
29 // Delete annotations that are memory intensive
30 monotonicityAnnotation = {};
31 }
32}
33
34template<typename ParametricType>
35void AnnotatedRegion<ParametricType>::splitAndPropagate(typename Region::Valuation const& splittingPoint, std::set<VariableType> const& consideredVariables,
36 std::set<VariableType> const& discreteVariables, bool allowDeleteAnnotationsOfThis) {
37 std::vector<storm::storage::ParameterRegion<ParametricType>> subRegionsWithoutAnnotations;
38 region.split(splittingPoint, subRegionsWithoutAnnotations, consideredVariables, discreteVariables);
39 subRegions.reserve(subRegionsWithoutAnnotations.size());
40 for (auto& newRegion : subRegionsWithoutAnnotations) {
41 subRegions.emplace_back(newRegion);
42 }
43 propagateAnnotationsToSubregions(allowDeleteAnnotationsOfThis);
44}
45
46template<typename ParametricType>
47void AnnotatedRegion<ParametricType>::splitLeafNodeAtCenter(std::set<VariableType> const& splittingVariables, std::set<VariableType> const& discreteVariables,
48 bool allowDeleteAnnotationsOfThis) {
49 STORM_LOG_ASSERT(subRegions.empty(), "Region assumed to be a leaf.");
50 splitAndPropagate(region.getCenterPoint(), splittingVariables, discreteVariables, allowDeleteAnnotationsOfThis);
51}
52
53template<typename ParametricType>
55 for (auto& child : subRegions) {
56 child.postOrderTraverseSubRegions(visitor);
57 }
58 visitor(*this);
59}
60
61template<typename ParametricType>
63 visitor(*this);
64 for (auto& child : subRegions) {
65 child.preOrderTraverseSubRegions(visitor);
66 }
67}
68
69template<typename ParametricType>
71 uint64_t max{0u};
72 for (auto const& child : subRegions) {
73 max = std::max(max, child.getMaxDepthOfSubRegions() + 1);
74 }
75 return max;
76}
77
78template<typename ParametricType>
80 if (minimize(dir)) {
81 return knownLowerValueBound &= newValue;
82 } else {
83 return knownUpperValueBound &= newValue;
84 }
85}
86
88
89} // namespace storm::modelchecker
storm::utility::parametric::Valuation< ParametricType > Valuation
void split(Valuation const &splittingPoint, std::vector< ParameterRegion< ParametricType > > &regionVector) const
Splits the region at the given point and inserts the resulting subregions at the end of the given vec...
#define STORM_LOG_ASSERT(cond, message)
Definition macros.h:11
@ CenterSat
the formula is satisfied for the parameter Valuation that corresponds to the center point of the regi...
@ AllSat
the formula is satisfied for all well-defined parameters in the given region
@ AllViolated
the formula is violated for all well-defined parameters in the given region
@ Unknown
the result is unknown
@ CenterViolated
the formula is violated for the parameter Valuation that corresponds to the center point of the regio...
@ ExistsSat
the formula is satisfied for at least one parameter evaluation that lies in the given region
@ ExistsViolated
the formula is violated for at least one parameter evaluation that lies in the given region
void propagateAnnotationsToSubregions(bool allowDeleteAnnotationsOfThis)
void postOrderTraverseSubRegions(std::function< void(AnnotatedRegion< ParametricType > &)> const &visitor)
void preOrderTraverseSubRegions(std::function< void(AnnotatedRegion< ParametricType > &)> const &visitor)
typename Region::CoefficientType CoefficientType
void splitLeafNodeAtCenter(std::set< VariableType > const &splittingVariables, std::set< VariableType > const &discreteVariables, bool allowDeleteAnnotationsOfThis)
bool updateValueBound(CoefficientType const &newValue, storm::OptimizationDirection dir)
what is known about this region in terms of monotonicity
void splitAndPropagate(typename Region::Valuation const &splittingPoint, std::set< VariableType > const &consideredVariables, std::set< VariableType > const &discreteVariables, bool allowDeleteAnnotationsOfThis)