Browse Source

Added option to transform a DFT to only use one unique constantly failed BE

main
Alexander Bork 6 years ago
parent
commit
a257071346
  1. 14
      src/storm-dft-cli/storm-dft.cpp
  2. 7
      src/storm-dft/settings/modules/FaultTreeSettings.cpp
  3. 8
      src/storm-dft/settings/modules/FaultTreeSettings.h

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

@ -56,6 +56,11 @@ void processOptions() {
storm::api::exportDFTToJsonFile<ValueType>(*dft, dftIOSettings.getExportJsonFilename()); storm::api::exportDFTToJsonFile<ValueType>(*dft, dftIOSettings.getExportJsonFilename());
} }
// Limit to one constantly failed BE
if (faultTreeSettings.isUniqueFailedBE()) {
dft = dftTransformator.transformUniqueFailedBe(*dft);
}
// Eliminate non-binary dependencies // Eliminate non-binary dependencies
if (!dft->getDependencies().empty()) { if (!dft->getDependencies().empty()) {
dft = dftTransformator.transformBinaryFDEPs(*dft); dft = dftTransformator.transformBinaryFDEPs(*dft);
@ -82,10 +87,6 @@ void processOptions() {
// SMT // SMT
if (dftIOSettings.isExportToSmt()) { if (dftIOSettings.isExportToSmt()) {
dft = dftTransformator.transformUniqueFailedBe(*dft);
if (!dft->getDependencies().empty()) {
dft = dftTransformator.transformBinaryFDEPs(*dft);
}
// Export to smtlib2 // Export to smtlib2
storm::api::exportDFTToSMT<ValueType>(*dft, dftIOSettings.getExportSmtFilename()); storm::api::exportDFTToSMT<ValueType>(*dft, dftIOSettings.getExportSmtFilename());
return; return;
@ -98,11 +99,6 @@ void processOptions() {
if (faultTreeSettings.solveWithSMT()) { if (faultTreeSettings.solveWithSMT()) {
useSMT = true; useSMT = true;
STORM_PRINT("Use SMT for preprocessing" << std::endl) STORM_PRINT("Use SMT for preprocessing" << std::endl)
dft = dftTransformator.transformUniqueFailedBe(*dft);
if (!dft->getDependencies().empty()) {
// Making the constantly failed BE unique may introduce non-binary FDEPs
dft = dftTransformator.transformBinaryFDEPs(*dft);
}
} }
#endif #endif

7
src/storm-dft/settings/modules/FaultTreeSettings.cpp

@ -26,6 +26,7 @@ namespace storm {
const std::string FaultTreeSettings::approximationHeuristicOptionName = "approximationheuristic"; const std::string FaultTreeSettings::approximationHeuristicOptionName = "approximationheuristic";
const std::string FaultTreeSettings::maxDepthOptionName = "maxdepth"; const std::string FaultTreeSettings::maxDepthOptionName = "maxdepth";
const std::string FaultTreeSettings::firstDependencyOptionName = "firstdep"; const std::string FaultTreeSettings::firstDependencyOptionName = "firstdep";
const std::string FaultTreeSettings::uniqueFailedBEOptionName = "uniquefailedbe";
#ifdef STORM_HAVE_Z3 #ifdef STORM_HAVE_Z3
const std::string FaultTreeSettings::solveWithSmtOptionName = "smt"; const std::string FaultTreeSettings::solveWithSmtOptionName = "smt";
#endif #endif
@ -53,6 +54,8 @@ namespace storm {
{"depth", "probability", "bounddifference"})).build()).build()); {"depth", "probability", "bounddifference"})).build()).build());
this->addOption(storm::settings::OptionBuilder(moduleName, maxDepthOptionName, false, "Maximal depth for state space exploration.").addArgument( this->addOption(storm::settings::OptionBuilder(moduleName, maxDepthOptionName, false, "Maximal depth for state space exploration.").addArgument(
storm::settings::ArgumentBuilder::createUnsignedIntegerArgument("depth", "The maximal depth.").build()).build()); storm::settings::ArgumentBuilder::createUnsignedIntegerArgument("depth", "The maximal depth.").build()).build());
this->addOption(storm::settings::OptionBuilder(moduleName, uniqueFailedBEOptionName, false,
"Use a unique constantly failed BE.").build());
#ifdef STORM_HAVE_Z3 #ifdef STORM_HAVE_Z3
this->addOption(storm::settings::OptionBuilder(moduleName, solveWithSmtOptionName, true, "Solve the DFT with SMT.").build()); this->addOption(storm::settings::OptionBuilder(moduleName, solveWithSmtOptionName, true, "Solve the DFT with SMT.").build());
#endif #endif
@ -115,6 +118,10 @@ namespace storm {
return this->getOption(firstDependencyOptionName).getHasOptionBeenSet(); return this->getOption(firstDependencyOptionName).getHasOptionBeenSet();
} }
bool FaultTreeSettings::isUniqueFailedBE() const {
return this->getOption(uniqueFailedBEOptionName).getHasOptionBeenSet();
}
#ifdef STORM_HAVE_Z3 #ifdef STORM_HAVE_Z3
bool FaultTreeSettings::solveWithSMT() const { bool FaultTreeSettings::solveWithSMT() const {

8
src/storm-dft/settings/modules/FaultTreeSettings.h

@ -103,6 +103,13 @@ namespace storm {
*/ */
bool isTakeFirstDependency() const; bool isTakeFirstDependency() const;
/*!
* Retrieves whether the DFT should be transformed to contain at most one constantly failed BE.
*
* @return True iff the option was set.
*/
bool isUniqueFailedBE() const;
#ifdef STORM_HAVE_Z3 #ifdef STORM_HAVE_Z3
/*! /*!
@ -134,6 +141,7 @@ namespace storm {
static const std::string approximationHeuristicOptionName; static const std::string approximationHeuristicOptionName;
static const std::string maxDepthOptionName; static const std::string maxDepthOptionName;
static const std::string firstDependencyOptionName; static const std::string firstDependencyOptionName;
static const std::string uniqueFailedBEOptionName;
#ifdef STORM_HAVE_Z3 #ifdef STORM_HAVE_Z3
static const std::string solveWithSmtOptionName; static const std::string solveWithSmtOptionName;
#endif #endif

Loading…
Cancel
Save