Storm 1.14.0.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>
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;
43
47
48 virtual bool canHandle(std::shared_ptr<storm::models::ModelBase> parametricModel,
49 CheckTask<storm::logic::Formula, ParametricType> const& checkTask) const override;
50
51 virtual void specify(
52 Environment const& env, std::shared_ptr<storm::models::ModelBase> parametricModel, CheckTask<storm::logic::Formula, ParametricType> const& checkTask,
53 std::optional<RegionSplitEstimateKind> generateRegionSplitEstimates = std::nullopt,
54 std::shared_ptr<MonotonicityBackend<ParametricType>> monotonicityBackend = {}, bool allowModelSimplifications = true,
56
57 std::optional<storm::storage::Scheduler<ConstantType>> getCurrentMinScheduler();
58 std::optional<storm::storage::Scheduler<ConstantType>> getCurrentMaxScheduler();
59
61 CheckTask<storm::logic::Formula, ParametricType> const& checkTask) const override;
63 virtual std::vector<CoefficientType> obtainRegionSplitEstimates(std::set<VariableType> const& relevantParameters) const override;
64
66 CheckTask<storm::logic::Formula, ParametricType> const& checkTask) const override;
67
68 protected:
70 virtual void specifyUntilFormula(Environment const& env, CheckTask<storm::logic::UntilFormula, ConstantType> const& checkTask) override;
73
75 bool qualitative) override;
77 bool qualitative) override;
79 bool qualitative) override;
80
81 virtual std::vector<ExtendedConstantType> computeQuantitativeValues(Environment const& env, AnnotatedRegion<ParametricType>& region,
82 storm::solver::OptimizationDirection const& dirForParameters) override;
83
84 void computeStateValueDeltaRegionSplitEstimates(Environment const& env, std::vector<ConstantType> const& quantitativeResult,
85 std::vector<uint64_t> const& schedulerChoices,
87 storm::solver::OptimizationDirection const& dirForParameters);
88
89 virtual void reset() override;
90
91 private:
92 bool isOrderBasedMonotonicityBackend() const;
93 OrderBasedMonotonicityBackend<ParametricType, ConstantType>& getOrderBasedMonotonicityBackend();
94
95 bool isValueDeltaRegionSplitEstimates() const;
96
97 storm::storage::BitVector maybeStates;
98 std::vector<ExtendedConstantType> 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
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 > & getInstantiationCheckerVIO(Environment const &env, 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 std::vector< ExtendedConstantType > computeQuantitativeValues(Environment const &env, AnnotatedRegion< ParametricType > &region, storm::solver::OptimizationDirection const &dirForParameters) override
virtual void specifyBoundedUntilFormula(const CheckTask< storm::logic::BoundedUntilFormula, ConstantType > &checkTask) 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)
virtual storm::modelchecker::SparseInstantiationModelChecker< SparseModelType, ConstantType > & getInstantiationCheckerSAT(Environment const &env, bool qualitative) override
virtual storm::modelchecker::SparseInstantiationModelChecker< SparseModelType, ConstantType > & getInstantiationChecker(Environment const &env, bool qualitative) override
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 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, storm::pars::analysis::GraphPreservationStatus graphPreservationStatus=storm::pars::analysis::GraphPreservationStatus::GraphPreserving) override
virtual void specifyUntilFormula(Environment const &env, CheckTask< storm::logic::UntilFormula, ConstantType > const &checkTask) override
typename SparseParameterLiftingModelChecker< SparseModelType, ConstantType >::ExtendedConstantType ExtendedConstantType
Class to efficiently check a formula on a parametric model with different parameter instantiations.
storm::utility::ExtendedValueType< ConstantType > ExtendedConstantType
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::solver::MinMaxLinearEquationSolverFactory< storm::Interval, ConstantType >, storm::solver::MinMaxLinearEquationSolverFactory< ConstantType > > SolverFactoryType
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
GraphPreservationStatus
Describes to what extent a set of regions is known to be well-defined and to preserve the graph struc...
@ GraphPreserving
The regions are known (or assumed) to preserve the graph structure of the model.