Storm
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
region.h
Go to the documentation of this file.
1#pragma once
2
3#include <boost/optional.hpp>
4#include <memory>
5#include <set>
6#include <string>
7#include <vector>
8
21
23
29#include "storm/io/file.h"
31
32namespace storm {
33
34namespace api {
39
40 explicit MonotonicitySetting(bool useMonotonicity = false, bool useOnlyGlobalMonotonicity = false, bool useBoundsFromPLA = false) {
41 this->useMonotonicity = useMonotonicity;
42 this->useOnlyGlobalMonotonicity = useOnlyGlobalMonotonicity;
43 this->useBoundsFromPLA = useBoundsFromPLA;
44 }
45};
46
47template<typename ValueType>
48std::vector<storm::storage::ParameterRegion<ValueType>> parseRegions(
49 std::string const& inputString, std::set<typename storm::storage::ParameterRegion<ValueType>::VariableType> const& consideredVariables) {
50 // If the given input string looks like a file (containing a dot and there exists a file with that name),
51 // we try to parse it as a file, otherwise we assume it's a region string.
52 if (inputString.find(".") != std::string::npos && storm::io::fileExistsAndIsReadable(inputString)) {
54 } else {
55 return storm::parser::ParameterRegionParser<ValueType>().parseMultipleRegions(inputString, consideredVariables);
56 }
57}
58
59template<typename ValueType>
61 std::string const& inputString, std::set<typename storm::storage::ParameterRegion<ValueType>::VariableType> const& consideredVariables) {
62 return storm::parser::ParameterRegionParser<ValueType>().createRegion(inputString, consideredVariables);
63}
64
65template<typename ValueType>
66std::vector<storm::storage::ParameterRegion<ValueType>> parseRegions(std::string const& inputString, storm::models::ModelBase const& model) {
67 std::set<typename storm::storage::ParameterRegion<ValueType>::VariableType> modelParameters;
68 if (model.isSparseModel()) {
69 auto const& sparseModel = dynamic_cast<storm::models::sparse::Model<ValueType> const&>(model);
70 modelParameters = storm::models::sparse::getProbabilityParameters(sparseModel);
71 auto rewParameters = storm::models::sparse::getRewardParameters(sparseModel);
72 modelParameters.insert(rewParameters.begin(), rewParameters.end());
73 } else {
74 STORM_LOG_THROW(false, storm::exceptions::NotSupportedException, "Retrieving model parameters is not supported for the given model type.");
75 }
76 return parseRegions<ValueType>(inputString, modelParameters);
77}
78
79template<typename ValueType>
80std::vector<storm::storage::ParameterRegion<ValueType>> createRegion(std::string const& inputString, storm::models::ModelBase const& model) {
81 std::set<typename storm::storage::ParameterRegion<ValueType>::VariableType> modelParameters;
82 if (model.isSparseModel()) {
83 auto const& sparseModel = dynamic_cast<storm::models::sparse::Model<ValueType> const&>(model);
84 modelParameters = storm::models::sparse::getProbabilityParameters(sparseModel);
85 auto rewParameters = storm::models::sparse::getRewardParameters(sparseModel);
86 modelParameters.insert(rewParameters.begin(), rewParameters.end());
87 } else {
88 STORM_LOG_THROW(false, storm::exceptions::NotSupportedException, "Retrieving model parameters is not supported for the given model type.");
89 }
90 return std::vector<storm::storage::ParameterRegion<ValueType>>({createRegion<ValueType>(inputString, modelParameters)});
91}
92
93template<typename ValueType>
95 std::set<typename storm::storage::ParameterRegion<ValueType>::VariableType> const& consideredVariables) {
96 // Handle the "empty region" case
97 if (inputString == "" && consideredVariables.empty()) {
99 }
100
101 auto res = parseRegions<ValueType>(inputString, consideredVariables);
102 STORM_LOG_THROW(res.size() == 1, storm::exceptions::InvalidOperationException, "Parsed " << res.size() << " regions but exactly one was expected.");
103 return res.front();
104}
105
106template<typename ValueType>
108 // Handle the "empty region" case
109 if (inputString == "" && !model.hasParameters()) {
111 }
112
113 auto res = parseRegions<ValueType>(inputString, model);
114 STORM_LOG_THROW(res.size() == 1, storm::exceptions::InvalidOperationException, "Parsed " << res.size() << " regions but exactly one was expected.");
115 return res.front();
116}
117
118template<typename ValueType>
119std::pair<std::set<typename storm::storage::ParameterRegion<ValueType>::VariableType>,
120 std::set<typename storm::storage::ParameterRegion<ValueType>::VariableType>>
121parseMonotoneParameters(std::string const& fileName, std::shared_ptr<storm::models::sparse::Model<ValueType>> const& model) {
122 std::set<typename storm::storage::ParameterRegion<ValueType>::VariableType> modelParameters;
123 modelParameters = storm::models::sparse::getProbabilityParameters(*model);
124 auto rewParameters = storm::models::sparse::getRewardParameters(*model);
125 modelParameters.insert(rewParameters.begin(), rewParameters.end());
126 return std::move(storm::parser::MonotonicityParser<typename storm::storage::ParameterRegion<ValueType>::VariableType>().parseMonotoneVariablesFromFile(
127 fileName, modelParameters));
128}
129
130template<typename ParametricType, typename ConstantType>
131std::shared_ptr<storm::modelchecker::RegionModelChecker<ParametricType>> initializeParameterLiftingRegionModelChecker(
132 Environment const& env, std::shared_ptr<storm::models::sparse::Model<ParametricType>> const& model,
133 storm::modelchecker::CheckTask<storm::logic::Formula, ParametricType> const& task, bool generateSplitEstimates = false,
134 bool allowModelSimplification = true, bool preconditionsValidatedManually = false, MonotonicitySetting monotonicitySetting = MonotonicitySetting(),
135 boost::optional<std::pair<std::set<typename storm::storage::ParameterRegion<ParametricType>::VariableType>,
137 monotoneParameters = boost::none) {
139 "Could not validate whether parameter lifting is applicable. Please validate manually...");
141 !(allowModelSimplification && monotonicitySetting.useMonotonicity),
142 "Allowing model simplification when using monotonicity is not useful, as for monotonicity checking model simplification is done as preprocessing");
143 STORM_LOG_WARN_COND(!(monotoneParameters && !monotonicitySetting.useMonotonicity),
144 "Setting monotone parameters without setting monotonicity usage doesn't work");
145
146 std::shared_ptr<storm::models::sparse::Model<ParametricType>> consideredModel = model;
147
148 // Treat continuous time models
149 if (consideredModel->isOfType(storm::models::ModelType::Ctmc) || consideredModel->isOfType(storm::models::ModelType::MarkovAutomaton)) {
150 STORM_LOG_WARN_COND(!monotonicitySetting.useMonotonicity,
151 "Usage of monotonicity not supported for this type of model, continuing without montonicity checking");
152 STORM_LOG_WARN("Parameter lifting not supported for continuous time models. Transforming continuous model to discrete model...");
153 std::vector<std::shared_ptr<storm::logic::Formula const>> taskFormulaAsVector{task.getFormula().asSharedPointer()};
154 consideredModel = storm::api::transformContinuousToDiscreteTimeSparseModel(consideredModel, taskFormulaAsVector).first;
155 STORM_LOG_THROW(consideredModel->isOfType(storm::models::ModelType::Dtmc) || consideredModel->isOfType(storm::models::ModelType::Mdp),
156 storm::exceptions::UnexpectedException, "Transformation to discrete time model has failed.");
157 }
158
159 // Obtain the region model checker
160 std::shared_ptr<storm::modelchecker::RegionModelChecker<ParametricType>> checker;
161 if (consideredModel->isOfType(storm::models::ModelType::Dtmc)) {
162 checker = std::make_shared<storm::modelchecker::SparseDtmcParameterLiftingModelChecker<storm::models::sparse::Dtmc<ParametricType>, ConstantType>>();
163 checker->setUseMonotonicity(monotonicitySetting.useMonotonicity);
164 checker->setUseOnlyGlobal(monotonicitySetting.useOnlyGlobalMonotonicity);
165 checker->setUseBounds(monotonicitySetting.useBoundsFromPLA);
166 if (monotonicitySetting.useMonotonicity && monotoneParameters) {
167 checker->setMonotoneParameters(monotoneParameters.get());
168 }
169 } else if (consideredModel->isOfType(storm::models::ModelType::Mdp)) {
170 STORM_LOG_WARN_COND(!monotonicitySetting.useMonotonicity,
171 "Usage of monotonicity not supported for this type of model, continuing without montonicity checking");
172 checker = std::make_shared<storm::modelchecker::SparseMdpParameterLiftingModelChecker<storm::models::sparse::Mdp<ParametricType>, ConstantType>>();
173 } else {
174 STORM_LOG_THROW(false, storm::exceptions::InvalidOperationException, "Unable to perform parameterLifting on the provided model type.");
175 }
176
177 checker->specify(env, consideredModel, task, generateSplitEstimates, allowModelSimplification);
178
179 return checker;
180}
181
182template<typename ParametricType, typename ImpreciseType, typename PreciseType>
183std::shared_ptr<storm::modelchecker::RegionModelChecker<ParametricType>> initializeValidatingRegionModelChecker(
184 Environment const& env, std::shared_ptr<storm::models::sparse::Model<ParametricType>> const& model,
185 storm::modelchecker::CheckTask<storm::logic::Formula, ParametricType> const& task, bool generateSplitEstimates = false,
186 bool allowModelSimplification = true) {
188 "Could not validate whether parameter lifting is applicable. Please validate manually...");
189
190 std::shared_ptr<storm::models::sparse::Model<ParametricType>> consideredModel = model;
191
192 // Treat continuous time models
193 if (consideredModel->isOfType(storm::models::ModelType::Ctmc) || consideredModel->isOfType(storm::models::ModelType::MarkovAutomaton)) {
194 STORM_LOG_WARN("Parameter lifting not supported for continuous time models. Transforming continuous model to discrete model...");
195 std::vector<std::shared_ptr<storm::logic::Formula const>> taskFormulaAsVector{task.getFormula().asSharedPointer()};
196 consideredModel = storm::api::transformContinuousToDiscreteTimeSparseModel(consideredModel, taskFormulaAsVector).first;
197 STORM_LOG_THROW(consideredModel->isOfType(storm::models::ModelType::Dtmc) || consideredModel->isOfType(storm::models::ModelType::Mdp),
198 storm::exceptions::UnexpectedException, "Transformation to discrete time model has failed.");
199 }
200
201 // Obtain the region model checker
202 std::shared_ptr<storm::modelchecker::RegionModelChecker<ParametricType>> checker;
203 if (consideredModel->isOfType(storm::models::ModelType::Dtmc)) {
204 checker = std::make_shared<
206 } else if (consideredModel->isOfType(storm::models::ModelType::Mdp)) {
207 checker = std::make_shared<
209 } else {
210 STORM_LOG_THROW(false, storm::exceptions::InvalidOperationException, "Unable to perform parameterLifting on the provided model type.");
211 }
212
213 checker->specify(env, consideredModel, task, generateSplitEstimates, allowModelSimplification);
214 return checker;
215}
216
217template<typename ValueType>
218std::shared_ptr<storm::modelchecker::RegionModelChecker<ValueType>> initializeRegionModelChecker(
219 Environment const& env, std::shared_ptr<storm::models::sparse::Model<ValueType>> const& model,
221 bool generateSplitEstimates = false, bool allowModelSimplification = true, bool preconditionsValidated = false,
222 MonotonicitySetting monotonicitySetting = MonotonicitySetting(),
223 boost::optional<std::pair<std::set<typename storm::storage::ParameterRegion<ValueType>::VariableType>,
225 monotoneParameters = boost::none) {
226 switch (engine) {
227 // TODO: now we always use regionsplitestimates
229 return initializeParameterLiftingRegionModelChecker<ValueType, double>(env, model, task, generateSplitEstimates, allowModelSimplification,
230 preconditionsValidated, monotonicitySetting, monotoneParameters);
232 return initializeParameterLiftingRegionModelChecker<ValueType, storm::RationalNumber>(
233 env, model, task, generateSplitEstimates, allowModelSimplification, preconditionsValidated, monotonicitySetting, monotoneParameters);
235 // TODO should this also apply to monotonicity?
236 STORM_LOG_WARN_COND(preconditionsValidated, "Preconditions are checked anyway by a valicating model checker...");
237 return initializeValidatingRegionModelChecker<ValueType, double, storm::RationalNumber>(env, model, task, generateSplitEstimates,
238 allowModelSimplification);
239 default:
240 STORM_LOG_THROW(false, storm::exceptions::UnexpectedException, "Unexpected region model checker type.");
241 }
242 return nullptr;
243}
244
245template<typename ValueType>
246std::shared_ptr<storm::modelchecker::RegionModelChecker<ValueType>> initializeRegionModelChecker(
249 Environment env;
250 initializeRegionModelChecker(env, model, task, engine);
251}
252
253template<typename ValueType>
254std::unique_ptr<storm::modelchecker::RegionCheckResult<ValueType>> checkRegionsWithSparseEngine(
257 std::vector<storm::modelchecker::RegionResultHypothesis> const& hypotheses, bool sampleVerticesOfRegions) {
258 Environment env;
259 auto regionChecker = initializeRegionModelChecker(env, model, task, engine);
260 return regionChecker->analyzeRegions(env, regions, hypotheses, sampleVerticesOfRegions);
261}
262
263template<typename ValueType>
264std::unique_ptr<storm::modelchecker::RegionCheckResult<ValueType>> checkRegionsWithSparseEngine(
268 bool sampleVerticesOfRegions = false) {
269 std::vector<storm::modelchecker::RegionResultHypothesis> hypotheses(regions.size(), hypothesis);
270 return checkRegionsWithSparseEngine(model, task, regions, engine, hypotheses, sampleVerticesOfRegions);
271}
272
284template<typename ValueType>
285std::unique_ptr<storm::modelchecker::RegionRefinementCheckResult<ValueType>> checkAndRefineRegionWithSparseEngine(
288 boost::optional<ValueType> const& coverageThreshold, boost::optional<uint64_t> const& refinementDepthThreshold = boost::none,
290 MonotonicitySetting monotonicitySetting = MonotonicitySetting(), uint64_t monThresh = 0) {
291 Environment env;
292 bool preconditionsValidated = false;
293 auto regionChecker = initializeRegionModelChecker(env, model, task, engine, true, allowModelSimplification, preconditionsValidated, monotonicitySetting);
294 return regionChecker->performRegionRefinement(env, region, coverageThreshold, refinementDepthThreshold, hypothesis, monThresh);
295}
296
297// TODO: update documentation
301template<typename ValueType>
302std::pair<storm::RationalNumber, typename storm::storage::ParameterRegion<ValueType>::Valuation> computeExtremalValue(
305 boost::optional<ValueType> const& precision, bool absolutePrecision, MonotonicitySetting const& monotonicitySetting,
306 std::optional<storm::logic::Bound> const& boundInvariant, bool generateSplitEstimates = false,
307 std::optional<uint64_t> maxSplitsPerStepThreshold = std::numeric_limits<uint64_t>::max()) {
308 Environment env;
309 bool preconditionsValidated = false;
310 bool allowModelSimplification = !monotonicitySetting.useMonotonicity;
311 auto regionChecker =
312 initializeRegionModelChecker(env, model, task, engine, generateSplitEstimates, allowModelSimplification, preconditionsValidated, monotonicitySetting);
313 if (maxSplitsPerStepThreshold && maxSplitsPerStepThreshold < std::numeric_limits<uint64_t>::max()) {
314 regionChecker->setMaxSplitDimensions(maxSplitsPerStepThreshold.value());
315 }
316 auto res = regionChecker->computeExtremalValue(env, region, dir, precision.is_initialized() ? precision.get() : storm::utility::zero<ValueType>(),
317 absolutePrecision, boundInvariant);
318 STORM_LOG_ASSERT(res.first.isConstant(), "result must be a constant");
319 return {storm::utility::convertNumber<storm::RationalNumber>(res.first.constantPart()), std::move(res.second)};
320}
321
325template<typename ValueType>
326bool verifyRegion(std::shared_ptr<storm::models::sparse::Model<ValueType>> const& model, storm::logic::Formula const& formula,
328 MonotonicitySetting const& monotonicitySetting, bool generateSplitEstimates = false,
329 std::optional<uint64_t> maxSplitsPerStepThreshold = std::numeric_limits<uint64_t>::max()) {
330 Environment env;
331 STORM_LOG_THROW(formula.isProbabilityOperatorFormula() || formula.isRewardOperatorFormula(), storm::exceptions::NotSupportedException,
332 "Only probability and reward operators supported");
333 STORM_LOG_THROW(formula.asOperatorFormula().hasBound(), storm::exceptions::NotSupportedException, "Verification requires a bounded operator formula.");
334
335 storm::logic::Bound const& bound = formula.asOperatorFormula().getBound();
336 std::shared_ptr<storm::logic::Formula> formulaWithoutBounds = formula.clone();
337 formulaWithoutBounds->asOperatorFormula().removeBound();
338 bool preconditionsValidated = false;
339 bool allowModelSimplification = !monotonicitySetting.useMonotonicity;
340 auto regionChecker = initializeRegionModelChecker(env, model, storm::modelchecker::CheckTask<storm::logic::Formula, ValueType>(*formulaWithoutBounds, true),
341 engine, generateSplitEstimates, allowModelSimplification, preconditionsValidated, monotonicitySetting);
342 if (maxSplitsPerStepThreshold && maxSplitsPerStepThreshold < std::numeric_limits<uint64_t>::max()) {
343 regionChecker->setMaxSplitDimensions(maxSplitsPerStepThreshold.value());
344 }
345 return regionChecker->verifyRegion(env, region, bound);
346}
347
348template<typename ValueType>
349void exportRegionCheckResultToFile(std::unique_ptr<storm::modelchecker::CheckResult> const& checkResult, std::string const& filename,
350 bool onlyConclusiveResults = false) {
351 auto const* regionCheckResult = dynamic_cast<storm::modelchecker::RegionCheckResult<ValueType> const*>(checkResult.get());
352 STORM_LOG_THROW(regionCheckResult != nullptr, storm::exceptions::UnexpectedException,
353 "Can not export region check result: The given checkresult does not have the expected type.");
354
355 std::ofstream filestream;
356 storm::io::openFile(filename, filestream);
357 for (auto const& res : regionCheckResult->getRegionResults()) {
358 if (!onlyConclusiveResults || res.second == storm::modelchecker::RegionResult::AllViolated || res.second == storm::modelchecker::RegionResult::AllSat) {
359 filestream << res.second << ": " << res.first << '\n';
360 }
361 }
362 storm::io::closeFile(filestream);
363}
364
365} // namespace api
366} // namespace storm
virtual bool isProbabilityOperatorFormula() const
Definition Formula.cpp:172
OperatorFormula & asOperatorFormula()
Definition Formula.cpp:469
virtual bool isRewardOperatorFormula() const
Definition Formula.cpp:176
std::shared_ptr< Formula > clone() const
Definition Formula.cpp:501
Bound const & getBound() const
FormulaType const & getFormula() const
Retrieves the formula from this task.
Definition CheckTask.h:140
virtual bool hasParameters() const
Checks whether the model has parameters.
Definition ModelBase.cpp:50
virtual bool isSparseModel() const
Checks whether the model is a sparse model.
Definition ModelBase.cpp:11
Base class for all sparse models.
Definition Model.h:33
static storm::storage::ParameterRegion< ParametricType > createRegion(std::string const &regionBound, std::set< VariableType > const &consideredVariables)
static std::vector< storm::storage::ParameterRegion< ParametricType > > parseMultipleRegions(std::string const &regionsString, std::set< VariableType > const &consideredVariables)
static std::vector< storm::storage::ParameterRegion< ParametricType > > parseMultipleRegionsFromFile(std::string const &fileName, std::set< VariableType > const &consideredVariables)
storm::utility::parametric::VariableType< ParametricType >::type VariableType
#define STORM_LOG_WARN(message)
Definition logging.h:30
#define STORM_LOG_ASSERT(cond, message)
Definition macros.h:11
#define STORM_LOG_WARN_COND(cond, message)
Definition macros.h:38
#define STORM_LOG_THROW(cond, exception, message)
Definition macros.h:30
void exportRegionCheckResultToFile(std::unique_ptr< storm::modelchecker::CheckResult > const &checkResult, std::string const &filename, bool onlyConclusiveResults=false)
Definition region.h:349
std::vector< storm::storage::ParameterRegion< ValueType > > parseRegions(std::string const &inputString, std::set< typename storm::storage::ParameterRegion< ValueType >::VariableType > const &consideredVariables)
Definition region.h:48
std::unique_ptr< storm::modelchecker::RegionRefinementCheckResult< ValueType > > checkAndRefineRegionWithSparseEngine(std::shared_ptr< storm::models::sparse::Model< ValueType > > const &model, storm::modelchecker::CheckTask< storm::logic::Formula, ValueType > const &task, storm::storage::ParameterRegion< ValueType > const &region, storm::modelchecker::RegionCheckEngine engine, boost::optional< ValueType > const &coverageThreshold, boost::optional< uint64_t > const &refinementDepthThreshold=boost::none, storm::modelchecker::RegionResultHypothesis hypothesis=storm::modelchecker::RegionResultHypothesis::Unknown, bool allowModelSimplification=true, MonotonicitySetting monotonicitySetting=MonotonicitySetting(), uint64_t monThresh=0)
Checks and iteratively refines the given region with the sparse engine.
Definition region.h:285
storm::storage::ParameterRegion< ValueType > parseRegion(std::string const &inputString, std::set< typename storm::storage::ParameterRegion< ValueType >::VariableType > const &consideredVariables)
Definition region.h:94
std::unique_ptr< storm::modelchecker::RegionCheckResult< ValueType > > checkRegionsWithSparseEngine(std::shared_ptr< storm::models::sparse::Model< ValueType > > const &model, storm::modelchecker::CheckTask< storm::logic::Formula, ValueType > const &task, std::vector< storm::storage::ParameterRegion< ValueType > > const &regions, storm::modelchecker::RegionCheckEngine engine, std::vector< storm::modelchecker::RegionResultHypothesis > const &hypotheses, bool sampleVerticesOfRegions)
Definition region.h:254
std::pair< std::shared_ptr< storm::models::sparse::Model< ValueType > >, std::vector< std::shared_ptr< storm::logic::Formula const > > > transformContinuousToDiscreteTimeSparseModel(std::shared_ptr< storm::models::sparse::Model< ValueType > > const &model, std::vector< std::shared_ptr< storm::logic::Formula const > > const &formulas)
Transforms the given continuous model to a discrete time model.
std::pair< storm::RationalNumber, typename storm::storage::ParameterRegion< ValueType >::Valuation > computeExtremalValue(std::shared_ptr< storm::models::sparse::Model< ValueType > > const &model, storm::modelchecker::CheckTask< storm::logic::Formula, ValueType > const &task, storm::storage::ParameterRegion< ValueType > const &region, storm::modelchecker::RegionCheckEngine engine, storm::solver::OptimizationDirection const &dir, boost::optional< ValueType > const &precision, bool absolutePrecision, MonotonicitySetting const &monotonicitySetting, std::optional< storm::logic::Bound > const &boundInvariant, bool generateSplitEstimates=false, std::optional< uint64_t > maxSplitsPerStepThreshold=std::numeric_limits< uint64_t >::max())
Finds the extremal value in the given region.
Definition region.h:302
std::shared_ptr< storm::modelchecker::RegionModelChecker< ParametricType > > initializeValidatingRegionModelChecker(Environment const &env, std::shared_ptr< storm::models::sparse::Model< ParametricType > > const &model, storm::modelchecker::CheckTask< storm::logic::Formula, ParametricType > const &task, bool generateSplitEstimates=false, bool allowModelSimplification=true)
Definition region.h:183
std::shared_ptr< storm::modelchecker::RegionModelChecker< ValueType > > initializeRegionModelChecker(Environment const &env, std::shared_ptr< storm::models::sparse::Model< ValueType > > const &model, storm::modelchecker::CheckTask< storm::logic::Formula, ValueType > const &task, storm::modelchecker::RegionCheckEngine engine, bool generateSplitEstimates=false, bool allowModelSimplification=true, bool preconditionsValidated=false, MonotonicitySetting monotonicitySetting=MonotonicitySetting(), boost::optional< std::pair< std::set< typename storm::storage::ParameterRegion< ValueType >::VariableType >, std::set< typename storm::storage::ParameterRegion< ValueType >::VariableType > > > monotoneParameters=boost::none)
Definition region.h:218
storm::storage::ParameterRegion< ValueType > createRegion(std::string const &inputString, std::set< typename storm::storage::ParameterRegion< ValueType >::VariableType > const &consideredVariables)
Definition region.h:60
bool verifyRegion(std::shared_ptr< storm::models::sparse::Model< ValueType > > const &model, storm::logic::Formula const &formula, storm::storage::ParameterRegion< ValueType > const &region, storm::modelchecker::RegionCheckEngine engine, MonotonicitySetting const &monotonicitySetting, bool generateSplitEstimates=false, std::optional< uint64_t > maxSplitsPerStepThreshold=std::numeric_limits< uint64_t >::max())
Verifies whether a region satisfies a property.
Definition region.h:326
std::shared_ptr< storm::modelchecker::RegionModelChecker< ParametricType > > initializeParameterLiftingRegionModelChecker(Environment const &env, std::shared_ptr< storm::models::sparse::Model< ParametricType > > const &model, storm::modelchecker::CheckTask< storm::logic::Formula, ParametricType > const &task, bool generateSplitEstimates=false, bool allowModelSimplification=true, bool preconditionsValidatedManually=false, MonotonicitySetting monotonicitySetting=MonotonicitySetting(), boost::optional< std::pair< std::set< typename storm::storage::ParameterRegion< ParametricType >::VariableType >, std::set< typename storm::storage::ParameterRegion< ParametricType >::VariableType > > > monotoneParameters=boost::none)
Definition region.h:131
std::pair< std::set< typename storm::storage::ParameterRegion< ValueType >::VariableType >, std::set< typename storm::storage::ParameterRegion< ValueType >::VariableType > > parseMonotoneParameters(std::string const &fileName, std::shared_ptr< storm::models::sparse::Model< ValueType > > const &model)
Definition region.h:121
void closeFile(std::ofstream &stream)
Close the given file after writing.
Definition file.h:47
bool fileExistsAndIsReadable(std::string const &filename)
Tests whether the given file exists and is readable.
Definition file.h:66
void openFile(std::string const &filepath, std::ofstream &filestream, bool append=false, bool silent=false)
Open the given file for writing.
Definition file.h:18
@ AllSat
the formula is satisfied for all parameters in the given region
@ AllViolated
the formula is violated for all parameters in the given region
RegionResultHypothesis
hypothesis for the result for a single Parameter Region
RegionCheckEngine
The considered engine for region checking.
@ ParameterLifting
Parameter lifting approach.
@ ValidatingParameterLifting
Parameter lifting approach with a) inexact (and fast) computation first and b) exact validation of ob...
@ ExactParameterLifting
Parameter lifting approach with exact arithmethics.
std::set< storm::RationalFunctionVariable > getRewardParameters(Model< storm::RationalFunction > const &model)
Get all parameters occurring in rewards.
Definition Model.cpp:707
std::set< storm::RationalFunctionVariable > getProbabilityParameters(Model< storm::RationalFunction > const &model)
Get all probability parameters occurring on transitions.
Definition Model.cpp:703
static bool validateParameterLiftingSound(storm::models::sparse::Model< ValueType > const &model, storm::logic::Formula const &formula)
Checks whether the parameter lifting approach is sound on the given model with respect to the provide...
LabParser.cpp.
Definition cli.cpp:18
MonotonicitySetting(bool useMonotonicity=false, bool useOnlyGlobalMonotonicity=false, bool useBoundsFromPLA=false)
Definition region.h:40