53 boost::optional<storm::storage::SymbolicModelDescription>
model;
63 auto buildSettings = storm::settings::getModule<storm::settings::modules::BuildSettings>();
70 boost::optional<std::vector<std::string>> propertyFilter;
75 propertyFilter = boost::none;
78 propertyFilter = std::vector<std::string>();
81 input.
model = std::move(janiInput.first);
83 input.
properties = std::move(janiInput.second);
86 modelParsingWatch.
stop();
87 STORM_PRINT(
"Time for model input parsing: " << modelParsingWatch <<
".\n\n");
92 boost::optional<std::set<std::string>>
const& propertyFilter) {
94 std::vector<storm::jani::Property> newProperties;
112 input.
model = std::move(janiInput.first);
113 input.
properties = std::move(janiInput.second);
114 modelParsingWatch.
stop();
115 STORM_PRINT(
"Time for model input parsing: " << modelParsingWatch <<
".\n\n");
123 input.
model = input.
model.get().preprocess(constantDefinitions);
132 auto ioSettings = storm::settings::getModule<storm::settings::modules::IOSettings>();
133 if (ioSettings.isQvbsInputSet()) {
173 auto hints = storm::settings::getModule<storm::settings::modules::HintSettings>();
175 STORM_LOG_THROW(input.
model.is_initialized(), storm::exceptions::InvalidArgumentException,
"Automatic engine requires a JANI input model.");
176 STORM_LOG_THROW(input.
model->isJaniModel(), storm::exceptions::InvalidArgumentException,
"Automatic engine requires a JANI input model.");
177 std::vector<storm::jani::Property>
const& properties =
179 STORM_LOG_THROW(!properties.empty(), storm::exceptions::InvalidArgumentException,
"Automatic engine requires a property.");
181 "Automatic engine does not support decisions based on multiple properties. Only the first property will be considered.");
184 if (hints.isNumberStatesSet()) {
185 as.
predict(input.
model->asJaniModel(), properties.front(), hints.getNumberStates());
187 as.
predict(input.
model->asJaniModel(), properties.front());
208 std::shared_ptr<SymbolicInput>
const& transformedJaniInput =
nullptr) {
210 auto ioSettings = storm::settings::getModule<storm::settings::modules::IOSettings>();
211 auto coreSettings = storm::settings::getModule<storm::settings::modules::CoreSettings>();
212 auto generalSettings = storm::settings::getModule<storm::settings::modules::GeneralSettings>();
213 auto bisimulationSettings = storm::settings::getModule<storm::settings::modules::BisimulationSettings>();
216 mpi.
engine = coreSettings.getEngine();
222 if (generalSettings.isParametricSet()) {
224 }
else if (generalSettings.isExactSet()) {
234 if (input.
model->isJaniModel()) {
245 janiInput.
model = modelAndProperties.first;
246 if (!modelAndProperties.second.empty()) {
252 if (transformedJaniInput) {
254 *transformedJaniInput = std::move(janiInput);
261 auto checkCompatibleSettings = [&mpi, &input] {
280 STORM_LOG_WARN(
"The settings picked by the automatic engine (engine="
282 <<
") are incompatible with this model. Falling back to default settings.");
302 "Dd-based model builder for Markov Automata is only available for JANI models, automatically converting the input model.");
308 if (bisimulationSettings.useExactArithmeticInDdBisimulation()) {
314 STORM_LOG_WARN(
"Requested using exact arithmetic in Dd bisimulation but no dd bisimulation is applied.");
319 mpi.
ddType = coreSettings.getDdLibraryType();
323 STORM_LOG_INFO(
"Switching to DD library sylvan to allow for rational arithmetic.");
330auto castAndApply(std::shared_ptr<storm::models::ModelBase>
const& model,
auto const& callback) {
334 auto castAndApplyImpl = [&model, &callback]<
typename TargetModelType> {
335 auto res = model->template as<TargetModelType>();
337 return callback(res);
341 auto castAndApplyVT = [&]<
typename ValueType> {
342 if (model->isSparseModel()) {
346 STORM_LOG_ASSERT(model->isSymbolicModel() && ddType.has_value(),
"Unexpected model representation");
347 if constexpr (storm::IsIntervalType<ValueType>) {
349 STORM_LOG_THROW(
false, storm::exceptions::NotSupportedException,
"Symbolic interval models are currently not supported.");
352 if (*ddType == CUDD) {
353 if constexpr (std::is_same_v<ValueType, double>) {
364 if (model->supportsParameters()) {
366 }
else if (model->isExact()) {
367 return castAndApplyVT.template operator()<storm::RationalNumber>();
368 }
else if (model->supportsUncertainty()) {
371 return castAndApplyVT.template operator()<
double>();
378 case FinitePrecision:
379 return callback.template operator()<
double>();
381 return callback.template operator()<storm::RationalNumber>();
385 STORM_LOG_THROW(
false, storm::exceptions::UnexpectedException,
"Unexpected value type.");
393 STORM_LOG_THROW(vt == FinitePrecision, storm::exceptions::UnexpectedException,
"Unexpected value type for DD library Cudd.");
394 return callback.template operator()<CUDD,
double>();
397 case FinitePrecision:
398 return callback.template operator()<
Sylvan,
double>();
400 return callback.template operator()<
Sylvan, storm::RationalNumber>();
405 STORM_LOG_THROW(
false, storm::exceptions::UnexpectedException,
"Unexpected DDType or value type.");
410 for (
auto const& property : properties) {
411 std::set<storm::expressions::Variable> usedUndefinedConstants =
property.getUndefinedConstants();
412 if (!usedUndefinedConstants.empty()) {
413 std::vector<std::string> undefinedConstantsNames;
414 for (
auto const& constant : usedUndefinedConstants) {
415 undefinedConstantsNames.emplace_back(constant.getName());
418 false, storm::exceptions::InvalidArgumentException,
419 "The property '" << property <<
" still refers to the undefined constants " << boost::algorithm::join(undefinedConstantsNames,
",") <<
".");
425 auto ioSettings = storm::settings::getModule<storm::settings::modules::IOSettings>();
430 if (ioSettings.isPropertiesAsMultiSet()) {
432 "Can not translate properties to multi-objective formula because no properties were specified.");
434 auto multiObjSettings = storm::settings::getModule<storm::settings::modules::MultiObjectiveSettings>();
439 std::string constantDefinitionString = ioSettings.getConstantDefinitionString();
440 std::map<storm::expressions::Variable, storm::expressions::Expression> constantDefinitions;
442 constantDefinitions = output.
model.get().parseConstantDefinitions(constantDefinitionString);
443 output.
model = output.
model.get().preprocess(constantDefinitions);
449 auto transformedJani = std::make_shared<SymbolicInput>();
453 if (output.
model && output.
model.get().isPrismProgram()) {
455 if (transformedJani->model) {
457 output = std::move(*transformedJani);
462 output.
model = modelAndProperties.first;
464 if (!modelAndProperties.second.empty()) {
471 if (output.
model && output.
model.get().isJaniModel()) {
475 const auto& buildSettings = storm::settings::getModule<storm::settings::modules::BuildSettings>();
476 if (buildSettings.isLocationEliminationSet()) {
477 auto locationHeuristic = buildSettings.getLocationEliminationLocationHeuristic();
478 auto edgesHeuristic = buildSettings.getLocationEliminationEdgesHeuristic();
480 locationHeuristic, edgesHeuristic));
484 return {output, mpi};
488 auto ioSettings = storm::settings::getModule<storm::settings::modules::IOSettings>();
489 if (input.
model && input.
model.get().isJaniModel()) {
491 if (ioSettings.isExportJaniDotSet()) {
497inline std::vector<std::shared_ptr<storm::logic::Formula const>>
createFormulasToRespect(std::vector<storm::jani::Property>
const& properties) {
500 for (
auto const& property : properties) {
501 if (!property.getFilter().getStatesFormula()->isInitialFormula()) {
502 result.push_back(property.getFilter().getStatesFormula());
509template<storm::dd::DdType DdType,
typename ValueType>
512 auto numThreads = storm::settings::getModule<storm::settings::modules::SylvanSettings>().getNumberOfThreads();
515 auto buildSettings = storm::settings::getModule<storm::settings::modules::BuildSettings>();
517 !buildSettings.isApplyNoMaximumProgressAssumptionSet());
521 auto buildSettings = storm::settings::getModule<storm::settings::modules::BuildSettings>();
529 auto counterexampleGeneratorSettings = storm::settings::getModule<storm::settings::modules::CounterexampleGeneratorSettings>();
530 if (counterexampleGeneratorSettings.isCounterexampleSet()) {
531 buildChoiceOrigins |= counterexampleGeneratorSettings.isMinimalCommandSetGenerationSet();
536 if (buildSettings.isApplyNoMaximumProgressAssumptionSet()) {
540 if (buildSettings.isExplorationChecksSet()) {
546 if (buildSettings.isBuildFullModelSet()) {
553 if (buildSettings.isAddOverlappingGuardsLabelSet()) {
557 auto ioSettings = storm::settings::getModule<storm::settings::modules::IOSettings>();
558 if (ioSettings.isComputeExpectedVisitingTimesSet() || ioSettings.isComputeSteadyStateDistributionSet()) {
564template<
typename ValueType>
567 if (!storm::IsIntervalType<ValueType> && input.
model.is_initialized() && input.
model->isPrismProgram() &&
568 input.
model->asPrismProgram().hasIntervalUpdates()) {
570 "Can not build interval model for the provided value type.");
571 return storm::api::buildSparseModel<storm::Interval>(input.
model.get(), options);
573 return storm::api::buildSparseModel<ValueType>(input.
model.get(), options);
577template<
typename ValueType>
580 std::shared_ptr<storm::models::ModelBase> result;
582 result = storm::api::buildExplicitModel<ValueType>(
592 if constexpr (std::is_same_v<ValueType, double>) {
594 }
else if constexpr (std::is_same_v<ValueType, storm::RationalNumber>) {
595 valueType = Rational;
597 static_assert(std::is_same_v<ValueType, storm::RationalFunction>,
"Unexpected value type.");
598 valueType = Parametric;
612 std::shared_ptr<storm::models::ModelBase> result;
619 auto options = createBuildOptionsSparseFromSettings(input);
620 return buildModelSparse<VT>(input, options);
625 "Can only use sparse engine with explicit input.");
627 return buildModelExplicit<VT>(ioSettings, storm::settings::getModule<storm::settings::modules::BuildSettings>());
631 modelBuildingWatch.
stop();
633 STORM_PRINT(
"Time for model construction: " << modelBuildingWatch <<
".\n\n");
639template<
typename ValueType>
642 auto transformationSettings = storm::settings::getModule<storm::settings::modules::TransformationSettings>();
643 auto debugSettings = storm::settings::getModule<storm::settings::modules::DebugSettings>();
645 std::shared_ptr<storm::models::sparse::Model<ValueType>> result = model;
648 "MA contains a Zeno cycle. Model checking results cannot be trusted.");
650 if (model->isConvertibleToCtmc()) {
652 result = model->convertToCtmc();
655 if (transformationSettings.isChainEliminationSet()) {
656 if constexpr (storm::IsIntervalType<ValueType>) {
658 STORM_LOG_THROW(
false, storm::exceptions::NotSupportedException,
"Chain elimination not supported for interval models.");
662 transformationSettings.getLabelBehavior())
670template<
typename ValueType>
683template<
typename ValueType>
687 "Converting value types for sparse engine is not supported.");
688 auto bisimulationSettings = storm::settings::getModule<storm::settings::modules::BisimulationSettings>();
689 auto ioSettings = storm::settings::getModule<storm::settings::modules::IOSettings>();
690 auto transformationSettings = storm::settings::getModule<storm::settings::modules::TransformationSettings>();
692 std::pair<std::shared_ptr<storm::models::sparse::Model<ValueType>>,
bool> result = std::make_pair(model,
false);
694 if (
auto order = transformationSettings.getModelPermutation(); order.has_value()) {
695 auto seed = transformationSettings.getModelPermutationSeed();
697 << (seed.has_value() ?
" with seed " + std::to_string(seed.value()) :
"") <<
".\n");
699 result.second =
true;
700 STORM_PRINT_AND_LOG(
"Transition matrix hash after permuting: " << result.first->getTransitionMatrix().hash() <<
".\n");
705 result.second =
true;
709 if constexpr (storm::IsIntervalType<ValueType>) {
710 STORM_LOG_THROW(
false, storm::exceptions::NotSupportedException,
"Bisimulation not supported for interval models.");
713 result.second =
true;
717 if (transformationSettings.isToDiscreteTimeModelSet()) {
718 if constexpr (storm::IsIntervalType<ValueType>) {
719 STORM_LOG_THROW(
false, storm::exceptions::NotSupportedException,
"Transformation to discrete time model not supported for interval models.");
723 !model->hasRewardModel(
"_time"),
724 "Scheduled transformation to discrete time model, but a reward model named '_time' is already present in this model. We might take "
725 "the wrong reward model later.");
729 result.second =
true;
733 if (transformationSettings.isToNondeterministicModelSet()) {
734 result.first = storm::api::transformToNondeterministicModel<ValueType>(std::move(*result.first));
735 result.second =
true;
741template<
typename ValueType>
743 auto ioSettings = storm::settings::getModule<storm::settings::modules::IOSettings>();
745 if (ioSettings.isExportBuildSet()) {
747 modelExportWatch.
start();
748 STORM_PRINT(
"\nExporting model to '" << ioSettings.getExportBuildFilename() <<
"'.\n");
749 switch (ioSettings.getExportBuildFormat()) {
756 options.
compression = ioSettings.getCompressionMode();
757 if (ioSettings.isExportDigitsSet()) {
761 input.
model ? input.
model.get().getParameterNames() : std::vector<std::string>());
769 "Exporting sparse models in " <<
storm::io::toString(ioSettings.getExportBuildFormat()) <<
" format is not supported.");
771 modelExportWatch.
stop();
772 STORM_PRINT(
"Time for model export: " << modelExportWatch <<
".\n\n");
777 if (ioSettings.isExportExplicitSet()) {
779 input.
model ? input.
model.get().getParameterNames() : std::vector<std::string>(),
780 !ioSettings.isExplicitExportPlaceholdersDisabled());
783 if (ioSettings.isExportDdSet()) {
784 STORM_LOG_THROW(
false, storm::exceptions::NotSupportedException,
"Exporting in drdd format is only supported for DDs.");
787 if (ioSettings.isExportDotSet()) {
792template<storm::dd::DdType DdType,
typename ValueType>
794 auto ioSettings = storm::settings::getModule<storm::settings::modules::IOSettings>();
796 if (ioSettings.isExportBuildSet()) {
797 switch (ioSettings.getExportBuildFormat()) {
806 "Exporting symbolic models in " <<
storm::io::toString(ioSettings.getExportBuildFormat()) <<
" format is not supported.");
812 if (ioSettings.isExportExplicitSet()) {
813 STORM_LOG_THROW(
false, storm::exceptions::NotSupportedException,
"Exporting in drn format is only supported for sparse models.");
816 if (ioSettings.isExportDdSet()) {
820 if (ioSettings.isExportDotSet()) {
825template<storm::dd::DdType DdType,
typename ValueType>
826typename std::enable_if<DdType != storm::dd::DdType::Sylvan && !std::is_same<ValueType, double>::value, std::shared_ptr<storm::models::Model<ValueType>>>::type
831template<storm::dd::DdType DdType,
typename ValueType>
832typename std::enable_if<DdType == storm::dd::DdType::Sylvan || std::is_same<ValueType, double>::value, std::shared_ptr<storm::models::Model<ValueType>>>::type
834 auto ma = model->template as<storm::models::symbolic::MarkovAutomaton<DdType, ValueType>>();
835 if (!ma->isClosed()) {
836 return std::make_shared<storm::models::symbolic::MarkovAutomaton<DdType, ValueType>>(ma->close());
842template<storm::dd::DdType DdType,
typename ValueType,
typename ExportValueType = ValueType>
847 "Weak bisimulation is currently not supported on DDs. Falling back to strong bisimulation.");
852 STORM_LOG_INFO(
"Setting bisimulation quotient format to 'sparse'.");
856 return storm::api::performBisimulationMinimization<DdType, ValueType, ExportValueType>(
860template<
typename ExportValueType, storm::dd::DdType DdType,
typename ValueType>
863 auto bisimulationSettings = storm::settings::getModule<storm::settings::modules::BisimulationSettings>();
864 std::pair<std::shared_ptr<storm::models::Model<ValueType>>,
bool> intermediateResult = std::make_pair(model,
false);
868 intermediateResult.second =
true;
871 std::unique_ptr<std::pair<std::shared_ptr<storm::models::Model<ExportValueType>>,
bool>> result;
872 auto symbolicModel = intermediateResult.first->template as<storm::models::symbolic::Model<DdType, ValueType>>();
874 std::shared_ptr<storm::models::Model<ExportValueType>> newModel =
875 preprocessDdModelBisimulation<DdType, ValueType, ExportValueType>(symbolicModel, input, bisimulationSettings, mpi);
876 result = std::make_unique<std::pair<std::shared_ptr<storm::models::Model<ExportValueType>>,
bool>>(newModel,
true);
878 result = std::make_unique<std::pair<std::shared_ptr<storm::models::Model<ExportValueType>>,
bool>>(
879 symbolicModel->template toValueType<ExportValueType>(), !std::is_same<ValueType, ExportValueType>::value);
884 result->second =
true;
886 std::shared_ptr<storm::models::symbolic::Model<DdType, ExportValueType>> symbolicModel =
887 result->first->template as<storm::models::symbolic::Model<DdType, ExportValueType>>();
888 std::vector<std::shared_ptr<storm::logic::Formula const>> formulas;
889 for (
auto const& property : input.
properties) {
890 formulas.emplace_back(property.getRawFormula());
893 STORM_LOG_THROW(result, storm::exceptions::NotSupportedException,
"The translation to a sparse model is not supported for the given model type.");
899template<storm::dd::DdType DdType,
typename ValueType>
904 if constexpr (std::is_same_v<ValueType, VT> ||
905 (DdType == storm::dd::DdType::Sylvan && std::is_same_v<ValueType, storm::RationalNumber> && std::is_same_v<VT, double>)) {
906 return preprocessDdModelImpl<VT>(model, input, mpi);
908 STORM_LOG_THROW(false, storm::exceptions::NotSupportedException,
909 "Unexpected combination of DD library, build value type, and verification value type.");
919 if (counterexample) {
922 STORM_PRINT(
"Time for computation: " << *watch <<
".\n");
929template<
typename ModelType>
930 requires(!std::derived_from<ModelType, storm::models::sparse::Model<double>>)
932 STORM_LOG_THROW(
false, storm::exceptions::NotSupportedException,
"Counterexample generation is not supported for this data-type.");
935template<
typename ModelType>
936 requires(std::derived_from<ModelType, storm::models::sparse::Model<double>>)
938 using ValueType =
typename ModelType::ValueType;
940 for (
auto& rewModel : sparseModel->getRewardModels()) {
941 rewModel.second.reduceToStateBasedRewards(sparseModel->getTransitionMatrix(),
true);
945 storm::exceptions::NotSupportedException,
"Counterexample is currently only supported for discrete-time models.");
947 auto counterexampleSettings = storm::settings::getModule<storm::settings::modules::CounterexampleGeneratorSettings>();
948 if (counterexampleSettings.isMinimalCommandSetGenerationSet()) {
949 bool useMilp = counterexampleSettings.isUseMilpBasedMinimalCommandSetGenerationSet();
950 for (
auto const& property : input.
properties) {
951 std::shared_ptr<storm::counterexamples::Counterexample> counterexample;
956 "Counterexample generation using MILP is currently only supported for MDPs.");
961 storm::exceptions::NotSupportedException,
962 "Counterexample generation using MaxSAT is currently only supported for discrete-time models.");
975 }
else if (counterexampleSettings.isShortestPathGenerationSet()) {
976 for (
auto const& property : input.
properties) {
977 std::shared_ptr<storm::counterexamples::Counterexample> counterexample;
981 "Counterexample generation using shortest paths is currently only supported for DTMCs.");
983 property.getRawFormula(), counterexampleSettings.getShortestPathMaxK());
988 STORM_LOG_THROW(
false, storm::exceptions::NotSupportedException,
"The selected counterexample formalism is unsupported.");
992template<
typename ValueType>
993 requires(!storm::IsIntervalType<ValueType>)
995 if (result->isQuantitative()) {
999 ValueType resultValue;
1002 resultValue = result->asQuantitativeCheckResult<ValueType>().sum();
1005 resultValue = result->asQuantitativeCheckResult<ValueType>().average();
1008 resultValue = result->asQuantitativeCheckResult<ValueType>().getMin();
1011 resultValue = result->asQuantitativeCheckResult<ValueType>().getMax();
1015 STORM_LOG_THROW(
false, storm::exceptions::NotSupportedException,
"Outputting states is not supported.");
1019 STORM_LOG_THROW(
false, storm::exceptions::InvalidArgumentException,
"Filter type only defined for qualitative results.");
1021 STORM_LOG_THROW(
false, storm::exceptions::InvalidArgumentException,
"Unhandled filter type.");
1024 STORM_PRINT(resultValue <<
" (approx. " << storm::utility::convertNumber<double>(resultValue) <<
")");
1035 STORM_PRINT(result->asQualitativeCheckResult().existsTrue());
1038 STORM_PRINT(result->asQualitativeCheckResult().forallTrue());
1041 STORM_PRINT(result->asQualitativeCheckResult().count());
1045 STORM_LOG_THROW(
false, storm::exceptions::NotSupportedException,
"Outputting states is not supported.");
1050 STORM_LOG_THROW(
false, storm::exceptions::InvalidArgumentException,
"Filter type only defined for quantitative results.");
1060template<
typename ValueType>
1061 requires(!storm::IsIntervalType<ValueType>)
1065 std::stringstream ss;
1066 ss <<
"'" << filterStatesFormula <<
"'";
1068 <<
" (for " << (filterStatesFormula.isInitialFormula() ?
"initial" : ss.str()) <<
" states): ");
1069 printFilteredResult<ValueType>(result, filterType);
1071 STORM_PRINT(
"Time for model checking: " << *watch <<
".\n");
1074 STORM_LOG_ERROR(
"Property is unsupported by selected engine/settings.\n");
1078template<
typename ValueType>
1084using VerificationCallbackType = std::function<std::unique_ptr<storm::modelchecker::CheckResult>(std::shared_ptr<storm::logic::Formula const>
const& formula,
1085 std::shared_ptr<storm::logic::Formula const>
const& states)>;
1089 void operator()(std::unique_ptr<storm::modelchecker::CheckResult>
const&) {
1100template<
typename ValueType>
1101std::unique_ptr<storm::modelchecker::CheckResult>
verifyProperty(std::shared_ptr<storm::logic::Formula const>
const& formula,
1102 std::shared_ptr<storm::logic::Formula const>
const& statesFilter,
1104 auto transformationSettings = storm::settings::getModule<storm::settings::modules::TransformationSettings>();
1107 if constexpr (storm::IsIntervalType<ValueType>) {
1108 STORM_LOG_ASSERT(!transformationSettings.isChainEliminationSet() && !transformationSettings.isToNondeterministicModelSet(),
1109 "Unsupported transformation has been invoked.");
1110 return verificationCallback(formula, statesFilter);
1113 STORM_LOG_WARN(
"Property is not preserved by elimination of non-markovian states.");
1114 }
else if (transformationSettings.isToDiscreteTimeModelSet()) {
1115 auto transformedFormula = storm::api::checkAndTransformContinuousToDiscreteTimeFormula<ValueType>(*formula);
1116 auto transformedStatesFilter = storm::api::checkAndTransformContinuousToDiscreteTimeFormula<ValueType>(*statesFilter);
1117 if (transformedFormula && transformedStatesFilter) {
1119 return verificationCallback(transformedFormula, transformedStatesFilter);
1121 STORM_LOG_WARN(
"Property is not preserved by transformation to discrete time model.");
1125 return verificationCallback(formula, statesFilter);
1139template<
typename ValueType>
1143 for (
auto const& property : properties) {
1146 auto result = verifyProperty<ValueType>(property.getRawFormula(), property.getFilter().getStatesFormula(), verificationCallback);
1149 postprocessingCallback(result);
1151 printResult<storm::IntervalBaseType<ValueType>>(result, property, &watch);
1164template<
typename ValueType>
1165void computeStateValues(std::string
const& description, std::function<std::unique_ptr<storm::modelchecker::CheckResult>()>
const& computationCallback,
1170 STORM_PRINT(
"\nComputing " << description <<
" ...\n");
1171 std::unique_ptr<storm::modelchecker::CheckResult> result;
1173 result = computationCallback();
1184 postprocessingCallback(result);
1189 for (uint64_t propertyIndex = 0; propertyIndex < properties.size(); ++propertyIndex) {
1190 auto const&
property = properties[propertyIndex];
1192 if (!property.getRawFormula()->hasQualitativeResult()) {
1194 <<
"' can not be used for filtering states as it does not have a qualitative result.");
1201 if (propertyFilter) {
1203 std::unique_ptr<storm::modelchecker::CheckResult> filteredResult = result->clone();
1204 filteredResult->filter(propertyFilter->asQualitativeCheckResult());
1205 postprocessingCallback(filteredResult);
1206 printResult<ValueType>(filteredResult, *property.getRawFormula(), property.getFilter().getFilterType(),
1207 propertyIndex == properties.size() - 1 ? &watch :
nullptr);
1214 std::string
const& constraintsString) {
1215 std::vector<storm::expressions::Expression> constraints;
1217 std::vector<std::string> constraintsAsStrings;
1218 boost::split(constraintsAsStrings, constraintsString, boost::is_any_of(
","));
1221 std::unordered_map<std::string, storm::expressions::Expression> variableMapping;
1222 for (
auto const& variableTypePair : expressionManager) {
1223 variableMapping[variableTypePair.first.getName()] = variableTypePair.first;
1227 for (
auto const& constraintString : constraintsAsStrings) {
1228 if (constraintString.empty()) {
1233 STORM_LOG_TRACE(
"Adding special (user-provided) constraint " << constraint <<
".");
1234 constraints.emplace_back(constraint);
1242 std::vector<std::vector<storm::expressions::Expression>> injectedRefinementPredicates;
1245 std::unordered_map<std::string, storm::expressions::Expression> variableMapping;
1246 for (
auto const& variableTypePair : expressionManager) {
1247 variableMapping[variableTypePair.first.getName()] = variableTypePair.first;
1251 std::vector<std::string> predicateGroupsAsStrings;
1252 boost::split(predicateGroupsAsStrings, refinementPredicatesString, boost::is_any_of(
";"));
1254 if (!predicateGroupsAsStrings.empty()) {
1255 for (
auto const& predicateGroupString : predicateGroupsAsStrings) {
1256 if (predicateGroupString.empty()) {
1260 std::vector<std::string> predicatesAsStrings;
1261 boost::split(predicatesAsStrings, predicateGroupString, boost::is_any_of(
":"));
1263 if (!predicatesAsStrings.empty()) {
1264 injectedRefinementPredicates.emplace_back();
1265 for (
auto const& predicateString : predicatesAsStrings) {
1267 STORM_LOG_TRACE(
"Adding special (user-provided) refinement predicate " << predicateString <<
".");
1268 injectedRefinementPredicates.back().emplace_back(predicate);
1271 STORM_LOG_THROW(!injectedRefinementPredicates.back().empty(), storm::exceptions::InvalidArgumentException,
1272 "Expecting non-empty list of predicates to inject for each (mentioned) refinement step.");
1275 std::reverse(injectedRefinementPredicates.back().begin(), injectedRefinementPredicates.back().end());
1280 std::reverse(injectedRefinementPredicates.begin(), injectedRefinementPredicates.end());
1283 return injectedRefinementPredicates;
1286template<storm::dd::DdType DdType,
typename ValueType>
1294 verifyProperties<ValueType>(input, [&input, &options, &mpi](std::shared_ptr<storm::logic::Formula const>
const& formula,
1295 std::shared_ptr<storm::logic::Formula const>
const& states) {
1296 STORM_LOG_THROW(states->isInitialFormula(), storm::exceptions::NotSupportedException,
"Abstraction-refinement can only filter initial states.");
1297 return storm::gbar::api::verifyWithAbstractionRefinementEngine<DdType, ValueType>(mpi.
env, input.
model.get(),
1298 storm::api::createTask<ValueType>(formula,
true), options);
1302template<
typename ValueType>
1305 STORM_LOG_THROW((std::is_same<ValueType, double>::value), storm::exceptions::NotSupportedException,
1306 "Exploration does not support other data-types than floating points.");
1307 verifyProperties<ValueType>(
1308 input, [&input, &mpi](std::shared_ptr<storm::logic::Formula const>
const& formula, std::shared_ptr<storm::logic::Formula const>
const& states) {
1309 STORM_LOG_THROW(states->isInitialFormula(), storm::exceptions::NotSupportedException,
"Exploration can only filter initial states.");
1310 return storm::api::verifyWithExplorationEngine<ValueType>(mpi.
env, input.
model.get(), storm::api::createTask<ValueType>(formula,
true));
1314template<
typename ValueType>
1317 auto const& ioSettings = storm::settings::getModule<storm::settings::modules::IOSettings>();
1318 auto verificationCallback = [&sparseModel, &ioSettings, &mpi](std::shared_ptr<storm::logic::Formula const>
const& formula,
1319 std::shared_ptr<storm::logic::Formula const>
const& states) {
1320 auto createTask = [&ioSettings](
auto const& f,
bool onlyInitialStates) {
1321 if constexpr (storm::IsIntervalType<ValueType>) {
1322 STORM_LOG_THROW(ioSettings.isUncertaintyResolutionModeSet(), storm::exceptions::InvalidSettingsException,
1323 "Uncertainty resolution mode required for uncertain (interval) models.");
1324 return storm::api::createTask<ValueType>(f,
storm::solver::convert(ioSettings.getUncertaintyResolutionMode()), onlyInitialStates);
1327 return storm::api::createTask<ValueType>(f, onlyInitialStates);
1330 bool const filterForInitialStates = states->isInitialFormula();
1331 auto task = createTask(formula, filterForInitialStates);
1332 if (ioSettings.isExportSchedulerSet()) {
1333 task.setProduceSchedulers(
true);
1335 std::unique_ptr<storm::modelchecker::CheckResult> result = storm::api::verifyWithSparseEngine<ValueType>(mpi.
env, sparseModel, task);
1337 std::unique_ptr<storm::modelchecker::CheckResult> filter;
1338 if (filterForInitialStates) {
1339 filter = std::make_unique<storm::modelchecker::ExplicitQualitativeCheckResult>(sparseModel->getInitialStates());
1340 }
else if (!states->isTrueFormula()) {
1341 filter = storm::api::verifyWithSparseEngine<ValueType>(mpi.
env, sparseModel, createTask(states,
false));
1343 if (result && filter) {
1344 result->filter(filter->asQualitativeCheckResult());
1348 uint64_t exportCount = 0;
1349 auto postprocessingCallback = [&sparseModel, &ioSettings, &input, &exportCount](std::unique_ptr<storm::modelchecker::CheckResult>
const& result) {
1351 STORM_LOG_WARN_COND(!ioSettings.isExportSchedulerSet() || result->hasScheduler(),
"Scheduler requested but could not be generated.");
1352 if (ioSettings.isExportSchedulerSet() && result->hasScheduler()) {
1353 std::filesystem::path schedulerExportPath = ioSettings.getExportSchedulerFilename();
1354 if (exportCount > 0) {
1355 STORM_LOG_WARN(
"Prepending " << exportCount <<
" to scheduler file name for this property because there are multiple properties.");
1356 schedulerExportPath.replace_filename(std::to_string(exportCount) + schedulerExportPath.filename().string());
1361 "No information of state valuations available. The scheduler output will use internal state ids. You might be "
1362 "interested in building the model with state valuations using --buildstateval.");
1364 sparseModel->hasChoiceLabeling() || sparseModel->hasChoiceOrigins(),
1365 "No symbolic choice information is available. The scheduler output will use internal choice ids. You might be interested in "
1366 "building the model with choice labels or choice origins using --buildchoicelab or --buildchoiceorig.");
1368 "Only partial choice information is available. You might want to build the model with choice origins using "
1369 "--buildchoicelab or --buildchoiceorig.");
1371 if (result->isExplicitQuantitativeCheckResult()) {
1372 if constexpr (storm::IsIntervalType<ValueType>) {
1373 STORM_LOG_THROW(
false, storm::exceptions::NotSupportedException,
"Scheduler export for interval models is not supported.");
1376 schedulerExportPath.string());
1378 }
else if (result->isExplicitParetoCurveCheckResult()) {
1379 if constexpr (std::is_same_v<ValueType, storm::RationalFunction> || storm::IsIntervalType<ValueType>) {
1380 STORM_LOG_THROW(
false, storm::exceptions::NotSupportedException,
"Scheduler export for models of this value type is not supported.");
1382 auto const& paretoRes = result->template asExplicitParetoCurveCheckResult<ValueType>();
1386 STORM_LOG_THROW(
false, storm::exceptions::NotSupportedException,
"Scheduler export not supported for this value type.");
1391 if (ioSettings.isExportCheckResultSet()) {
1392 if constexpr (storm::IsIntervalType<ValueType>) {
1393 STORM_LOG_THROW(
false, storm::exceptions::NotSupportedException,
"Result export for interval models is not supported.");
1395 std::filesystem::path resultExportPath = ioSettings.getExportCheckResultFilename();
1396 if (exportCount > 0) {
1397 STORM_LOG_WARN(
"Prepending " << exportCount <<
" to result file name for this property because there are multiple properties.");
1398 resultExportPath.replace_filename(std::to_string(exportCount) + resultExportPath.filename().string());
1401 "No information of state valuations available. The result output will use internal state ids. You might be interested in "
1402 "building the model with state valuations using --buildstateval.");
1408 if (!(ioSettings.isComputeSteadyStateDistributionSet() || ioSettings.isComputeExpectedVisitingTimesSet())) {
1409 verifyProperties<ValueType>(input, verificationCallback, postprocessingCallback);
1411 if (ioSettings.isComputeSteadyStateDistributionSet()) {
1412 if constexpr (storm::IsIntervalType<ValueType>) {
1413 STORM_LOG_THROW(
false, storm::exceptions::NotSupportedException,
"Computing steady state distribution is not supported for interval models.");
1415 computeStateValues<ValueType>(
1416 "steady-state probabilities",
1417 [&mpi, &sparseModel]() {
return storm::api::computeSteadyStateDistributionWithSparseEngine<ValueType>(mpi.
env, sparseModel); }, input,
1418 verificationCallback, postprocessingCallback);
1421 if (ioSettings.isComputeExpectedVisitingTimesSet()) {
1422 if constexpr (storm::IsIntervalType<ValueType>) {
1423 STORM_LOG_THROW(
false, storm::exceptions::NotSupportedException,
"Computing expected visiting times is not supported for interval models.");
1425 computeStateValues<ValueType>(
1426 "expected visiting times",
1427 [&mpi, &sparseModel]() {
return storm::api::computeExpectedVisitingTimesWithSparseEngine<ValueType>(mpi.
env, sparseModel); }, input,
1428 verificationCallback, postprocessingCallback);
1433template<storm::dd::DdType DdType,
typename ValueType>
1436 verifyProperties<ValueType>(
1437 input, [&symbolicModel, &mpi](std::shared_ptr<storm::logic::Formula const>
const& formula, std::shared_ptr<storm::logic::Formula const>
const& states) {
1438 bool filterForInitialStates = states->isInitialFormula();
1439 auto task = storm::api::createTask<ValueType>(formula, filterForInitialStates);
1441 std::unique_ptr<storm::modelchecker::CheckResult> result = storm::api::verifyWithHybridEngine<DdType, ValueType>(mpi.
env, symbolicModel, task);
1443 std::unique_ptr<storm::modelchecker::CheckResult> filter;
1444 if (filterForInitialStates) {
1445 filter = std::make_unique<storm::modelchecker::SymbolicQualitativeCheckResult<DdType>>(symbolicModel->getReachableStates(),
1446 symbolicModel->getInitialStates());
1447 }
else if (!states->isTrueFormula()) {
1448 filter = storm::api::verifyWithHybridEngine<DdType, ValueType>(mpi.
env, symbolicModel, storm::api::createTask<ValueType>(states,
false));
1450 if (result && filter) {
1451 result->filter(filter->asQualitativeCheckResult());
1457template<storm::dd::DdType DdType,
typename ValueType>
1460 verifyProperties<ValueType>(
1461 input, [&symbolicModel, &mpi](std::shared_ptr<storm::logic::Formula const>
const& formula, std::shared_ptr<storm::logic::Formula const>
const& states) {
1462 bool filterForInitialStates = states->isInitialFormula();
1463 auto task = storm::api::createTask<ValueType>(formula, filterForInitialStates);
1465 std::unique_ptr<storm::modelchecker::CheckResult> result =
1466 storm::api::verifyWithDdEngine<DdType, ValueType>(mpi.
env, symbolicModel, storm::api::createTask<ValueType>(formula,
true));
1468 std::unique_ptr<storm::modelchecker::CheckResult> filter;
1469 if (filterForInitialStates) {
1470 filter = std::make_unique<storm::modelchecker::SymbolicQualitativeCheckResult<DdType>>(symbolicModel->getReachableStates(),
1471 symbolicModel->getInitialStates());
1472 }
else if (!states->isTrueFormula()) {
1473 filter = storm::api::verifyWithDdEngine<DdType, ValueType>(mpi.
env, symbolicModel, storm::api::createTask<ValueType>(states,
false));
1475 if (result && filter) {
1476 result->filter(filter->asQualitativeCheckResult());
1482template<storm::dd::DdType DdType,
typename ValueType>
1485 verifyProperties<ValueType>(
1486 input, [&symbolicModel, &mpi](std::shared_ptr<storm::logic::Formula const>
const& formula, std::shared_ptr<storm::logic::Formula const>
const& states) {
1487 STORM_LOG_THROW(states->isInitialFormula(), storm::exceptions::NotSupportedException,
"Abstraction-refinement can only filter initial states.");
1488 return storm::gbar::api::verifyWithAbstractionRefinementEngine<DdType, ValueType>(mpi.
env, symbolicModel,
1489 storm::api::createTask<ValueType>(formula,
true));
1493template<storm::dd::DdType DdType,
typename ValueType>
1494typename std::enable_if<DdType != storm::dd::DdType::CUDD || std::is_same<ValueType, double>::value,
void>::type
verifyModel(
1498 verifyWithHybridEngine<DdType, ValueType>(symbolicModel, input, mpi);
1500 verifyWithDdEngine<DdType, ValueType>(symbolicModel, input, mpi);
1502 verifyWithAbstractionRefinementEngine<DdType, ValueType>(symbolicModel, input, mpi);
1506template<storm::dd::DdType DdType,
typename ValueType>
1507typename std::enable_if<DdType == storm::dd::DdType::CUDD && !std::is_same<ValueType, double>::value,
void>::type
verifySymbolicModel(
1509 STORM_LOG_THROW(
false, storm::exceptions::NotSupportedException,
"CUDD does not support the selected data-type.");
1513 auto ioSettings = storm::settings::getModule<storm::settings::modules::IOSettings>();
1514 auto buildSettings = storm::settings::getModule<storm::settings::modules::BuildSettings>();
1516 std::shared_ptr<storm::models::ModelBase> model;
1517 if (!buildSettings.isNoBuildModelSet()) {
1524 model->printModelInformationToStream(std::cout);
1528 preprocessingWatch.
stop();
1529 if (preprocessingResult.second) {
1530 STORM_PRINT(
"\nTime for model preprocessing: " << preprocessingWatch <<
".\n\n");
1531 model = preprocessingResult.first;
1532 model->printModelInformationToStream(std::cout);
1547 auto abstractionSettings = storm::settings::getModule<storm::settings::modules::AbstractionSettings>();
1548 auto counterexampleSettings = storm::settings::getModule<storm::settings::modules::CounterexampleGeneratorSettings>();
1554 [&input, &mpi]<
storm::dd::DdType DD,
typename VT>() { verifyWithAbstractionRefinementEngine<DD, VT>(input, mpi); });
1560 if (counterexampleSettings.isCounterexampleSet()) {
BuilderOptions & setBuildAllLabels(bool newValue=true)
Should all reward models be built? If not set, only required reward models are build.
BuilderOptions & setExplorationChecks(bool newValue=true)
Should extra checks be performed during exploration.
void clearTerminalStates()
BuilderOptions & setAddOutOfBoundsState(bool newValue=true)
Should a state for out of bounds be constructed.
BuilderOptions & setReservedBitsForUnboundedVariables(uint64_t value)
Sets the number of bits that will be reserved for unbounded integer variables.
BuilderOptions & setBuildChoiceLabels(bool newValue=true)
Should the choice labels be built?
bool isBuildStateValuationsSet() const
BuilderOptions & setBuildAllRewardModels(bool newValue=true)
Should all reward models be built? If not set, only required reward models are build.
bool isBuildChoiceLabelsSet() const
bool isBuildChoiceOriginsSet() const
BuilderOptions & setBuildChoiceOrigins(bool newValue=true)
Should the origins the different choices be built?
BuilderOptions & setBuildStateValuations(bool newValue=true)
Should the state valuation mapping be built?
bool isBuildAllLabelsSet() const
BuilderOptions & setApplyMaximalProgressAssumption(bool newValue=true)
Should the maximal progress assumption be applied when building a Markov Automaton?
BuilderOptions & setBuildObservationValuations(bool newValue=true)
Should a observation valuation mapping be built?
BuilderOptions & setAddOverlappingGuardsLabel(bool newValue=true)
Should a state be labelled for overlapping guards.
bool isBuildObservationValuationsSet() const
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 is responsible for managing a set of typed variables and all expressions using these varia...
std::shared_ptr< storm::logic::Formula const > const & getStatesFormula() const
storm::modelchecker::FilterType getFilterType() const
static Model eliminateAutomatically(const Model &model, std::vector< jani::Property > properties, uint64_t locationHeuristic, uint64_t edgesHeuristic)
std::shared_ptr< storm::logic::Formula const > getRawFormula() const
std::string const & getName() const
Get the provided name.
FilterExpression const & getFilter() const
virtual std::optional< storm::dd::DdType > getDdType() const
This class represents a discrete-time Markov chain.
This class represents a Markov automaton.
This class represents a (discrete-time) Markov decision process.
Base class for all sparse models.
Base class for all symbolic models.
storm::expressions::Expression parseFromString(std::string const &expressionString, bool ignoreError=false) const
Parses an expression from the given string.
void setIdentifierMapping(qi::symbols< char, storm::expressions::Expression > const *identifiers_)
Sets an identifier mapping that is used to determine valid variables in the expression.
storm::jani::Model toJani(bool allVariablesGlobal=true, std::string suffix="") const
Converts the PRISM model into an equivalent JANI model.
This class represents the settings for the abstraction procedures.
std::string getInjectedRefinementPredicates() const
Retrieves a string containing refinement predicates to inject (if there are any).
std::string getConstraintString() const
Retrieves the string that specifies additional constraints.
This class represents the bisimulation settings.
storm::dd::bisimulation::QuotientFormat getQuotientFormat() const
Retrieves the format in which the quotient is to be extracted.
storm::dd::bisimulation::SignatureMode getSignatureMode() const
Retrieves the mode to compute signatures.
bool isQuotientFormatSetFromDefaultValue() const
Retrieves whether the format in which the quotient is to be extracted has been set from its default v...
bool isWeakBisimulationSet() const
Retrieves whether weak bisimulation is to be used.
bool isBuildChoiceLabelsSet() const
Retrieves whether the choice labels should be build.
static const std::string moduleName
This class represents the markov chain settings.
bool isJaniPropertiesSet() const
Retrieves whether the jani-property option was set.
std::string getExplicitIMCAFilename() const
Retrieves the name of the file that contains the model in the IMCA format.
bool areJaniPropertiesSelected() const
Retrieves whether one or more jani-properties have been selected.
std::string getChoiceLabelingFilename() const
Retrieves the name of the file that contains the choice labeling if the model was given using the exp...
bool isStateRewardsSet() const
Retrieves whether the state reward option was set.
std::string getProperty() const
Retrieves the property specified with the property option.
std::string getJaniInputFilename() const
Retrieves the name of the file that contains the JANI model specification if the model was given usin...
bool isChoiceLabelingSet() const
Retrieves whether the choice labeling option was set.
bool isPrismOrJaniInputSet() const
Retrieves whether the JANI or PRISM input option was set.
std::string getPropertyFilter() const
Retrieves the property filter.
std::string getPrismInputFilename() const
Retrieves the name of the file that contains the PRISM model specification if the model was given usi...
bool isExplicitDRNSet() const
Retrieves whether the explicit option with DRN was set.
std::string getExplicitDRNFilename() const
Retrieves the name of the file that contains the model in the DRN format.
std::string getLabelingFilename() const
Retrieves the name of the file that contains the state labeling if the model was given using the expl...
boost::optional< std::vector< std::string > > getQvbsPropertyFilter() const
Retrieves the selected property names.
std::string getStateRewardsFilename() const
Retrieves the name of the file that contains the state rewards if the model was given using the expli...
std::string getTransitionRewardsFilename() const
Retrieves the name of the file that contains the transition rewards if the model was given using the ...
bool isPropertySet() const
Retrieves whether the property option was set.
std::string getQvbsModelName() const
Retrieves the specified model (short-)name of the QVBS.
std::vector< std::string > getSelectedJaniProperties() const
std::string getTransitionFilename() const
Retrieves the name of the file that contains the transitions if the model was given using the explici...
uint64_t getQvbsInstanceIndex() const
Retrieves the selected model instance (file + open parameters of the model)
bool isExplicitIMCASet() const
Retrieves whether the explicit option with IMCA was set.
bool isPrismInputSet() const
Retrieves whether the PRISM language option was set.
bool isTransitionRewardsSet() const
Retrieves whether the transition reward option was set.
bool isExplicitSet() const
Retrieves whether the explicit option was set.
This class provides easy access to a benchmark of the Quantitative Verification Benchmark Set http://...
std::string const & getJaniFile(uint64_t instanceIndex=0) const
std::string getInfo(uint64_t instanceIndex=0, boost::optional< std::vector< std::string > > propertyFilter=boost::none) const
std::string const & getConstantDefinition(uint64_t instanceIndex=0) const
storm::jani::Model const & asJaniModel() const
bool enableBisimulation() const
storm::utility::Engine getEngine() const
Retrieve "good" settings after calling predict.
void predict(storm::jani::Model const &model, storm::jani::Property const &property)
Predicts "good" settings for the provided model checking query.
A class that provides convenience operations to display run times.
void start()
Start stopwatch (again) and start measuring time.
void stop()
Stop stopwatch and add measured time to total time.
#define STORM_LOG_INFO(message)
#define STORM_LOG_WARN(message)
#define STORM_LOG_TRACE(message)
#define STORM_LOG_ERROR(message)
#define STORM_LOG_ASSERT(cond, message)
#define STORM_LOG_WARN_COND(cond, message)
#define STORM_LOG_THROW(cond, exception, message)
#define STORM_PRINT_AND_LOG(message)
#define STORM_PRINT(message)
Define the macros that print information and optionally also log it.
void exportScheduler(std::shared_ptr< storm::models::sparse::Model< ValueType > > const &model, storm::storage::Scheduler< ValueType > const &scheduler, std::string const &filename)
void exportSymbolicModelAsDot(std::shared_ptr< storm::models::symbolic::Model< Type, ValueType > > const &model, std::string const &filename)
storm::prism::Program parseProgram(std::string const &filename, bool prismCompatibility, bool simplify)
std::shared_ptr< storm::models::sparse::Model< ValueType > > permuteModelStates(std::shared_ptr< storm::models::sparse::Model< ValueType > > const &model, storm::utility::permutation::OrderKind order, std::optional< uint64_t > seed=std::nullopt)
Permutes the order of the states of the model according to the given order.
storm::jani::Property createMultiObjectiveProperty(std::vector< storm::jani::Property > const &properties, bool lexicographic)
std::shared_ptr< storm::counterexamples::Counterexample > computeHighLevelCounterexampleMilp(storm::storage::SymbolicModelDescription const &symbolicModel, std::shared_ptr< storm::models::sparse::Mdp< double > > mdp, std::shared_ptr< storm::logic::Formula const > const &formula)
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::pair< storm::jani::Model, std::vector< storm::jani::Property > > parseJaniModel(std::string const &filename, boost::optional< std::vector< std::string > > const &propertyFilter)
void exportJaniModelAsDot(storm::jani::Model const &model, std::string const &filename)
std::vector< storm::jani::Property > parseProperties(storm::parser::FormulaParser &formulaParser, std::string const &inputString, boost::optional< std::set< std::string > > const &propertyFilter)
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.
void exportSymbolicModelAsDrdd(std::shared_ptr< storm::models::symbolic::Model< Type, ValueType > > const &model, std::string const &filename)
std::shared_ptr< storm::counterexamples::Counterexample > computeHighLevelCounterexampleMaxSmt(storm::storage::SymbolicModelDescription const &symbolicModel, std::shared_ptr< storm::models::sparse::Model< double > > model, std::shared_ptr< storm::logic::Formula const > const &formula)
std::vector< storm::jani::Property > parsePropertiesForSymbolicModelDescription(std::string const &inputString, storm::storage::SymbolicModelDescription const &modelDescription, boost::optional< std::set< std::string > > const &propertyFilter)
std::vector< std::shared_ptr< storm::logic::Formula const > > extractFormulasFromProperties(std::vector< storm::jani::Property > const &properties)
void simplifyJaniModel(storm::jani::Model &model, std::vector< storm::jani::Property > &properties, storm::jani::ModelFeatures const &supportedFeatures)
std::shared_ptr< storm::models::sparse::Model< ValueType > > buildExplicitDRNModel(std::string const &drnFile, storm::parser::DirectEncodingParserOptions const &options=storm::parser::DirectEncodingParserOptions())
boost::optional< std::set< std::string > > parsePropertyFilter(std::string const &propertyFilter)
storm::jani::ModelFeatures getSupportedJaniFeatures(storm::builder::BuilderType const &builderType)
void exportSparseModelAsDrn(std::shared_ptr< storm::models::sparse::Model< ValueType > > const &model, std::string const &filename, std::vector< std::string > const ¶meterNames={}, bool allowPlaceholders=true)
void exportCheckResultToJson(std::shared_ptr< storm::models::sparse::Model< ValueType > > const &model, std::unique_ptr< storm::modelchecker::CheckResult > const &checkResult, std::string const &filename)
std::shared_ptr< storm::counterexamples::Counterexample > computeKShortestPathCounterexample(std::shared_ptr< storm::models::sparse::Model< double > > model, std::shared_ptr< storm::logic::Formula const > const &formula, size_t maxK)
void exportSparseModelAsJson(std::shared_ptr< storm::models::sparse::Model< ValueType > > const &model, std::string const &filename)
void exportSparseModelAsDot(std::shared_ptr< storm::models::sparse::Model< ValueType > > const &model, std::string const &filename, size_t maxWidth=30)
void exportParetoScheduler(std::shared_ptr< storm::models::sparse::Model< ValueType > > const &model, std::vector< PointType > const &points, std::vector< storm::storage::Scheduler< ValueType > > const &schedulers, std::string const &baseFilenameStr)
std::vector< storm::jani::Property > substituteConstantsInProperties(std::vector< storm::jani::Property > const &properties, std::map< storm::expressions::Variable, storm::expressions::Expression > const &substitution)
void exportModel(std::shared_ptr< storm::models::sparse::Model< ValueType > > const &model, SymbolicInput const &input)
void exportSymbolicInput(SymbolicInput const &input)
void parseSymbolicModelDescription(storm::settings::modules::IOSettings const &ioSettings, SymbolicInput &input)
void verifyWithAbstractionRefinementEngine(SymbolicInput const &input, ModelProcessingInformation const &mpi)
std::shared_ptr< storm::models::ModelBase > buildModelExplicit(storm::settings::modules::IOSettings const &ioSettings, storm::settings::modules::BuildSettings const &buildSettings)
std::enable_if< DdType==storm::dd::DdType::CUDD &&!std::is_same< ValueType, double >::value, void >::type verifySymbolicModel(std::shared_ptr< storm::models::ModelBase > const &, SymbolicInput const &, ModelProcessingInformation const &)
void verifyModel(std::shared_ptr< storm::models::sparse::Model< ValueType > > const &sparseModel, SymbolicInput const &input, ModelProcessingInformation const &mpi)
auto castAndApply(std::shared_ptr< storm::models::ModelBase > const &model, auto const &callback)
SymbolicInput parseSymbolicInputQvbs(storm::settings::modules::IOSettings const &ioSettings)
void getModelProcessingInformationAutomatic(SymbolicInput const &input, ModelProcessingInformation &mpi)
void verifyWithExplorationEngine(SymbolicInput const &input, 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, bool graphPreserving=true)
void printResult(std::unique_ptr< storm::modelchecker::CheckResult > const &result, storm::logic::Formula const &filterStatesFormula, storm::modelchecker::FilterType const &filterType, storm::utility::Stopwatch *watch=nullptr)
auto applyValueType(ModelProcessingInformation::ValueType vt, auto const &callback)
std::shared_ptr< storm::models::ModelBase > buildPreprocessExportModel(SymbolicInput const &input, ModelProcessingInformation const &mpi)
void verifyProperties(SymbolicInput const &input, VerificationCallbackType const &verificationCallback, PostprocessingCallbackType const &postprocessingCallback=PostprocessingIdentity())
Verifies all (potentially preprocessed) properties given in input.
std::vector< storm::expressions::Expression > parseConstraints(storm::expressions::ExpressionManager const &expressionManager, std::string const &constraintsString)
std::vector< std::vector< storm::expressions::Expression > > parseInjectedRefinementPredicates(storm::expressions::ExpressionManager const &expressionManager, std::string const &refinementPredicatesString)
SymbolicInput parseSymbolicInput()
void verifyWithDdEngine(std::shared_ptr< storm::models::symbolic::Model< DdType, ValueType > > const &symbolicModel, SymbolicInput const &input, ModelProcessingInformation const &mpi)
std::function< std::unique_ptr< storm::modelchecker::CheckResult >(std::shared_ptr< storm::logic::Formula const > const &formula, std::shared_ptr< storm::logic::Formula const > const &states)> VerificationCallbackType
std::shared_ptr< storm::models::ModelBase > buildModelSparse(SymbolicInput const &input, storm::builder::BuilderOptions const &options)
std::enable_if< DdType!=storm::dd::DdType::Sylvan &&!std::is_same< ValueType, double >::value, std::shared_ptr< storm::models::Model< ValueType > > >::type preprocessDdMarkovAutomaton(std::shared_ptr< storm::models::symbolic::Model< DdType, ValueType > > const &model)
std::shared_ptr< storm::models::sparse::Model< ValueType > > preprocessSparseMarkovAutomaton(std::shared_ptr< storm::models::sparse::MarkovAutomaton< ValueType > > const &model)
void printFilteredResult(std::unique_ptr< storm::modelchecker::CheckResult > const &result, storm::modelchecker::FilterType ft)
void computeStateValues(std::string const &description, std::function< std::unique_ptr< storm::modelchecker::CheckResult >()> const &computationCallback, SymbolicInput const &input, VerificationCallbackType const &verificationCallback, PostprocessingCallbackType const &postprocessingCallback=PostprocessingIdentity())
Computes values for each state (such as the steady-state probability distribution).
void printCounterexample(std::shared_ptr< storm::counterexamples::Counterexample > const &counterexample, storm::utility::Stopwatch *watch=nullptr)
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)
void parseProperties(storm::settings::modules::IOSettings const &ioSettings, SymbolicInput &input, boost::optional< std::set< std::string > > const &propertyFilter)
void verifyWithHybridEngine(std::shared_ptr< storm::models::symbolic::Model< DdType, ValueType > > const &symbolicModel, SymbolicInput const &input, ModelProcessingInformation const &mpi)
ModelProcessingInformation getModelProcessingInformation(SymbolicInput const &input, std::shared_ptr< SymbolicInput > const &transformedJaniInput=nullptr)
Sets the model processing information based on the given input.
void printComputingCounterexample(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)
auto applyDdLibValueType(storm::dd::DdType dd, ModelProcessingInformation::ValueType vt, auto const &callback)
std::function< void(std::unique_ptr< storm::modelchecker::CheckResult > const &)> PostprocessingCallbackType
std::shared_ptr< storm::models::ModelBase > buildPreprocessModel(SymbolicInput const &input, ModelProcessingInformation const &mpi)
storm::builder::BuilderOptions createBuildOptionsSparseFromSettings(SymbolicInput const &input)
void processInput(SymbolicInput const &input, ModelProcessingInformation const &mpi)
void ensureNoUndefinedPropertyConstants(std::vector< storm::jani::Property > const &properties)
void generateCounterexamples(std::shared_ptr< ModelType > const &, SymbolicInput const &)
std::vector< std::shared_ptr< storm::logic::Formula const > > createFormulasToRespect(std::vector< storm::jani::Property > const &properties)
std::pair< std::shared_ptr< storm::models::ModelBase >, bool > preprocessModel(std::shared_ptr< storm::models::sparse::Model< ValueType > > const &model, SymbolicInput const &input, ModelProcessingInformation const &mpi)
std::shared_ptr< storm::models::ModelBase > buildModelDd(SymbolicInput const &input)
std::pair< std::shared_ptr< storm::models::ModelBase >, bool > preprocessDdModelImpl(std::shared_ptr< storm::models::symbolic::Model< DdType, ValueType > > const &model, SymbolicInput const &input, ModelProcessingInformation const &mpi)
std::unique_ptr< storm::modelchecker::CheckResult > verifyProperty(std::shared_ptr< storm::logic::Formula const > const &formula, std::shared_ptr< storm::logic::Formula const > const &statesFilter, VerificationCallbackType const &verificationCallback)
Verifies the given formula plus a filter formula to identify relevant states and warns the user in ca...
std::string toString(CompressionMode const &input)
SettingsManager const & manager()
Retrieves the settings manager.
OptimizationDirection convert(OptimizationDirectionSetting s)
std::string orderKindtoString(OrderKind order)
Converts the given order to a string.
bool isTerminate()
Check whether the program should terminate (due to some abort signal).
bool isConstant(ValueType const &)
bool canHandle< storm::RationalFunction >(storm::utility::Engine const &engine, storm::storage::SymbolicModelDescription::ModelType const &modelType, storm::modelchecker::CheckTask< storm::logic::Formula, storm::RationalFunction > const &checkTask)
Engine
An enumeration of all engines.
template bool canHandle< storm::RationalNumber >(storm::utility::Engine const &, std::vector< storm::jani::Property > const &, storm::storage::SymbolicModelDescription const &)
template bool canHandle< double >(storm::utility::Engine const &, std::vector< storm::jani::Property > const &, storm::storage::SymbolicModelDescription const &)
storm::builder::BuilderType getBuilderType(Engine const &engine)
Returns the builder type used for the given engine.
typename detail::IntervalMetaProgrammingHelper< ValueType >::BaseType IntervalBaseType
Helper to access the type in which interval boundaries are stored.
void operator()(std::unique_ptr< storm::modelchecker::CheckResult > const &)
bool allowPlaceholders
Allow placeholders for rational functions in the exported DRN file.
storm::io::CompressionMode compression
The type of compression used for the exported DRN file.
std::optional< std::size_t > outputPrecision
If set, the output precision for floating point numbers in the exported DRN file is set to the given ...