Browse Source

Fixed seqfault when no property was given

tempestpy_adaptions
Matthias Volk 6 years ago
parent
commit
86c183a342
  1. 33
      src/storm-dft-cli/storm-dft.cpp
  2. 1
      src/storm-dft/modelchecker/dft/DFTModelChecker.cpp

33
src/storm-dft-cli/storm-dft.cpp

@ -115,15 +115,17 @@ void processOptions() {
}
// Build properties
STORM_LOG_WARN_COND(!properties.empty(), "No property given.");
std::string propString;
for (size_t i = 0; i < properties.size(); ++i) {
if (i + 1 < properties.size()) {
propString += ";";
std::vector<std::shared_ptr<storm::logic::Formula const>> props;
if (!properties.empty()) {
std::string propString;
for (size_t i = 0; i < properties.size(); ++i) {
if (i + 1 < properties.size()) {
propString += ";";
}
propString += properties[i];
}
propString += properties[i];
props = storm::api::extractFormulasFromProperties(storm::api::parseProperties(propString));
}
std::vector<std::shared_ptr<storm::logic::Formula const>> props = storm::api::extractFormulasFromProperties(storm::api::parseProperties(propString));
// Set relevant elements
// TODO: also incorporate events from properties
@ -149,13 +151,18 @@ void processOptions() {
relevantEvents = dft->getAllIds();
}
// Carry out the actual analysis
double approximationError = 0.0;
if (faultTreeSettings.isApproximationErrorSet()) {
approximationError = faultTreeSettings.getApproximationError();
// Analyze DFT
// TODO allow building of state space even without properties
if (props.empty()) {
STORM_LOG_WARN("No property given. No analysis will be performed.");
} else {
double approximationError = 0.0;
if (faultTreeSettings.isApproximationErrorSet()) {
approximationError = faultTreeSettings.getApproximationError();
}
storm::api::analyzeDFT<ValueType>(*dft, props, faultTreeSettings.useSymmetryReduction(), faultTreeSettings.useModularisation(), relevantEvents, approximationError,
faultTreeSettings.getApproximationHeuristic(), true);
}
storm::api::analyzeDFT<ValueType>(*dft, props, faultTreeSettings.useSymmetryReduction(), faultTreeSettings.useModularisation(), relevantEvents, approximationError,
faultTreeSettings.getApproximationHeuristic(), true);
}
/*!

1
src/storm-dft/modelchecker/dft/DFTModelChecker.cpp

@ -27,6 +27,7 @@ namespace storm {
// TODO: check that all paths reach the target state for approximation
// Checking DFT
// TODO: distinguish for all properties, not only for first one
if (properties[0]->isTimeOperatorFormula() && allowModularisation) {
// Use parallel composition as modularisation approach for expected time
std::shared_ptr<storm::models::sparse::Model<ValueType>> model = buildModelViaComposition(dft, properties, symred, true, relevantEvents);
Loading…
Cancel
Save