#pragma once #include #include "storm/modelchecker/parametric/RegionCheckResult.h" #include "storm/modelchecker/parametric/SparseInstantiationModelChecker.h" #include "storm/modelchecker/parametric/SparseParameterLiftingModelChecker.h" #include "storm/modelchecker/CheckTask.h" #include "storm/storage/ParameterRegion.h" #include "storm/utility/Stopwatch.h" namespace storm { namespace modelchecker{ namespace parametric{ template class ParameterLifting { public: ParameterLifting(SparseModelType const& parametricModel); ~ParameterLifting() = default; void specifyFormula(CheckTask const& checkTask); /*! * Analyzes the given region by means of parameter lifting. * We first check whether there is one point in the region for which the property is satisfied/violated. * If the given initialResults already indicates that there is such a point, this step is skipped. * Then, we check whether ALL points in the region violate/satisfy the property * If this does not yield a conclusive result and if the given flag is true, we also sample the vertices of the region * */ RegionCheckResult analyzeRegion(storm::storage::ParameterRegion const& region, RegionCheckResult const& initialResult = RegionCheckResult::Unknown, bool sampleVerticesOfRegion = false) const; /*! * Iteratively refines the region until parameter lifting yields a conclusive result (AllSat or AllViolated). * The refinement stops as soon as the fraction of the area of the subregions with inconclusive result is less then the given threshold */ std::vector, RegionCheckResult>> performRegionRefinement(storm::storage::ParameterRegion const& region, typename storm::storage::ParameterRegion::CoefficientType const& threshold) const; SparseParameterLiftingModelChecker const& getParameterLiftingChecker() const; SparseInstantiationModelChecker const& getInstantiationChecker() const; static std::string visualizeResult(std::vector, RegionCheckResult>> const& result, storm::storage::ParameterRegion const& parameterSpace, typename storm::storage::ParameterRegion::VariableType const& x, typename storm::storage::ParameterRegion::VariableType const& y); private: SparseModelType const& getConsideredParametricModel() const; void initializeUnderlyingCheckers(); void simplifyParametricModel(CheckTask const& checkTask); SparseModelType const& parametricModel; std::unique_ptr> currentCheckTask; std::shared_ptr currentFormula; std::shared_ptr simplifiedModel; std::unique_ptr> parameterLiftingChecker; std::unique_ptr> instantiationChecker; mutable storm::utility::Stopwatch initializationStopwatch, instantiationCheckerStopwatch, parameterLiftingCheckerStopwatch; }; } //namespace parametric } //namespace modelchecker } //namespace storm