Storm 1.14.0.1
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
storm-pars.cpp
Go to the documentation of this file.
1#include <memory>
2#include <optional>
3#include <sstream>
4#include <type_traits>
5
33#include "storm/api/storm.h"
49
50namespace storm {
51namespace pars {
53 PreprocessResult(std::shared_ptr<storm::models::ModelBase> const& model, bool changed) : changed(changed), model(model) {
54 // Intentionally left empty.
55 }
56
57 bool changed;
58 std::shared_ptr<storm::models::ModelBase> model;
59 boost::optional<std::vector<std::shared_ptr<storm::logic::Formula const>>> formulas;
60};
61
62template<typename ValueType>
63std::vector<storm::storage::ParameterRegion<ValueType>> parseRegions(std::shared_ptr<storm::models::ModelBase> const& model) {
64 std::vector<storm::storage::ParameterRegion<ValueType>> result;
66 if (regionSettings.isRegionSet()) {
67 result = storm::api::parseRegions<ValueType>(regionSettings.getRegionString(), *model);
68 } else if (regionSettings.isRegionBoundSet()) {
69 result = storm::api::createRegion<ValueType>(regionSettings.getRegionBoundString(), *model);
70 }
71 return result;
72}
73
74template<typename ValueType>
75std::shared_ptr<storm::models::ModelBase> eliminateScc(std::shared_ptr<storm::models::ModelBase> const& model) {
76 storm::utility::Stopwatch eliminationWatch(true);
77 std::shared_ptr<storm::models::ModelBase> result;
78 if (model->isOfType(storm::models::ModelType::Dtmc)) {
79 STORM_PRINT("Applying scc elimination\n");
80 auto sparseModel = model->as<storm::models::sparse::Model<ValueType>>();
81 auto matrix = sparseModel->getTransitionMatrix();
82 auto backwardsTransitionMatrix = matrix.transpose();
83
86
87 storm::storage::BitVector selectedStates(matrix.getRowCount());
88 storm::storage::BitVector selfLoopStates(matrix.getRowCount());
89 for (size_t i = 0; i < decomposition.size(); ++i) {
90 auto scc = decomposition.getBlock(i);
91 if (scc.size() > 1) {
92 auto statesScc = scc.getStates();
93 std::vector<uint_fast64_t> entryStates;
94 for (auto state : statesScc) {
95 auto row = backwardsTransitionMatrix.getRow(state);
96 bool found = false;
97 for (auto backState : row) {
98 if (!scc.containsState(backState.getColumn())) {
99 found = true;
100 }
101 }
102 if (found) {
103 entryStates.push_back(state);
104 selfLoopStates.set(state);
105 } else {
106 selectedStates.set(state);
107 }
108 }
109
110 if (entryStates.size() != 1) {
111 STORM_LOG_THROW(entryStates.size() > 1, storm::exceptions::NotImplementedException,
112 "State elimination not implemented for scc with more than 1 entry points.");
113 }
114 }
115 }
116
118 storm::storage::FlexibleSparseMatrix<ValueType> flexibleBackwardTransitions(backwardsTransitionMatrix, true);
119 auto actionRewards = std::vector<ValueType>(matrix.getRowCount(), storm::utility::zero<ValueType>());
120 storm::solver::stateelimination::NondeterministicModelStateEliminator<ValueType> stateEliminator(flexibleMatrix, flexibleBackwardTransitions,
121 actionRewards);
122 for (auto state : selectedStates) {
123 stateEliminator.eliminateState(state, true);
124 }
125 for (auto state : selfLoopStates) {
126 auto row = flexibleMatrix.getRow(state);
127 stateEliminator.eliminateLoop(state);
128 }
129 selectedStates.complement();
130 auto keptRows = matrix.getRowFilter(selectedStates);
131 storm::storage::SparseMatrix<ValueType> newTransitionMatrix = flexibleMatrix.createSparseMatrix(keptRows, selectedStates);
132 // TODO @Jip: note that rewards get lost
133 result = std::make_shared<storm::models::sparse::Dtmc<ValueType>>(std::move(newTransitionMatrix),
134 sparseModel->getStateLabeling().getSubLabeling(selectedStates));
135
136 eliminationWatch.stop();
137 STORM_PRINT("\nTime for scc elimination: " << eliminationWatch << ".\n\n");
138 result->printModelInformationToStream(std::cout);
139 } else if (model->isOfType(storm::models::ModelType::Mdp)) {
140 STORM_LOG_THROW(false, storm::exceptions::NotImplementedException,
141 "Unable to perform SCC elimination for monotonicity analysis on MDP: Not implemented.");
142 } else {
143 STORM_LOG_THROW(false, storm::exceptions::InvalidOperationException, "Unable to perform monotonicity analysis on the provided model type.");
144 }
145 return result;
146}
147
148template<typename ValueType>
149std::shared_ptr<storm::models::ModelBase> simplifyModel(std::shared_ptr<storm::models::ModelBase> const& model, cli::SymbolicInput const& input) {
150 storm::utility::Stopwatch simplifyingWatch(true);
151 std::shared_ptr<storm::models::ModelBase> result;
152 if (model->isOfType(storm::models::ModelType::Dtmc)) {
154 *(model->template as<storm::models::sparse::Dtmc<ValueType>>()));
155
156 std::vector<std::shared_ptr<storm::logic::Formula const>> formulas = storm::api::extractFormulasFromProperties(input.properties);
157 STORM_LOG_THROW(formulas.begin() != formulas.end(), storm::exceptions::NotSupportedException, "Only one formula at the time supported.");
158
159 STORM_LOG_THROW(simplifier.simplify(*(formulas[0])), storm::exceptions::UnexpectedException, "Simplifying the model was not successfull.");
160 result = simplifier.getSimplifiedModel();
161 } else if (model->isOfType(storm::models::ModelType::Mdp)) {
163 *(model->template as<storm::models::sparse::Mdp<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 {
171 STORM_LOG_THROW(false, storm::exceptions::InvalidOperationException, "Unable to perform monotonicity analysis on the provided model type.");
172 }
173
174 simplifyingWatch.stop();
175 STORM_PRINT("\nTime for model simplification: " << simplifyingWatch << ".\n\n");
176 result->printModelInformationToStream(std::cout);
177 return result;
178}
179
180template<typename ValueType>
187
188 PreprocessResult result(model, false);
189 // TODO: why only simplify in these modes
190 if (parametricSettings.getOperationMode() == storm::pars::utility::ParametricMode::Monotonicity ||
191 parametricSettings.getOperationMode() == storm::pars::utility::ParametricMode::Feasibility) {
192 STORM_LOG_THROW(!input.properties.empty(), storm::exceptions::InvalidSettingsException, "Simplification requires property to be specified.");
193 result.model = storm::pars::simplifyModel<ValueType>(result.model, input);
194 result.changed = true;
195 }
196
197 if (result.model->isOfType(storm::models::ModelType::MarkovAutomaton)) {
199 result.changed = true;
200 }
201
202 if (mpi.applyBisimulation) {
203 result.model =
204 storm::cli::preprocessSparseModelBisimulation(result.model->template as<storm::models::sparse::Model<ValueType>>(), input, bisimulationSettings);
205 result.changed = true;
206 }
207
208 if (parametricSettings.isLinearToSimpleEnabled()) {
209 STORM_LOG_INFO("Transforming linear to simple...");
211 result.model = transformer.transform(*result.model->template as<storm::models::sparse::Dtmc<RationalFunction>>(), true);
212 result.changed = true;
213 }
214
215 if (parametricSettings.isBigStepEnabled()) {
219 auto bigStepResult = tt.bigStep(*result.model->template as<storm::models::sparse::Dtmc<RationalFunction>>(), checkTask);
220 result.model = std::make_shared<storm::models::sparse::Dtmc<RationalFunction>>(bigStepResult.first);
221
222 if (mpi.applyBisimulation) {
224 bisimulationSettings);
225 }
226 result.changed = true;
227 }
228
229 if (transformationSettings.isChainEliminationSet() && model->isOfType(storm::models::ModelType::MarkovAutomaton)) {
230 // TODO: Why only on MAs?
231 auto eliminationResult =
233 storm::api::extractFormulasFromProperties(input.properties), transformationSettings.getLabelBehavior());
234 result.model = eliminationResult.first;
235 // Set transformed properties as new properties in input
236 result.formulas = eliminationResult.second;
237 result.changed = true;
238 }
239
240 if (parametricSettings.transformContinuousModel() &&
241 (model->isOfType(storm::models::ModelType::Ctmc) || model->isOfType(storm::models::ModelType::MarkovAutomaton))) {
244 result.model = transformResult.first;
245 // Set transformed properties as new properties in input
246 result.formulas = transformResult.second;
247 result.changed = true;
248 }
249
250 if (monSettings.isSccEliminationSet()) {
251 // TODO move this into the API?
253 result.changed = true;
254 }
255
256 return result;
257}
258
259template<storm::dd::DdType DdType, typename ValueType>
263
264 PreprocessResult result(model, false);
265
267 // Currently, hybrid engine for parametric models just refers to building the model symbolically.
268 STORM_LOG_INFO("Translating symbolic model to sparse model...");
270 result.changed = true;
271 // Invoke preprocessing on the sparse model
272 PreprocessResult sparsePreprocessingResult =
274 if (sparsePreprocessingResult.changed) {
275 result.model = sparsePreprocessingResult.model;
276 result.formulas = sparsePreprocessingResult.formulas;
277 }
278 } else {
279 STORM_LOG_ASSERT(mpi.engine == storm::utility::Engine::Dd, "Expected Dd engine.");
280 if (mpi.applyBisimulation) {
282 bisimulationSettings, mpi);
283 result.changed = true;
284 }
285 }
286 return result;
287}
288
289template<storm::dd::DdType DdType, typename ValueType>
290PreprocessResult preprocessModel(std::shared_ptr<storm::models::ModelBase> const& model, cli::SymbolicInput const& input,
292 storm::utility::Stopwatch preprocessingWatch(true);
293
294 PreprocessResult result(model, false);
295 if (model->isSparseModel()) {
297 } else {
298 STORM_LOG_ASSERT(model->isSymbolicModel(), "Unexpected model type.");
300 }
301
302 if (result.changed) {
303 STORM_PRINT_AND_LOG("\nTime for model preprocessing: " << preprocessingWatch << ".\n\n");
304 }
305 return result;
306}
307
308template<typename ValueType>
310 cli::SymbolicInput const& input, std::vector<storm::storage::ParameterRegion<ValueType>> const& regions,
312 STORM_LOG_THROW(regions.size() == 1, storm::exceptions::NotSupportedException, "Region verification is supported for a (single) region only.");
313 storm::storage::ParameterRegion<ValueType> const& region = regions.front();
314 STORM_LOG_THROW(input.properties.size() == 1, storm::exceptions::NotSupportedException, "Region verification is supported for a (single) property only.");
315 auto const& property = input.properties.front();
316
319
320 auto engine = rvs.getRegionCheckEngine();
321 auto const graphPreservationStatus =
323
324 auto splittingStrategy = storm::modelchecker::RegionSplittingStrategy();
325
326 splittingStrategy.heuristic = rvs.getRegionSplittingHeuristic();
327 splittingStrategy.estimateKind = rvs.getRegionSplittingEstimateMethod();
328 if (rvs.isSplittingThresholdSet()) {
329 splittingStrategy.maxSplitDimensions = rvs.getSplittingThreshold();
330 }
331
332 auto parsedDiscreteVars = storm::api::parseVariableList<ValueType>(regionSettings.getDiscreteVariablesString(), *model);
333 std::set<typename storm::storage::ParameterRegion<ValueType>::VariableType> discreteVariables(parsedDiscreteVars.begin(), parsedDiscreteVars.end());
334
335 storm::utility::Stopwatch watch(true);
336
338 model,
339 *(property.getRawFormula()),
340 engine,
341 splittingStrategy,
342 monotonicitySettings,
343 discreteVariables,
344 true, // allow model simplification
345 graphPreservationStatus,
346 false // preconditions not yet validated
347 };
348
350 STORM_PRINT_AND_LOG("Formula is satisfied by all parameter instantiations.\n");
351 } else {
352 STORM_PRINT_AND_LOG("Formula is not satisfied by all parameter instantiations.\n");
353 }
354 STORM_PRINT_AND_LOG("Time for model checking: " << watch << ".\n");
355}
356
357template<typename ValueType>
359 cli::SymbolicInput const& input, std::vector<storm::storage::ParameterRegion<ValueType>> const& regions,
361 uint64_t monThresh = 0) {
362 STORM_LOG_ASSERT(!regions.empty(), "Can not analyze an empty set of regions.");
363 STORM_LOG_THROW(regions.size() == 1, storm::exceptions::NotSupportedException, "Region refinement is not supported for multiple initial regions.");
364 STORM_LOG_THROW(input.properties.size() == 1, storm::exceptions::NotSupportedException, "Region verification is supported for a (single) property only.");
365 auto const& property = input.properties.front();
366
371
372 ValueType refinementThreshold = storm::utility::convertNumber<ValueType>(partitionSettings.getCoverageThreshold());
373 std::optional<uint64_t> optionalDepthLimit;
374 if (partitionSettings.isDepthLimitSet()) {
375 optionalDepthLimit = partitionSettings.getDepthLimit();
376 }
377
379 STORM_PRINT_AND_LOG("Analyzing parameter region " << regions.front());
380
381 auto engine = rvs.getRegionCheckEngine();
382 STORM_PRINT_AND_LOG(" using " << engine);
383
384 auto splittingStrategy = storm::modelchecker::RegionSplittingStrategy();
385
386 splittingStrategy.heuristic = rvs.getRegionSplittingHeuristic();
387 splittingStrategy.estimateKind = rvs.getRegionSplittingEstimateMethod();
388 if (rvs.isSplittingThresholdSet()) {
389 splittingStrategy.maxSplitDimensions = rvs.getSplittingThreshold();
390 }
391
392 auto const graphPreservationStatus =
394
395 auto parsedDiscreteVars = storm::api::parseVariableList<ValueType>(regionSettings.getDiscreteVariablesString(), *model);
396 std::set<typename storm::storage::ParameterRegion<ValueType>::VariableType> discreteVariables(parsedDiscreteVars.begin(), parsedDiscreteVars.end());
397
398 STORM_PRINT_AND_LOG(" and splitting heuristic " << splittingStrategy.heuristic);
399 if (monotonicitySettings.useMonotonicity) {
400 STORM_PRINT_AND_LOG(" with local monotonicity and");
401 }
402
403 STORM_PRINT_AND_LOG(" with iterative refinement until "
404 << (1.0 - partitionSettings.getCoverageThreshold()) * 100.0 << "% is covered."
405 << (partitionSettings.isDepthLimitSet() ? " Depth limit is " + std::to_string(partitionSettings.getDepthLimit()) + "." : "") << '\n');
406
408 storm::utility::Stopwatch watch(true);
409
411 model,
412 storm::api::createTask<ValueType>(property.getRawFormula(), true),
413 engine,
414 splittingStrategy,
415 monotonicitySettings,
416 discreteVariables,
417 true, // allow model simplification
418 graphPreservationStatus,
419 false // preconditions not yet validated
420 };
421 std::unique_ptr<storm::modelchecker::CheckResult> result = storm::api::checkAndRefineRegionWithSparseEngine<ValueType>(
422 env, settings, regions.front(), refinementThreshold, optionalDepthLimit, storm::modelchecker::RegionResultHypothesis::Unknown, monThresh);
423 watch.stop();
425
426 if (parametricSettings.exportResultToFile()) {
427 storm::api::exportRegionCheckResultToFile<ValueType>(result, parametricSettings.exportResultPath());
428 }
429}
430
438
440 storm::exceptions::InvalidSettingsException, "The selected engine is not supported for parametric models.");
441 STORM_LOG_THROW(parSettings.hasOperationModeBeenSet(), storm::exceptions::InvalidSettingsException, "An operation mode must be selected with --mode.");
442 std::shared_ptr<storm::models::ModelBase> model;
443 if (!buildSettings.isNoBuildModelSet()) {
444 model = storm::cli::buildModel(input, ioSettings, mpi);
445 }
446
447 STORM_LOG_THROW(model, storm::exceptions::InvalidSettingsException, "No input model.");
448 if (model) {
449 model->printModelInformationToStream(std::cout);
450 }
451
452 using ValueType = storm::RationalFunction;
453 auto const DdType = storm::dd::DdType::Sylvan;
454 STORM_LOG_THROW(model->supportsParameters(), storm::exceptions::UnexpectedException, "Expected a parametric model.");
455 STORM_LOG_THROW(model->isSparseModel() || model->getDdType().value() == DdType, storm::exceptions::UnexpectedException,
456 "Expected type of model representation.");
457
458 // If minimization is active and the model is parametric, parameters might be minimized away because they are inconsequential.
459 // This is the set of all such inconsequential parameters.
460 std::set<RationalFunctionVariable> omittedParameters;
461
462 if (model) {
463 auto preprocessingResult = storm::pars::preprocessModel<DdType, ValueType>(model, input, mpi);
464 if (preprocessingResult.changed) {
465 if (model->isOfType(models::ModelType::Dtmc) || model->isOfType(models::ModelType::Mdp)) {
466 auto const previousParams = storm::models::sparse::getAllParameters(*model->template as<storm::models::sparse::Model<ValueType>>());
467 auto const currentParams =
468 storm::models::sparse::getAllParameters(*(preprocessingResult.model)->template as<storm::models::sparse::Model<ValueType>>());
469 for (auto const& variable : previousParams) {
470 if (!currentParams.count(variable)) {
471 omittedParameters.insert(variable);
472 }
473 }
474 }
475 model = preprocessingResult.model;
476
477 if (preprocessingResult.formulas) {
478 std::vector<storm::jani::Property> newProperties;
479 for (size_t i = 0; i < preprocessingResult.formulas.get().size(); ++i) {
480 auto formula = preprocessingResult.formulas.get().at(i);
481 STORM_LOG_ASSERT(i < input.properties.size(), "Index " << i << " greater than number of properties.");
482 storm::jani::Property property = input.properties.at(i);
483 newProperties.push_back(storm::jani::Property(property.getName(), formula, property.getUndefinedConstants(), property.getComment()));
484 }
485 input.properties = newProperties;
486 }
487 model->printModelInformationToStream(std::cout);
488 }
489 }
490
491 std::vector<storm::storage::ParameterRegion<ValueType>> regions = parseRegions<ValueType>(model);
492 if (!model) {
493 return;
494 } else {
495 storm::cli::castAndApply(model, [&input](auto const& m) { storm::cli::exportModel(m, input); });
496 }
497
498 // TODO move this.
499 storm::api::MonotonicitySetting monotonicitySettings(parSettings.isUseMonotonicitySet(), false, monSettings.isUsePLABoundsSet());
500 uint64_t monThresh = monSettings.getMonotonicityThreshold();
501
502 auto mode = parSettings.getOperationMode();
504 STORM_LOG_INFO("Solution function mode started.");
505 STORM_LOG_THROW(regions.empty(), storm::exceptions::InvalidSettingsException,
506 "Solution function computations cannot be restricted to specific regions.");
507 STORM_LOG_ERROR_COND(!regionSettings.isAssumeGraphPreservingSet(), "Solution function computations assume graph preservation.");
508
509 if (model->isSparseModel()) {
511 } else {
513 }
515 STORM_LOG_INFO("Monotonicity mode started.");
516 STORM_LOG_THROW(model->isSparseModel(), storm::exceptions::InvalidSettingsException, "Monotonicity analysis is only supported on sparse models.");
517 analyzeMonotonicity(mpi.env, model->as<storm::models::sparse::Model<ValueType>>(), input, regions);
519 STORM_LOG_INFO("Feasibility mode started.");
520 STORM_LOG_THROW(model->isSparseModel(), storm::exceptions::InvalidSettingsException, "Feasibility analysis is only supported on sparse models.");
521 std::vector<std::shared_ptr<storm::logic::Formula const>> formulas = storm::api::extractFormulasFromProperties(input.properties);
522 STORM_LOG_THROW(formulas.size() == 1, storm::exceptions::InvalidSettingsException,
523 "Feasibility analysis is only supported for single-objective properties.");
524 auto formula = formulas[0];
526 createFeasibilitySynthesisTaskFromSettings(formula, regions), omittedParameters, monotonicitySettings);
528 STORM_LOG_INFO("Verification mode started.");
529 STORM_LOG_THROW(input.properties.size() == 1, storm::exceptions::InvalidSettingsException,
530 "Verification analysis is only supported for single-objective properties.");
531 STORM_LOG_THROW(model->isSparseModel(), storm::exceptions::InvalidSettingsException, "Verification analysis is only supported on sparse models.");
532 verifyRegionWithSparseEngine(mpi.env, model->as<storm::models::sparse::Model<ValueType>>(), input, regions, monotonicitySettings);
533
535 STORM_LOG_INFO("Partition mode started.");
536 STORM_LOG_THROW(model->isSparseModel(), storm::exceptions::InvalidSettingsException,
537 "Parameter space partitioning is only supported on sparse models.");
538 STORM_LOG_THROW(regions.size() == 1, storm::exceptions::InvalidSettingsException, "Partitioning requires a (single) initial region.");
539
540 // TODO Partition mode does not support monotonicity. This should generally be possible.
541 // TODO here setting monotone parameters from the outside may actually be useful
542
543 STORM_LOG_ASSERT(!monotonicitySettings.useOnlyGlobalMonotonicity, "Unexpected setting of only using global monotonicity.");
544 STORM_LOG_ASSERT(!monotonicitySettings.useBoundsFromPLA, "Unexpected setting of using bounds from PLA.");
546 monotonicitySettings, monThresh);
548 STORM_LOG_INFO("Sampling mode started.");
549 STORM_LOG_THROW(model->isSparseModel(), storm::exceptions::InvalidSettingsException, "Sampling analysis is currently only supported on sparse models.");
550 // TODO unclear why this only works for sparse models?
551
552 std::string samplesAsString = sampleSettings.getSamples();
554 if (!samplesAsString.empty()) {
555 samples = parseSamples<ValueType>(model, samplesAsString, sampleSettings.isSamplesAreGraphPreservingSet());
556 samples.exact = sampleSettings.isSampleExactSet();
557 }
558 if (!samples.empty()) {
559 STORM_LOG_TRACE("Sampling the model at given points.");
560
561 if (sampleSettings.isSampleDerivativeSet()) {
562 if (samples.exact) {
564 mpi.env, model->as<storm::models::sparse::Model<ValueType>>(), input, samples);
565 } else {
567 input, samples);
568 }
569 } else {
570 if (samples.exact) {
572 mpi.env, model->as<storm::models::sparse::Model<ValueType>>(), input, samples);
573 } else {
575 samples);
576 }
577 }
578 }
579 } else {
580 STORM_LOG_ASSERT(false, "Unknown operation mode.");
581 }
582}
583
586 auto engine = coreSettings.getEngine();
588 engine != storm::utility::Engine::Dd || engine != storm::utility::Engine::Hybrid || coreSettings.getDdLibraryType() == storm::dd::DdType::Sylvan,
589 "The selected DD library does not support parametric models. Switching to Sylvan...");
590
591 // Parse and preprocess symbolic input (PRISM, JANI, properties, etc.)
592 auto symbolicInput = storm::cli::parseSymbolicInput();
594 std::tie(symbolicInput, mpi) = storm::cli::preprocessSymbolicInput(symbolicInput);
598 processInput(std::move(symbolicInput), mpi);
599}
600} // namespace pars
601} // namespace storm
602
606int main(const int argc, const char** argv) {
607 try {
608 return storm::cli::process("Storm-pars", "storm-pars", storm::settings::initializeParsSettings, storm::pars::processOptions, argc, argv);
609 } catch (storm::exceptions::BaseException const& exception) {
610 STORM_LOG_ERROR("An exception caused Storm-pars to terminate. The message of the exception is: " << exception.what());
611 return 1;
612 } catch (std::exception const& exception) {
613 STORM_LOG_ERROR("An unexpected exception occurred and caused Storm-pars to terminate. The message of this exception is: " << exception.what());
614 return 2;
615 }
616}
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:16
This class represents a Markov automaton.
This class represents a (discrete-time) Markov decision process.
Definition Mdp.h:16
Base class for all sparse models.
Definition Model.h:34
storm::storage::SparseMatrix< ValueType > const & getTransitionMatrix() const
Retrieves the matrix representing the transitions of the model.
Definition Model.cpp:226
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:185
std::pair< models::sparse::Dtmc< RationalFunction >, UniPolyAnnotationMap > 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.
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:34
#define STORM_LOG_TRACE(message)
Definition logging.h:22
#define STORM_LOG_ERROR(message)
Definition logging.h:36
#define STORM_LOG_ASSERT(cond, message)
Definition macros.h:9
#define STORM_LOG_WARN_COND(cond, message)
Definition macros.h:54
#define STORM_LOG_ERROR_COND(cond, message)
Definition macros.h:68
#define STORM_LOG_THROW(cond, exception, message)
Definition macros.h:39
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:97
std::unique_ptr< storm::modelchecker::RegionRefinementCheckResult< ValueType > > checkAndRefineRegionWithSparseEngine(Environment const &env, 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:313
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.
bool verifyRegion(Environment const &env, RefinementOptions< ValueType > settings, storm::storage::ParameterRegion< ValueType > const &region)
Verifies whether a region satisfies a property.
Definition region.h:350
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:44
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:64
storm::storage::ParameterRegion< ValueType > createRegion(std::string const &inputString, std::set< typename storm::storage::ParameterRegion< ValueType >::VariableType > const &consideredVariables)
Definition region.h:114
storm::pars::modelchecker::RegionRefinementOptions< ValueType > RefinementOptions
Definition region.h:47
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)
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)
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)
@ 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:757
void parameterSpacePartitioningWithSparseEngine(storm::Environment const &env, 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)
std::shared_ptr< storm::models::ModelBase > simplifyModel(std::shared_ptr< storm::models::ModelBase > const &model, cli::SymbolicInput const &input)
void processOptions()
PreprocessResult preprocessSparseModel(std::shared_ptr< storm::models::sparse::Model< ValueType > > const &model, cli::SymbolicInput const &input, storm::cli::ModelProcessingInformation const &mpi)
void verifyRegionWithSparseEngine(storm::Environment const &env, 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::shared_ptr< storm::models::ModelBase > eliminateScc(std::shared_ptr< storm::models::ModelBase > const &model)
void verifyPropertiesAtSamplePointsWithSparseEngineDerivatives(storm::Environment const &env, std::shared_ptr< storm::models::sparse::Model< ValueType > > const &model, cli::SymbolicInput const &input, SampleInformation< ValueType > const &samples)
Definition sampling.h:233
void computeSolutionFunctionsWithSparseEngine(storm::Environment const &env, std::shared_ptr< storm::models::sparse::Model< ValueType > > const &model, storm::cli::SymbolicInput const &input)
storm::pars::analysis::GraphPreservationStatus establishGraphPreservation(std::shared_ptr< storm::models::ModelBase > const &model, std::vector< storm::storage::ParameterRegion< ValueType > > const &regions, bool graphPreservationRequired)
Determines to what extent the regions are known to be well-defined and graph-preserving.
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:262
void analyzeMonotonicity(storm::Environment const &env, std::shared_ptr< storm::models::sparse::Model< ValueType > > const &model, cli::SymbolicInput const &input, std::vector< storm::storage::ParameterRegion< ValueType > > const &regions)
void computeSolutionFunctionsWithSymbolicEngine(storm::Environment const &env, std::shared_ptr< storm::models::symbolic::Model< DdType, ValueType > > const &model, storm::cli::SymbolicInput const &input)
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 verifyPropertiesAtSamplePointsWithSparseEngine(storm::Environment const &env, std::shared_ptr< storm::models::sparse::Model< ValueType > > const &model, cli::SymbolicInput const &input, SampleInformation< ValueType > const &samples)
Definition sampling.h:245
void processInput(cli::SymbolicInput &&input, storm::cli::ModelProcessingInformation const &mpi)
void performFeasibility(storm::Environment const &env, 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)
PreprocessResult preprocessModel(std::shared_ptr< storm::models::ModelBase > const &model, cli::SymbolicInput const &input, storm::cli::ModelProcessingInformation const &mpi)
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:26
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