Storm 1.11.1.1
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
AnnotatedRegion.cpp
Go to the documentation of this file.
2
4
5namespace storm::modelchecker {
6
7template<typename ParametricType>
9 // Intentionally left empty
10}
11
12template<typename ParametricType>
14 for (auto& r : subRegions) {
16 r.result = result;
18 r.result == storm::modelchecker::RegionResult::Unknown && r.region.contains(region.getCenterPoint())) {
21 }
22 if (r.refinementDepth == 0) {
23 r.refinementDepth = refinementDepth + 1;
24 }
25 r.monotonicityAnnotation =
26 monotonicityAnnotation; // Potentially shared for all subregions! Creating actual copies is handled via the monotonicity backend
27 r.knownLowerValueBound &= knownLowerValueBound;
28 r.knownUpperValueBound &= knownUpperValueBound;
29 }
30 if (allowDeleteAnnotationsOfThis) {
31 // Delete annotations that are memory intensive
32 monotonicityAnnotation = {};
33 }
34}
35
36template<typename ParametricType>
37void AnnotatedRegion<ParametricType>::splitAndPropagate(typename Region::Valuation const& splittingPoint, std::set<VariableType> const& consideredVariables,
38 std::set<VariableType> const& discreteVariables, bool allowDeleteAnnotationsOfThis) {
39 std::vector<storm::storage::ParameterRegion<ParametricType>> subRegionsWithoutAnnotations;
40 region.split(splittingPoint, subRegionsWithoutAnnotations, consideredVariables, discreteVariables);
41 subRegions.reserve(subRegionsWithoutAnnotations.size());
42 for (auto& newRegion : subRegionsWithoutAnnotations) {
43 subRegions.emplace_back(newRegion);
44 }
45 propagateAnnotationsToSubregions(allowDeleteAnnotationsOfThis);
46}
47
48template<typename ParametricType>
49void AnnotatedRegion<ParametricType>::splitLeafNodeAtCenter(std::set<VariableType> const& splittingVariables, std::set<VariableType> const& discreteVariables,
50 bool allowDeleteAnnotationsOfThis) {
51 STORM_LOG_ASSERT(subRegions.empty(), "Region assumed to be a leaf.");
52 splitAndPropagate(region.getCenterPoint(), splittingVariables, discreteVariables, allowDeleteAnnotationsOfThis);
53}
54
55template<typename ParametricType>
57 for (auto& child : subRegions) {
58 child.postOrderTraverseSubRegions(visitor);
59 }
60 visitor(*this);
61}
62
63template<typename ParametricType>
65 visitor(*this);
66 for (auto& child : subRegions) {
67 child.preOrderTraverseSubRegions(visitor);
68 }
69}
70
71template<typename ParametricType>
73 uint64_t max{0u};
74 for (auto const& child : subRegions) {
75 max = std::max(max, child.getMaxDepthOfSubRegions() + 1);
76 }
77 return max;
78}
79
80template<typename ParametricType>
82 if (minimize(dir)) {
83 return knownLowerValueBound &= newValue;
84 } else {
85 return knownUpperValueBound &= newValue;
86 }
87}
88
90
91} // 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)