Storm 1.14.0.1
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
storm-pars.cpp
Go to the documentation of this file.
25#include "storm/api/storm.h"
41
42namespace storm {
43namespace pars {
45 PreprocessResult(std::shared_ptr<storm::models::ModelBase> const& model, bool changed) : changed(changed), model(model) {
46 // Intentionally left empty.
47 }
48
49 bool changed;
50 std::shared_ptr<storm::models::ModelBase> model;
51 boost::optional<std::vector<std::shared_ptr<storm::logic::Formula const>>> formulas;
52};
53
54template<typename ValueType>
55std::vector<storm::storage::ParameterRegion<ValueType>> parseRegions(std::shared_ptr<storm::models::ModelBase> const& model) {
56 std::vector<storm::storage::ParameterRegion<ValueType>> result;
58 if (regionSettings.isRegionSet()) {
59 result = storm::api::parseRegions<ValueType>(regionSettings.getRegionString(), *model);
60 } else if (regionSettings.isRegionBoundSet()) {
61 result = storm::api::createRegion<ValueType>(regionSettings.getRegionBoundString(), *model);
62 }
63 if (regionSettings.isAssumeGraphPreservingSet()) {
64 // We want to warn the user in case the model is actually not graph preserving.
65 // However, determining graph-preservingness precisely is hard.
66 // As an approximation, we only check if the region intersects 0 or 1.
67 for (auto const& region : result) {
68 for (auto const& variable : region.getVariables()) {
69 if (region.getLowerBoundary(variable) <= storm::utility::zero<typename storm::utility::parametric::CoefficientType<ValueType>::type>() ||
70 region.getUpperBoundary(variable) >= storm::utility::one<typename storm::utility::parametric::CoefficientType<ValueType>::type>()) {
72 "Region "
73 << region
74 << " appears to not preserve the graph structure of the parametric model. If this is the case, set --assume-graph-preserving false.");
75 break;
76 }
77 }
78 }
79 }
80 return result;
81}
82
83template<typename ValueType>
84std::shared_ptr<storm::models::ModelBase> eliminateScc(std::shared_ptr<storm::models::ModelBase> const& model) {
85 storm::utility::Stopwatch eliminationWatch(true);
86 std::shared_ptr<storm::models::ModelBase> result;
87 if (model->isOfType(storm::models::ModelType::Dtmc)) {
88 STORM_PRINT("Applying scc elimination\n");
89 auto sparseModel = model->as<storm::models::sparse::Model<ValueType>>();
90 auto matrix = sparseModel->getTransitionMatrix();
91 auto backwardsTransitionMatrix = matrix.transpose();
92
95
96 storm::storage::BitVector selectedStates(matrix.getRowCount());
97 storm::storage::BitVector selfLoopStates(matrix.getRowCount());
98 for (size_t i = 0; i < decomposition.size(); ++i) {
99 auto scc = decomposition.getBlock(i);
100 if (scc.size() > 1) {
101 auto statesScc = scc.getStates();
102 std::vector<uint_fast64_t> entryStates;
103 for (auto state : statesScc) {
104 auto row = backwardsTransitionMatrix.getRow(state);
105 bool found = false;
106 for (auto backState : row) {
107 if (!scc.containsState(backState.getColumn())) {
108 found = true;
109 }
110 }
111 if (found) {
112 entryStates.push_back(state);
113 selfLoopStates.set(state);
114 } else {
115 selectedStates.set(state);
116 }
117 }
118
119 if (entryStates.size() != 1) {
120 STORM_LOG_THROW(entryStates.size() > 1, storm::exceptions::NotImplementedException,
121 "State elimination not implemented for scc with more than 1 entry points.");
122 }
123 }
124 }
125
127 storm::storage::FlexibleSparseMatrix<ValueType> flexibleBackwardTransitions(backwardsTransitionMatrix, true);
128 auto actionRewards = std::vector<ValueType>(matrix.getRowCount(), storm::utility::zero<ValueType>());
129 storm::solver::stateelimination::NondeterministicModelStateEliminator<ValueType> stateEliminator(flexibleMatrix, flexibleBackwardTransitions,
130 actionRewards);
131 for (auto state : selectedStates) {
132 stateEliminator.eliminateState(state, true);
133 }
134 for (auto state : selfLoopStates) {
135 auto row = flexibleMatrix.getRow(state);
136 stateEliminator.eliminateLoop(state);
137 }
138 selectedStates.complement();
139 auto keptRows = matrix.getRowFilter(selectedStates);
140 storm::storage::SparseMatrix<ValueType> newTransitionMatrix = flexibleMatrix.createSparseMatrix(keptRows, selectedStates);
141 // TODO @Jip: note that rewards get lost
142 result = std::make_shared<storm::models::sparse::Dtmc<ValueType>>(std::move(newTransitionMatrix),
143 sparseModel->getStateLabeling().getSubLabeling(selectedStates));
144
145 eliminationWatch.stop();
146 STORM_PRINT("\nTime for scc elimination: " << eliminationWatch << ".\n\n");
147 result->printModelInformationToStream(std::cout);
148 } else if (model->isOfType(storm::models::ModelType::Mdp)) {
149 STORM_LOG_THROW(false, storm::exceptions::NotImplementedException,
150 "Unable to perform SCC elimination for monotonicity analysis on MDP: Not implemented.");
151 } else {
152 STORM_LOG_THROW(false, storm::exceptions::InvalidOperationException, "Unable to perform monotonicity analysis on the provided model type.");
153 }
154 return result;
155}
156
157template<typename ValueType>
158std::shared_ptr<storm::models::ModelBase> simplifyModel(std::shared_ptr<storm::models::ModelBase> const& model, cli::SymbolicInput const& input) {
159 storm::utility::Stopwatch simplifyingWatch(true);
160 std::shared_ptr<storm::models::ModelBase> result;
161 if (model->isOfType(storm::models::ModelType::Dtmc)) {
163 *(model->template as<storm::models::sparse::Dtmc<ValueType>>()));
164
165 std::vector<std::shared_ptr<storm::logic::Formula const>> formulas = storm::api::extractFormulasFromProperties(input.properties);
166 STORM_LOG_THROW(formulas.begin() != formulas.end(), storm::exceptions::NotSupportedException, "Only one formula at the time supported.");
167
168 STORM_LOG_THROW(simplifier.simplify(*(formulas[0])), storm::exceptions::UnexpectedException, "Simplifying the model was not successfull.");
169 result = simplifier.getSimplifiedModel();
170 } else if (model->isOfType(storm::models::ModelType::Mdp)) {
172 *(model->template as<storm::models::sparse::Mdp<ValueType>>()));
173
174 std::vector<std::shared_ptr<storm::logic::Formula const>> formulas = storm::api::extractFormulasFromProperties(input.properties);
175 STORM_LOG_THROW(formulas.begin() != formulas.end(), storm::exceptions::NotSupportedException, "Only one formula at the time supported.");
176
177 STORM_LOG_THROW(simplifier.simplify(*(formulas[0])), storm::exceptions::UnexpectedException, "Simplifying the model was not successfull.");
178 result = simplifier.getSimplifiedModel();
179 } else {
180 STORM_LOG_THROW(false, storm::exceptions::InvalidOperationException, "Unable to perform monotonicity analysis on the provided model type.");
181 }
182
183 simplifyingWatch.stop();
184 STORM_PRINT("\nTime for model simplification: " << simplifyingWatch << ".\n\n");
185 result->printModelInformationToStream(std::cout);
186 return result;
187}
188
189template<typename ValueType>
197
198 PreprocessResult result(model, false);
199 // TODO: why only simplify in these modes
200 if (parametricSettings.getOperationMode() == storm::pars::utility::ParametricMode::Monotonicity ||
201 parametricSettings.getOperationMode() == storm::pars::utility::ParametricMode::Feasibility) {
202 STORM_LOG_THROW(!input.properties.empty(), storm::exceptions::InvalidSettingsException, "Simplification requires property to be specified.");
203 result.model = storm::pars::simplifyModel<ValueType>(result.model, input);
204 result.changed = true;
205 }
206
207 if (result.model->isOfType(storm::models::ModelType::MarkovAutomaton)) {
209 result.changed = true;
210 }
211
212 if (mpi.applyBisimulation) {
214 bisimulationSettings, regionSettings.isAssumeGraphPreservingSet());
215 result.changed = true;
216 }
217
218 if (parametricSettings.isLinearToSimpleEnabled()) {
219 STORM_LOG_INFO("Transforming linear to simple...");
221 result.model = transformer.transform(*result.model->template as<storm::models::sparse::Dtmc<RationalFunction>>(), true);
222 result.changed = true;
223 }
224
225 if (parametricSettings.isBigStepEnabled()) {
229 auto bigStepResult = tt.bigStep(*result.model->template as<storm::models::sparse::Dtmc<RationalFunction>>(), checkTask);
230 result.model = std::make_shared<storm::models::sparse::Dtmc<RationalFunction>>(bigStepResult.first);
231
232 if (mpi.applyBisimulation) {
234 bisimulationSettings, regionSettings.isAssumeGraphPreservingSet());
235 }
236 result.changed = true;
237 }
238
239 if (transformationSettings.isChainEliminationSet() && model->isOfType(storm::models::ModelType::MarkovAutomaton)) {
240 // TODO: Why only on MAs?
241 auto eliminationResult =
243 storm::api::extractFormulasFromProperties(input.properties), transformationSettings.getLabelBehavior());
244 result.model = eliminationResult.first;
245 // Set transformed properties as new properties in input
246 result.formulas = eliminationResult.second;
247 result.changed = true;
248 }
249
250 if (parametricSettings.transformContinuousModel() &&
251 (model->isOfType(storm::models::ModelType::Ctmc) || model->isOfType(storm::models::ModelType::MarkovAutomaton))) {
254 result.model = transformResult.first;
255 // Set transformed properties as new properties in input
256 result.formulas = transformResult.second;
257 result.changed = true;
258 }
259
260 if (monSettings.isSccEliminationSet()) {
261 // TODO move this into the API?
263 result.changed = true;
264 }
265
266 return result;
267}
268
269template<storm::dd::DdType DdType, typename ValueType>
273
274 PreprocessResult result(model, false);
275
277 // Currently, hybrid engine for parametric models just refers to building the model symbolically.
278 STORM_LOG_INFO("Translating symbolic model to sparse model...");
280 result.changed = true;
281 // Invoke preprocessing on the sparse model
282 PreprocessResult sparsePreprocessingResult =
284 if (sparsePreprocessingResult.changed) {
285 result.model = sparsePreprocessingResult.model;
286 result.formulas = sparsePreprocessingResult.formulas;
287 }
288 } else {
289 STORM_LOG_ASSERT(mpi.engine == storm::utility::Engine::Dd, "Expected Dd engine.");
290 if (mpi.applyBisimulation) {
292 bisimulationSettings, mpi);
293 result.changed = true;
294 }
295 }
296 return result;
297}
298
299template<storm::dd::DdType DdType, typename ValueType>
300PreprocessResult preprocessModel(std::shared_ptr<storm::models::ModelBase> const& model, cli::SymbolicInput const& input,
302 storm::utility::Stopwatch preprocessingWatch(true);
303
304 PreprocessResult result(model, false);
305 if (model->isSparseModel()) {
307 } else {
308 STORM_LOG_ASSERT(model->isSymbolicModel(), "Unexpected model type.");
310 }
311
312 if (result.changed) {
313 STORM_PRINT_AND_LOG("\nTime for model preprocessing: " << preprocessingWatch << ".\n\n");
314 }
315 return result;
316}
317
318template<typename ValueType>
320 std::vector<storm::storage::ParameterRegion<ValueType>> const& regions,
322 STORM_LOG_THROW(regions.size() == 1, storm::exceptions::NotSupportedException, "Region verification is supported for a (single) region only.");
323 storm::storage::ParameterRegion<ValueType> const& region = regions.front();
324 STORM_LOG_THROW(input.properties.size() == 1, storm::exceptions::NotSupportedException, "Region verification is supported for a (single) property only.");
325 auto const& property = input.properties.front();
326
329
330 auto engine = rvs.getRegionCheckEngine();
331 bool graphPreserving = regionSettings.isAssumeGraphPreservingSet();
332
333 STORM_LOG_THROW(graphPreserving || engine == storm::modelchecker::RegionCheckEngine::RobustParameterLifting, storm::exceptions::NotSupportedException,
334 "Selected region verification engine (--regionverif:engine) requires the assumption that the region is graph-preserving "
335 "(--assume-graph-preserving true).");
336
337 auto splittingStrategy = storm::modelchecker::RegionSplittingStrategy();
338
339 splittingStrategy.heuristic = rvs.getRegionSplittingHeuristic();
340 splittingStrategy.estimateKind = rvs.getRegionSplittingEstimateMethod();
341 if (rvs.isSplittingThresholdSet()) {
342 splittingStrategy.maxSplitDimensions = rvs.getSplittingThreshold();
343 }
344
345 auto parsedDiscreteVars = storm::api::parseVariableList<ValueType>(regionSettings.getDiscreteVariablesString(), *model);
346 std::set<typename storm::storage::ParameterRegion<ValueType>::VariableType> discreteVariables(parsedDiscreteVars.begin(), parsedDiscreteVars.end());
347
348 storm::utility::Stopwatch watch(true);
349
351 model,
352 *(property.getRawFormula()),
353 engine,
354 splittingStrategy,
355 monotonicitySettings,
356 discreteVariables,
357 true, // allow model simplification
358 graphPreserving,
359 false // preconditions not yet validated
360 };
361
363 STORM_PRINT_AND_LOG("Formula is satisfied by all parameter instantiations.\n");
364 } else {
365 STORM_PRINT_AND_LOG("Formula is not satisfied by all parameter instantiations.\n");
366 }
367 STORM_PRINT_AND_LOG("Time for model checking: " << watch << ".\n");
368}
369
370template<typename ValueType>
372 std::vector<storm::storage::ParameterRegion<ValueType>> const& regions,
374 uint64_t monThresh = 0) {
375 STORM_LOG_ASSERT(!regions.empty(), "Can not analyze an empty set of regions.");
376 STORM_LOG_THROW(regions.size() == 1, storm::exceptions::NotSupportedException, "Region refinement is not supported for multiple initial regions.");
377 STORM_LOG_THROW(input.properties.size() == 1, storm::exceptions::NotSupportedException, "Region verification is supported for a (single) property only.");
378 auto const& property = input.properties.front();
379
384
385 ValueType refinementThreshold = storm::utility::convertNumber<ValueType>(partitionSettings.getCoverageThreshold());
386 std::optional<uint64_t> optionalDepthLimit;
387 if (partitionSettings.isDepthLimitSet()) {
388 optionalDepthLimit = partitionSettings.getDepthLimit();
389 }
390
392 STORM_PRINT_AND_LOG("Analyzing parameter region " << regions.front());
393
394 auto engine = rvs.getRegionCheckEngine();
395 STORM_PRINT_AND_LOG(" using " << engine);
396
397 auto splittingStrategy = storm::modelchecker::RegionSplittingStrategy();
398
399 splittingStrategy.heuristic = rvs.getRegionSplittingHeuristic();
400 splittingStrategy.estimateKind = rvs.getRegionSplittingEstimateMethod();
401 if (rvs.isSplittingThresholdSet()) {
402 splittingStrategy.maxSplitDimensions = rvs.getSplittingThreshold();
403 }
404
405 bool graphPreserving = regionSettings.isAssumeGraphPreservingSet();
406
407 auto parsedDiscreteVars = storm::api::parseVariableList<ValueType>(regionSettings.getDiscreteVariablesString(), *model);
408 std::set<typename storm::storage::ParameterRegion<ValueType>::VariableType> discreteVariables(parsedDiscreteVars.begin(), parsedDiscreteVars.end());
409
410 STORM_PRINT_AND_LOG(" and splitting heuristic " << splittingStrategy.heuristic);
411 if (monotonicitySettings.useMonotonicity) {
412 STORM_PRINT_AND_LOG(" with local monotonicity and");
413 }
414
415 STORM_PRINT_AND_LOG(" with iterative refinement until "
416 << (1.0 - partitionSettings.getCoverageThreshold()) * 100.0 << "% is covered."
417 << (partitionSettings.isDepthLimitSet() ? " Depth limit is " + std::to_string(partitionSettings.getDepthLimit()) + "." : "") << '\n');
418
420 storm::utility::Stopwatch watch(true);
421
423 model,
424 storm::api::createTask<ValueType>(property.getRawFormula(), true),
425 engine,
426 splittingStrategy,
427 monotonicitySettings,
428 discreteVariables,
429 true, // allow model simplification
430 graphPreserving,
431 false // preconditions not yet validated
432 };
433 std::unique_ptr<storm::modelchecker::CheckResult> result = storm::api::checkAndRefineRegionWithSparseEngine<ValueType>(
434 settings, regions.front(), refinementThreshold, optionalDepthLimit, storm::modelchecker::RegionResultHypothesis::Unknown, monThresh);
435 watch.stop();
437
438 if (parametricSettings.exportResultToFile()) {
439 storm::api::exportRegionCheckResultToFile<ValueType>(result, parametricSettings.exportResultPath());
440 }
441}
442
450
452 storm::exceptions::InvalidSettingsException, "The selected engine is not supported for parametric models.");
453 STORM_LOG_THROW(parSettings.hasOperationModeBeenSet(), storm::exceptions::InvalidSettingsException, "An operation mode must be selected with --mode.");
454 std::shared_ptr<storm::models::ModelBase> model;
455 if (!buildSettings.isNoBuildModelSet()) {
456 model = storm::cli::buildModel(input, ioSettings, mpi);
457 }
458
459 STORM_LOG_THROW(model, storm::exceptions::InvalidSettingsException, "No input model.");
460 if (model) {
461 model->printModelInformationToStream(std::cout);
462 }
463
464 using ValueType = storm::RationalFunction;
465 auto const DdType = storm::dd::DdType::Sylvan;
466 STORM_LOG_THROW(model->supportsParameters(), storm::exceptions::UnexpectedException, "Expected a parametric model.");
467 STORM_LOG_THROW(model->isSparseModel() || model->getDdType().value() == DdType, storm::exceptions::UnexpectedException,
468 "Expected type of model representation.");
469
470 // If minimization is active and the model is parametric, parameters might be minimized away because they are inconsequential.
471 // This is the set of all such inconsequential parameters.
472 std::set<RationalFunctionVariable> omittedParameters;
473
474 if (model) {
475 auto preprocessingResult = storm::pars::preprocessModel<DdType, ValueType>(model, input, mpi);
476 if (preprocessingResult.changed) {
477 if (model->isOfType(models::ModelType::Dtmc) || model->isOfType(models::ModelType::Mdp)) {
478 auto const previousParams = storm::models::sparse::getAllParameters(*model->template as<storm::models::sparse::Model<ValueType>>());
479 auto const currentParams =
480 storm::models::sparse::getAllParameters(*(preprocessingResult.model)->template as<storm::models::sparse::Model<ValueType>>());
481 for (auto const& variable : previousParams) {
482 if (!currentParams.count(variable)) {
483 omittedParameters.insert(variable);
484 }
485 }
486 }
487 model = preprocessingResult.model;
488
489 if (preprocessingResult.formulas) {
490 std::vector<storm::jani::Property> newProperties;
491 for (size_t i = 0; i < preprocessingResult.formulas.get().size(); ++i) {
492 auto formula = preprocessingResult.formulas.get().at(i);
493 STORM_LOG_ASSERT(i < input.properties.size(), "Index " << i << " greater than number of properties.");
494 storm::jani::Property property = input.properties.at(i);
495 newProperties.push_back(storm::jani::Property(property.getName(), formula, property.getUndefinedConstants(), property.getComment()));
496 }
497 input.properties = newProperties;
498 }
499 model->printModelInformationToStream(std::cout);
500 }
501 }
502
503 std::vector<storm::storage::ParameterRegion<ValueType>> regions = parseRegions<ValueType>(model);
504 if (!model) {
505 return;
506 } else {
507 storm::cli::castAndApply(model, [&input](auto const& m) { storm::cli::exportModel(m, input); });
508 }
509
510 // TODO move this.
511 storm::api::MonotonicitySetting monotonicitySettings(parSettings.isUseMonotonicitySet(), false, monSettings.isUsePLABoundsSet());
512 uint64_t monThresh = monSettings.getMonotonicityThreshold();
513
514 auto mode = parSettings.getOperationMode();
516 STORM_LOG_INFO("Solution function mode started.");
517 STORM_LOG_THROW(regions.empty(), storm::exceptions::InvalidSettingsException,
518 "Solution function computations cannot be restricted to specific regions.");
519 STORM_LOG_ERROR_COND(!regionSettings.isAssumeGraphPreservingSet(), "Solution function computations assume graph preservation.");
520
521 if (model->isSparseModel()) {
523 } else {
525 }
527 STORM_LOG_INFO("Monotonicity mode started.");
528 STORM_LOG_THROW(model->isSparseModel(), storm::exceptions::InvalidSettingsException, "Monotonicity analysis is only supported on sparse models.");
531 STORM_LOG_INFO("Feasibility mode started.");
532 STORM_LOG_THROW(model->isSparseModel(), storm::exceptions::InvalidSettingsException, "Feasibility analysis is only supported on sparse models.");
533 std::vector<std::shared_ptr<storm::logic::Formula const>> formulas = storm::api::extractFormulasFromProperties(input.properties);
534 STORM_LOG_THROW(formulas.size() == 1, storm::exceptions::InvalidSettingsException,
535 "Feasibility analysis is only supported for single-objective properties.");
536 auto formula = formulas[0];
538 createFeasibilitySynthesisTaskFromSettings(formula, regions), omittedParameters, monotonicitySettings);
540 STORM_LOG_INFO("Verification mode started.");
541 STORM_LOG_THROW(input.properties.size() == 1, storm::exceptions::InvalidSettingsException,
542 "Verification analysis is only supported for single-objective properties.");
543 STORM_LOG_THROW(model->isSparseModel(), storm::exceptions::InvalidSettingsException, "Verification analysis is only supported on sparse models.");
544 verifyRegionWithSparseEngine(model->as<storm::models::sparse::Model<ValueType>>(), input, regions, monotonicitySettings);
545
547 STORM_LOG_INFO("Partition mode started.");
548 STORM_LOG_THROW(model->isSparseModel(), storm::exceptions::InvalidSettingsException,
549 "Parameter space partitioning is only supported on sparse models.");
550 STORM_LOG_THROW(regions.size() == 1, storm::exceptions::InvalidSettingsException, "Partitioning requires a (single) initial region.");
551
552 // TODO Partition mode does not support monotonicity. This should generally be possible.
553 // TODO here setting monotone parameters from the outside may actually be useful
554
555 STORM_LOG_ASSERT(!monotonicitySettings.useOnlyGlobalMonotonicity, "Unexpected setting of only using global monotonicity.");
556 STORM_LOG_ASSERT(!monotonicitySettings.useBoundsFromPLA, "Unexpected setting of using bounds from PLA.");
558 monThresh);
560 STORM_LOG_INFO("Sampling mode started.");
561 STORM_LOG_THROW(model->isSparseModel(), storm::exceptions::InvalidSettingsException, "Sampling analysis is currently only supported on sparse models.");
562 // TODO unclear why this only works for sparse models?
563
564 std::string samplesAsString = sampleSettings.getSamples();
566 if (!samplesAsString.empty()) {
567 samples = parseSamples<ValueType>(model, samplesAsString, sampleSettings.isSamplesAreGraphPreservingSet());
568 samples.exact = sampleSettings.isSampleExactSet();
569 }
570 if (!samples.empty()) {
571 STORM_LOG_TRACE("Sampling the model at given points.");
572
573 if (sampleSettings.isSampleDerivativeSet()) {
574 if (samples.exact) {
576 model->as<storm::models::sparse::Model<ValueType>>(), input, samples);
577 } else {
579 samples);
580 }
581 } else {
582 if (samples.exact) {
584 input, samples);
585 } else {
587 }
588 }
589 }
590 } else {
591 STORM_LOG_ASSERT(false, "Unknown operation mode.");
592 }
593}
594
597 auto engine = coreSettings.getEngine();
599 engine != storm::utility::Engine::Dd || engine != storm::utility::Engine::Hybrid || coreSettings.getDdLibraryType() == storm::dd::DdType::Sylvan,
600 "The selected DD library does not support parametric models. Switching to Sylvan...");
601
602 // Parse and preprocess symbolic input (PRISM, JANI, properties, etc.)
603 auto symbolicInput = storm::cli::parseSymbolicInput();
605 std::tie(symbolicInput, mpi) = storm::cli::preprocessSymbolicInput(symbolicInput);
609 processInput(std::move(symbolicInput), mpi);
610}
611} // namespace pars
612} // namespace storm
613
617int main(const int argc, const char** argv) {
618 try {
619 return storm::cli::process("Storm-pars", "storm-pars", storm::settings::initializeParsSettings, storm::pars::processOptions, argc, argv);
620 } catch (storm::exceptions::BaseException const& exception) {
621 STORM_LOG_ERROR("An exception caused Storm-pars to terminate. The message of the exception is: " << exception.what());
622 return 1;
623 } catch (std::exception const& exception) {
624 STORM_LOG_ERROR("An unexpected exception occurred and caused Storm-pars to terminate. The message of this exception is: " << exception.what());
625 return 2;
626 }
627}
This class represents the base class of all exception classes.
virtual const char * what() const noexcept override
Retrieves the message associated with this exception.
This class represents a discrete-time Markov chain.
Definition Dtmc.h:13
This class represents a Markov automaton.
This class represents a (discrete-time) Markov decision process.
Definition Mdp.h:13
Base class for all sparse models.
Definition Model.h:30
storm::storage::SparseMatrix< ValueType > const & getTransitionMatrix() const
Retrieves the matrix representing the transitions of the model.
Definition Model.cpp:198
Base class for all symbolic models.
Definition Model.h:42
void eliminateState(storm::storage::sparse::state_type state, bool removeForwardTransitions)
A bit vector that is internally represented as a vector of 64-bit values.
Definition BitVector.h:16
void complement()
Negates all bits in the bit vector.
void set(uint64_t index, bool value=true)
Sets the given truth value at the given index.
The flexible sparse matrix is used during state elimination.
storm::storage::SparseMatrix< ValueType > createSparseMatrix()
Creates a sparse matrix from the flexible sparse matrix.
row_type & getRow(index_type)
Returns an object representing the given row.
A class that holds a possibly non-square matrix in the compressed row storage format.
This class represents the decomposition of a graph-like structure into its strongly connected compone...
Shorthand for std::unordered_map<T, uint64_t>.
Definition BigStep.h:176
std::pair< models::sparse::Dtmc< RationalFunction >, std::map< UniPoly, Annotation > > bigStep(models::sparse::Dtmc< RationalFunction > const &model, modelchecker::CheckTask< logic::Formula, RationalFunction > const &checkTask)
Perform big-step on the given model and the given checkTask.
Definition BigStep.cpp:381
This class performs different steps to simplify the given (parametric) model.
This class performs different steps to simplify the given (parametric) model.
A class that provides convenience operations to display run times.
Definition Stopwatch.h:13
void stop()
Stop stopwatch and add measured time to total time.
Definition Stopwatch.cpp:42
#define STORM_LOG_INFO(message)
Definition logging.h:27
#define STORM_LOG_WARN(message)
Definition logging.h:28
#define STORM_LOG_TRACE(message)
Definition logging.h:15
#define STORM_LOG_ERROR(message)
Definition logging.h:29
#define STORM_LOG_ASSERT(cond, message)
Definition macros.h:9
#define STORM_LOG_WARN_COND(cond, message)
Definition macros.h:36
#define STORM_LOG_ERROR_COND(cond, message)
Definition macros.h:50
#define STORM_LOG_THROW(cond, exception, message)
Definition macros.h:28
void exportRegionCheckResultToFile(std::unique_ptr< storm::modelchecker::CheckResult > const &checkResult, std::string const &filename, bool onlyConclusiveResults=false)
Definition region.h:362
std::vector< storm::storage::ParameterRegion< ValueType > > parseRegions(std::string const &inputString, std::set< typename storm::storage::ParameterRegion< ValueType >::VariableType > const &consideredVariables)
Definition region.h:96
storm::modelchecker::CheckTask< storm::logic::Formula, ValueType > createTask(std::shared_ptr< const storm::logic::Formula > const &formula, bool onlyInitialStatesRelevant=false)
std::pair< std::shared_ptr< storm::models::sparse::Model< ValueType > >, std::vector< std::shared_ptr< storm::logic::Formula const > > > eliminateNonMarkovianChains(std::shared_ptr< storm::models::sparse::MarkovAutomaton< ValueType > > const &ma, std::vector< std::shared_ptr< storm::logic::Formula const > > const &formulas, storm::transformer::EliminationLabelBehavior labelBehavior)
Eliminates chains of non-Markovian states from a given Markov Automaton.
std::shared_ptr< storm::models::sparse::Model< ValueType > > transformSymbolicToSparseModel(std::shared_ptr< storm::models::symbolic::Model< Type, ValueType > > const &symbolicModel, std::vector< std::shared_ptr< storm::logic::Formula const > > const &formulas=std::vector< std::shared_ptr< storm::logic::Formula const > >())
Transforms the given symbolic model to a sparse model.
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::unique_ptr< storm::modelchecker::RegionRefinementCheckResult< ValueType > > checkAndRefineRegionWithSparseEngine(RefinementOptions< ValueType > settings, storm::storage::ParameterRegion< ValueType > const &region, std::optional< ValueType > const &coverageThreshold, std::optional< uint64_t > const &refinementDepthThreshold=std::nullopt, storm::modelchecker::RegionResultHypothesis hypothesis=storm::modelchecker::RegionResultHypothesis::Unknown, uint64_t monThresh=0)
Checks and iteratively refines the given region with the sparse engine.
Definition region.h:311
std::vector< std::shared_ptr< storm::logic::Formula const > > extractFormulasFromProperties(std::vector< storm::jani::Property > const &properties)
storm::pars::modelchecker::MonotonicityOptions MonotonicitySetting
Definition region.h:43
std::vector< typename storm::storage::ParameterRegion< ValueType >::VariableType > parseVariableList(std::string const &inputString, std::set< typename storm::storage::ParameterRegion< ValueType >::VariableType > const &consideredVariables)
Definition region.h:63
bool verifyRegion(RefinementOptions< ValueType > settings, storm::storage::ParameterRegion< ValueType > const &region)
Verifies whether a region satisfies a property.
Definition region.h:349
storm::storage::ParameterRegion< ValueType > createRegion(std::string const &inputString, std::set< typename storm::storage::ParameterRegion< ValueType >::VariableType > const &consideredVariables)
Definition region.h:113
storm::pars::modelchecker::RegionRefinementOptions< ValueType > RefinementOptions
Definition region.h:46
void exportModel(std::shared_ptr< storm::models::sparse::Model< ValueType > > const &model, SymbolicInput const &input)
auto castAndApply(std::shared_ptr< storm::models::ModelBase > const &model, auto const &callback)
std::shared_ptr< storm::models::sparse::Model< ValueType > > preprocessSparseModelBisimulation(std::shared_ptr< storm::models::sparse::Model< ValueType > > const &model, SymbolicInput const &input, storm::settings::modules::BisimulationSettings const &bisimulationSettings, bool graphPreserving=true)
SymbolicInput parseSymbolicInput()
int process(std::string const &name, std::string const &executableName, std::function< void(std::string const &, std::string const &)> initSettingsFunc, std::function< void(void)> processOptionsFunc, const int argc, const char **argv)
Processes the options and returns the exit code.
Definition cli.cpp:96
std::shared_ptr< storm::models::sparse::Model< ValueType > > preprocessSparseMarkovAutomaton(std::shared_ptr< storm::models::sparse::MarkovAutomaton< ValueType > > const &model)
std::pair< SymbolicInput, ModelProcessingInformation > preprocessSymbolicInput(SymbolicInput const &input)
std::shared_ptr< storm::models::ModelBase > buildModel(SymbolicInput const &input, storm::settings::modules::IOSettings const &ioSettings, ModelProcessingInformation const &mpi)
void printModelCheckingProperty(storm::jani::Property const &property)
std::shared_ptr< storm::models::Model< ExportValueType > > preprocessDdModelBisimulation(std::shared_ptr< storm::models::symbolic::Model< DdType, ValueType > > const &model, SymbolicInput const &input, storm::settings::modules::BisimulationSettings const &bisimulationSettings, ModelProcessingInformation const &mpi)
@ RobustParameterLifting
Parameter lifting approach based on robust markov models instead of generating nondeterminism.
std::set< storm::RationalFunctionVariable > getAllParameters(Model< storm::RationalFunction > const &model)
Get all parameters (probability, rewards, and rates) occurring in the model.
Definition Model.cpp:719
void performFeasibility(std::shared_ptr< storm::models::sparse::Model< ValueType > > model, std::shared_ptr< storm::pars::FeasibilitySynthesisTask const > const &task, boost::optional< std::set< RationalFunctionVariable > > omittedParameters, storm::api::MonotonicitySetting monotonicitySettings)
std::shared_ptr< storm::models::ModelBase > simplifyModel(std::shared_ptr< storm::models::ModelBase > const &model, cli::SymbolicInput const &input)
void parameterSpacePartitioningWithSparseEngine(std::shared_ptr< storm::models::sparse::Model< ValueType > > const &model, cli::SymbolicInput const &input, std::vector< storm::storage::ParameterRegion< ValueType > > const &regions, storm::api::MonotonicitySetting monotonicitySettings=storm::api::MonotonicitySetting(), uint64_t monThresh=0)
void analyzeMonotonicity(std::shared_ptr< storm::models::sparse::Model< ValueType > > const &model, cli::SymbolicInput const &input, std::vector< storm::storage::ParameterRegion< ValueType > > const &regions)
void processOptions()
PreprocessResult preprocessSparseModel(std::shared_ptr< storm::models::sparse::Model< ValueType > > const &model, cli::SymbolicInput const &input, storm::cli::ModelProcessingInformation const &mpi)
std::shared_ptr< storm::models::ModelBase > eliminateScc(std::shared_ptr< storm::models::ModelBase > const &model)
PreprocessResult preprocessDdModel(std::shared_ptr< storm::models::symbolic::Model< DdType, ValueType > > const &model, cli::SymbolicInput const &input, storm::cli::ModelProcessingInformation const &mpi)
SampleInformation< ValueType > parseSamples(std::shared_ptr< storm::models::ModelBase > const &model, std::string const &sampleString, bool graphPreserving)
Definition sampling.h:261
void verifyPropertiesAtSamplePointsWithSparseEngineDerivatives(std::shared_ptr< storm::models::sparse::Model< ValueType > > const &model, cli::SymbolicInput const &input, SampleInformation< ValueType > const &samples)
Definition sampling.h:233
void verifyPropertiesAtSamplePointsWithSparseEngine(std::shared_ptr< storm::models::sparse::Model< ValueType > > const &model, cli::SymbolicInput const &input, SampleInformation< ValueType > const &samples)
Definition sampling.h:244
void printInitialStatesResult(std::unique_ptr< storm::modelchecker::CheckResult > const &result, storm::utility::Stopwatch *watch, const storm::utility::parametric::Valuation< ValueType > *valuation)
Definition print.cpp:11
void computeSolutionFunctionsWithSparseEngine(std::shared_ptr< storm::models::sparse::Model< ValueType > > const &model, storm::cli::SymbolicInput const &input)
void processInput(cli::SymbolicInput &&input, storm::cli::ModelProcessingInformation const &mpi)
void computeSolutionFunctionsWithSymbolicEngine(std::shared_ptr< storm::models::symbolic::Model< DdType, ValueType > > const &model, storm::cli::SymbolicInput const &input)
PreprocessResult preprocessModel(std::shared_ptr< storm::models::ModelBase > const &model, cli::SymbolicInput const &input, storm::cli::ModelProcessingInformation const &mpi)
void verifyRegionWithSparseEngine(std::shared_ptr< storm::models::sparse::Model< ValueType > > const &model, cli::SymbolicInput const &input, std::vector< storm::storage::ParameterRegion< ValueType > > const &regions, storm::api::MonotonicitySetting monotonicitySettings=storm::api::MonotonicitySetting())
std::vector< storm::storage::ParameterRegion< ValueType > > parseRegions(std::shared_ptr< storm::models::ModelBase > const &model)
std::shared_ptr< FeasibilitySynthesisTask const > createFeasibilitySynthesisTaskFromSettings(std::shared_ptr< storm::logic::Formula const > const &formula, std::vector< storm::storage::ParameterRegion< storm::RationalFunction > > const &regions)
void initializeParsSettings(std::string const &name, std::string const &executableName)
SettingsType const & getModule()
Get module.
ValueType zero()
Definition constants.cpp:24
ValueType one()
Definition constants.cpp:19
TargetType convertNumber(SourceType const &number)
carl::RationalFunction< Polynomial, true > RationalFunction
#define STORM_PRINT_AND_LOG(message)
Definition print.h:20
#define STORM_PRINT(message)
Define the macros that print information to stdout and optionally also log it.
Definition print.h:14
int main(const int argc, const char **argv)
Main entry point of the executable storm-pars.
std::vector< storm::jani::Property > properties
boost::optional< std::vector< std::shared_ptr< storm::logic::Formula const > > > formulas
PreprocessResult(std::shared_ptr< storm::models::ModelBase > const &model, bool changed)
std::shared_ptr< storm::models::ModelBase > model