Storm 1.11.1.1
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
SparseDtmcParameterLiftingModelChecker.h
Go to the documentation of this file.
1#pragma once
2
3#include <memory>
4#include <optional>
5#include <vector>
6
16
17namespace storm {
18namespace modelchecker {
19
20template<typename ParametricType, typename ConstantType>
21class OrderBasedMonotonicityBackend;
22
23template<typename ConstantType, bool Robust>
24using SolverFactoryType = std::conditional_t<Robust, storm::solver::MinMaxLinearEquationSolverFactory<storm::Interval, ConstantType>,
26
27template<typename ConstantType, bool Robust>
28using GeneralSolverFactoryType = std::conditional_t<Robust, storm::solver::GeneralMinMaxLinearEquationSolverFactory<storm::Interval, ConstantType>,
30
31template<typename ParametricType, typename ConstantType, bool Robust>
32using ParameterLifterType = std::conditional_t<Robust, storm::transformer::RobustParameterLifter<ParametricType, ConstantType>,
34
35template<typename SparseModelType, typename ConstantType, bool Robust = false>
37 public:
38 using ParametricType = typename SparseModelType::ValueType;
42
46
47 virtual bool canHandle(std::shared_ptr<storm::models::ModelBase> parametricModel,
48 CheckTask<storm::logic::Formula, ParametricType> const& checkTask) const override;
49
50 virtual void specify(Environment const& env, std::shared_ptr<storm::models::ModelBase> parametricModel,
52 std::optional<RegionSplitEstimateKind> generateRegionSplitEstimates = std::nullopt,
53 std::shared_ptr<MonotonicityBackend<ParametricType>> monotonicityBackend = {}, bool allowModelSimplifications = true,
54 bool graphPreserving = true) override;
55
56 std::optional<storm::storage::Scheduler<ConstantType>> getCurrentMinScheduler();
57 std::optional<storm::storage::Scheduler<ConstantType>> getCurrentMaxScheduler();
58
60 CheckTask<storm::logic::Formula, ParametricType> const& checkTask) const override;
62 virtual std::vector<CoefficientType> obtainRegionSplitEstimates(std::set<VariableType> const& relevantParameters) const override;
63
65 CheckTask<storm::logic::Formula, ParametricType> const& checkTask) const override;
66
67 protected:
69 virtual void specifyUntilFormula(Environment const& env, CheckTask<storm::logic::UntilFormula, ConstantType> const& checkTask) override;
72
76
77 virtual std::vector<ConstantType> computeQuantitativeValues(Environment const& env, AnnotatedRegion<ParametricType>& region,
78 storm::solver::OptimizationDirection const& dirForParameters) override;
79
80 void computeStateValueDeltaRegionSplitEstimates(Environment const& env, std::vector<ConstantType> const& quantitativeResult,
81 std::vector<uint64_t> const& schedulerChoices,
83 storm::solver::OptimizationDirection const& dirForParameters);
84
85 virtual void reset() override;
86
87 private:
88 void computeSchedulerDeltaSplitEstimates(std::vector<ConstantType> const& quantitativeResult, std::vector<uint64_t> const& schedulerChoices,
90 storm::solver::OptimizationDirection const& dirForParameters);
91
92 bool isOrderBasedMonotonicityBackend() const;
93 OrderBasedMonotonicityBackend<ParametricType, ConstantType>& getOrderBasedMonotonicityBackend();
94
95 bool isValueDeltaRegionSplitEstimates() const;
96
97 storm::storage::BitVector maybeStates;
98 std::vector<ConstantType> resultsForNonMaybeStates;
99 std::optional<uint64_t> stepBound;
100
101 std::unique_ptr<storm::modelchecker::SparseDtmcInstantiationModelChecker<SparseModelType, ConstantType>> instantiationChecker;
102 std::unique_ptr<storm::modelchecker::SparseDtmcInstantiationModelChecker<SparseModelType, ConstantType>> instantiationCheckerSAT;
103 std::unique_ptr<storm::modelchecker::SparseDtmcInstantiationModelChecker<SparseModelType, ConstantType>> instantiationCheckerVIO;
104
105 std::unique_ptr<storm::derivative::SparseDerivativeInstantiationModelChecker<ParametricType, ConstantType>> derivativeChecker;
106 std::unique_ptr<CheckTask<storm::logic::Formula, ParametricType>> currentCheckTaskNoBound;
107 std::shared_ptr<storm::logic::Formula const> currentFormulaNoBound;
108
109 std::unique_ptr<ParameterLifterType<ParametricType, ConstantType, Robust>> parameterLifter;
110 std::unique_ptr<SolverFactoryType<ConstantType, Robust>> solverFactory;
111 bool solvingRequiresUpperRewardBounds;
112
113 bool graphPreserving;
114
115 // Results from the most recent solver call.
116 std::optional<std::vector<uint64_t>> minSchedChoices, maxSchedChoices;
117 std::vector<ConstantType> x;
118 std::optional<ConstantType> lowerResultBound, upperResultBound;
119
120 std::map<VariableType, ConstantType> cachedRegionSplitEstimates;
121};
122} // namespace modelchecker
123} // namespace storm
std::shared_ptr< MonotonicityBackend< SparseModelType::ValueType > > monotonicityBackend
storm::storage::ParameterRegion< ParametricType >::CoefficientType CoefficientType
storm::storage::ParameterRegion< ParametricType >::Valuation Valuation
storm::storage::ParameterRegion< ParametricType >::VariableType VariableType
std::optional< storm::storage::Scheduler< ConstantType > > getCurrentMinScheduler()
virtual bool isRegionSplitEstimateKindSupported(RegionSplitEstimateKind kind, CheckTask< storm::logic::Formula, ParametricType > const &checkTask) const override
typename RegionModelChecker< ParametricType >::CoefficientType CoefficientType
virtual std::vector< CoefficientType > obtainRegionSplitEstimates(std::set< VariableType > const &relevantParameters) const override
Returns an estimate of the benefit of splitting the last checked region with respect to each of the g...
virtual storm::modelchecker::SparseInstantiationModelChecker< SparseModelType, ConstantType > & getInstantiationCheckerSAT(bool qualitative) override
virtual RegionSplitEstimateKind getDefaultRegionSplitEstimateKind(CheckTask< storm::logic::Formula, ParametricType > const &checkTask) const override
typename RegionModelChecker< ParametricType >::VariableType VariableType
virtual bool canHandle(std::shared_ptr< storm::models::ModelBase > parametricModel, CheckTask< storm::logic::Formula, ParametricType > const &checkTask) const override
virtual storm::modelchecker::SparseInstantiationModelChecker< SparseModelType, ConstantType > & getInstantiationCheckerVIO(bool qualitative) override
virtual void specify(Environment const &env, std::shared_ptr< storm::models::ModelBase > parametricModel, CheckTask< storm::logic::Formula, ParametricType > const &checkTask, std::optional< RegionSplitEstimateKind > generateRegionSplitEstimates=std::nullopt, std::shared_ptr< MonotonicityBackend< ParametricType > > monotonicityBackend={}, bool allowModelSimplifications=true, bool graphPreserving=true) override
virtual void specifyBoundedUntilFormula(const CheckTask< storm::logic::BoundedUntilFormula, ConstantType > &checkTask) override
virtual std::vector< ConstantType > computeQuantitativeValues(Environment const &env, AnnotatedRegion< ParametricType > &region, storm::solver::OptimizationDirection const &dirForParameters) override
virtual void specifyCumulativeRewardFormula(const CheckTask< storm::logic::CumulativeRewardFormula, ConstantType > &checkTask) override
void computeStateValueDeltaRegionSplitEstimates(Environment const &env, std::vector< ConstantType > const &quantitativeResult, std::vector< uint64_t > const &schedulerChoices, storm::storage::ParameterRegion< ParametricType > const &region, storm::solver::OptimizationDirection const &dirForParameters)
std::optional< storm::storage::Scheduler< ConstantType > > getCurrentMaxScheduler()
virtual void specifyReachabilityRewardFormula(Environment const &env, CheckTask< storm::logic::EventuallyFormula, ConstantType > const &checkTask) override
typename RegionModelChecker< ParametricType >::Valuation Valuation
virtual bool isMonotonicitySupported(MonotonicityBackend< ParametricType > const &backend, CheckTask< storm::logic::Formula, ParametricType > const &checkTask) const override
Returns whether this region model checker can work together with the given monotonicity backend.
virtual storm::modelchecker::SparseInstantiationModelChecker< SparseModelType, ConstantType > & getInstantiationChecker(bool qualitative) override
virtual void specifyUntilFormula(Environment const &env, CheckTask< storm::logic::UntilFormula, ConstantType > const &checkTask) override
Class to efficiently check a formula on a parametric model with different parameter instantiations.
Class to approximately check a formula on a parametric model for all parameter valuations within a re...
A bit vector that is internally represented as a vector of 64-bit values.
Definition BitVector.h:16
This class lifts parameter choices to nondeterminism: For each row in the given matrix that considerd...
std::conditional_t< Robust, storm::transformer::RobustParameterLifter< ParametricType, ConstantType >, storm::transformer::ParameterLifter< ParametricType, ConstantType > > ParameterLifterType
std::conditional_t< Robust, storm::solver::GeneralMinMaxLinearEquationSolverFactory< storm::Interval, ConstantType >, storm::solver::GeneralMinMaxLinearEquationSolverFactory< ConstantType > > GeneralSolverFactoryType
std::conditional_t< Robust, storm::solver::MinMaxLinearEquationSolverFactory< storm::Interval, ConstantType >, storm::solver::MinMaxLinearEquationSolverFactory< ConstantType > > SolverFactoryType
LabParser.cpp.