Storm
A Modern Probabilistic Model Checker
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
RegionModelChecker.h
Go to the documentation of this file.
1#pragma once
2
3#include <memory>
4
13
16
17namespace storm {
18
19class Environment;
20
21namespace modelchecker {
22
23// TODO type names are inconsistent and all over the place
24template<typename ParametricType>
26 public:
29
31 virtual ~RegionModelChecker() = default;
32
33 virtual bool canHandle(std::shared_ptr<storm::models::ModelBase> parametricModel,
34 CheckTask<storm::logic::Formula, ParametricType> const& checkTask) const = 0;
35 virtual void specify(Environment const& env, std::shared_ptr<storm::models::ModelBase> parametricModel,
36 CheckTask<storm::logic::Formula, ParametricType> const& checkTask, bool generateRegionSplitEstimates,
37 bool allowModelSimplifications = true) = 0;
38
47 RegionResult const& initialResult = RegionResult::Unknown, bool sampleVerticesOfRegion = false,
48 std::shared_ptr<storm::analysis::LocalMonotonicityResult<VariableType>> localMonotonicityResult = nullptr) = 0;
49
56 std::unique_ptr<storm::modelchecker::RegionCheckResult<ParametricType>> analyzeRegions(
57 Environment const& env, std::vector<storm::storage::ParameterRegion<ParametricType>> const& regions,
58 std::vector<RegionResultHypothesis> const& hypotheses, bool sampleVerticesOfRegion = false);
59
60 virtual ParametricType getBoundAtInitState(Environment const& env, storm::storage::ParameterRegion<ParametricType> const& region,
61 storm::solver::OptimizationDirection const& dirForParameters);
62
72 std::unique_ptr<storm::modelchecker::RegionRefinementCheckResult<ParametricType>> performRegionRefinement(
73 Environment const& env, storm::storage::ParameterRegion<ParametricType> const& region, boost::optional<ParametricType> const& coverageThreshold,
74 boost::optional<uint64_t> depthThreshold = boost::none, RegionResultHypothesis const& hypothesis = RegionResultHypothesis::Unknown,
75 uint64_t monThresh = 0);
76
77 // TODO return type is not quite nice
78 // TODO consider returning v' as well
94 virtual std::pair<ParametricType, typename storm::storage::ParameterRegion<ParametricType>::Valuation> computeExtremalValue(
96 ParametricType const& precision, bool absolutePrecision, std::optional<storm::logic::Bound> const& boundInvariant = std::nullopt);
101 virtual bool verifyRegion(Environment const& env, storm::storage::ParameterRegion<ParametricType> const& region, storm::logic::Bound const& bound);
102
106 virtual bool isRegionSplitEstimateSupported() const;
107
112 virtual std::map<VariableType, double> getRegionSplitEstimate() const;
113
114 virtual std::shared_ptr<storm::analysis::Order> extendOrder(std::shared_ptr<storm::analysis::Order> order,
116
117 virtual void setConstantEntries(std::shared_ptr<storm::analysis::LocalMonotonicityResult<VariableType>> localMonotonicityResult);
118
119 bool isUseMonotonicitySet() const;
120 bool isUseBoundsSet();
121 bool isOnlyGlobalSet();
122
123 void setUseMonotonicity(bool monotonicity = true);
124 void setUseBounds(bool bounds = true);
125 void setUseOnlyGlobal(bool global = true);
126
130 virtual void setMaxSplitDimensions(uint64_t);
134 virtual void resetMaxSplitDimensions();
135
138 monotoneParameters);
139
140 private:
141 bool useMonotonicity = false;
142 bool useOnlyGlobal = false;
143 bool useBounds = false;
144
145 protected:
147 boost::optional<std::set<typename storm::storage::ParameterRegion<ParametricType>::VariableType>> monotoneIncrParameters;
148 boost::optional<std::set<typename storm::storage::ParameterRegion<ParametricType>::VariableType>> monotoneDecrParameters;
149
150 virtual void extendLocalMonotonicityResult(storm::storage::ParameterRegion<ParametricType> const& region, std::shared_ptr<storm::analysis::Order> order,
151 std::shared_ptr<storm::analysis::LocalMonotonicityResult<VariableType>> localMonotonicityResult);
152
154 storm::analysis::MonotonicityResult<VariableType>& monRes, bool splitForExtremum) const;
155};
156
157} // namespace modelchecker
158} // namespace storm
virtual void extendLocalMonotonicityResult(storm::storage::ParameterRegion< ParametricType > const &region, std::shared_ptr< storm::analysis::Order > order, std::shared_ptr< storm::analysis::LocalMonotonicityResult< VariableType > > localMonotonicityResult)
void setUseMonotonicity(bool monotonicity=true)
std::unique_ptr< storm::modelchecker::RegionRefinementCheckResult< ParametricType > > performRegionRefinement(Environment const &env, storm::storage::ParameterRegion< ParametricType > const &region, boost::optional< ParametricType > const &coverageThreshold, boost::optional< uint64_t > depthThreshold=boost::none, RegionResultHypothesis const &hypothesis=RegionResultHypothesis::Unknown, uint64_t monThresh=0)
Iteratively refines the region until the region analysis yields a conclusive result (AllSat or AllVio...
virtual void resetMaxSplitDimensions()
When splitting, split in every dimension.
virtual std::pair< ParametricType, typename storm::storage::ParameterRegion< ParametricType >::Valuation > computeExtremalValue(Environment const &env, storm::storage::ParameterRegion< ParametricType > const &region, storm::solver::OptimizationDirection const &dir, ParametricType const &precision, bool absolutePrecision, std::optional< storm::logic::Bound > const &boundInvariant=std::nullopt)
Finds the extremal value within the given region and with the given precision.
virtual bool verifyRegion(Environment const &env, storm::storage::ParameterRegion< ParametricType > const &region, storm::logic::Bound const &bound)
Checks whether the bound is satisfied on the complete region.
boost::optional< std::set< typename storm::storage::ParameterRegion< ParametricType >::VariableType > > monotoneIncrParameters
virtual std::shared_ptr< storm::analysis::Order > extendOrder(std::shared_ptr< storm::analysis::Order > order, storm::storage::ParameterRegion< ParametricType > region)
virtual void specify(Environment const &env, std::shared_ptr< storm::models::ModelBase > parametricModel, CheckTask< storm::logic::Formula, ParametricType > const &checkTask, bool generateRegionSplitEstimates, bool allowModelSimplifications=true)=0
virtual void setMaxSplitDimensions(uint64_t)
When splitting, split in at most this many dimensions.
virtual ParametricType getBoundAtInitState(Environment const &env, storm::storage::ParameterRegion< ParametricType > const &region, storm::solver::OptimizationDirection const &dirForParameters)
virtual bool isRegionSplitEstimateSupported() const
Returns true if region split estimation (a) was enabled when model and check task have been specified...
storm::storage::ParameterRegion< ParametricType >::CoefficientType CoefficientType
virtual bool canHandle(std::shared_ptr< storm::models::ModelBase > parametricModel, CheckTask< storm::logic::Formula, ParametricType > const &checkTask) const =0
virtual std::map< VariableType, double > getRegionSplitEstimate() const
Returns an estimate of the benefit of splitting the last checked region with respect to each paramete...
virtual RegionResult analyzeRegion(Environment const &env, storm::storage::ParameterRegion< ParametricType > const &region, RegionResultHypothesis const &hypothesis=RegionResultHypothesis::Unknown, RegionResult const &initialResult=RegionResult::Unknown, bool sampleVerticesOfRegion=false, std::shared_ptr< storm::analysis::LocalMonotonicityResult< VariableType > > localMonotonicityResult=nullptr)=0
Analyzes the given region.
boost::optional< std::set< typename storm::storage::ParameterRegion< ParametricType >::VariableType > > monotoneDecrParameters
virtual void setConstantEntries(std::shared_ptr< storm::analysis::LocalMonotonicityResult< VariableType > > localMonotonicityResult)
void setMonotoneParameters(std::pair< std::set< typename storm::storage::ParameterRegion< ParametricType >::VariableType >, std::set< typename storm::storage::ParameterRegion< ParametricType >::VariableType > > monotoneParameters)
std::unique_ptr< storm::modelchecker::RegionCheckResult< ParametricType > > analyzeRegions(Environment const &env, std::vector< storm::storage::ParameterRegion< ParametricType > > const &regions, std::vector< RegionResultHypothesis > const &hypotheses, bool sampleVerticesOfRegion=false)
Analyzes the given regions.
storm::storage::ParameterRegion< ParametricType >::VariableType VariableType
virtual void splitSmart(storm::storage::ParameterRegion< ParametricType > &region, std::vector< storm::storage::ParameterRegion< ParametricType > > &regionVector, storm::analysis::MonotonicityResult< VariableType > &monRes, bool splitForExtremum) const
storm::utility::parametric::CoefficientType< ParametricType >::type CoefficientType
storm::utility::parametric::VariableType< ParametricType >::type VariableType
RegionResult
The results for a single Parameter Region.
@ Unknown
the result is unknown
RegionResultHypothesis
hypothesis for the result for a single Parameter Region
LabParser.cpp.
Definition cli.cpp:18