Browse Source

Moved setting nofixdl to build settings

tempestpy_adaptions
Matthias Volk 5 years ago
parent
commit
6a77ce210a
  1. 4
      src/storm-parsers/parser/DeterministicSparseTransitionParser.cpp
  2. 3
      src/storm-parsers/parser/ImcaMarkovAutomatonParser.cpp
  3. 6
      src/storm-parsers/parser/MarkovAutomatonSparseTransitionParser.cpp
  4. 4
      src/storm-parsers/parser/NondeterministicSparseTransitionParser.cpp
  5. 4
      src/storm/builder/DdJaniModelBuilder.cpp
  6. 4
      src/storm/builder/DdPrismModelBuilder.cpp
  7. 3
      src/storm/builder/ExplicitModelBuilder.cpp
  8. 4
      src/storm/builder/jit/ExplicitJitJaniModelBuilder.cpp
  9. 4
      src/storm/builder/jit/ModelComponentsBuilder.cpp
  10. 8
      src/storm/settings/SettingsManager.cpp
  11. 19
      src/storm/settings/SettingsManager.h
  12. 12
      src/storm/settings/modules/BuildSettings.cpp
  13. 16
      src/storm/settings/modules/BuildSettings.h
  14. 15
      src/storm/settings/modules/CoreSettings.cpp
  15. 18
      src/storm/settings/modules/CoreSettings.h
  16. 6
      src/test/storm/parser/DeterministicSparseTransitionParserTest.cpp
  17. 6
      src/test/storm/parser/MarkovAutomatonSparseTransitionParserTest.cpp
  18. 6
      src/test/storm/parser/NondeterministicSparseTransitionParserTest.cpp

4
src/storm-parsers/parser/DeterministicSparseTransitionParser.cpp

@ -14,7 +14,7 @@
#include "storm/exceptions/WrongFormatException.h"
#include "storm/exceptions/InvalidArgumentException.h"
#include "storm/settings/SettingsManager.h"
#include "storm/settings/modules/CoreSettings.h"
#include "storm/settings/modules/BuildSettings.h"
#include "storm/adapters/RationalFunctionAdapter.h"
#include "storm/utility/macros.h"
@ -82,7 +82,7 @@ namespace storm {
uint_fast64_t row, col, lastRow = 0;
double val;
bool dontFixDeadlocks = storm::settings::getModule<storm::settings::modules::CoreSettings>().isDontFixDeadlocksSet();
bool dontFixDeadlocks = storm::settings::getModule<storm::settings::modules::BuildSettings>().isDontFixDeadlocksSet();
bool hadDeadlocks = false;
// Read all transitions from file. Note that we assume that the

3
src/storm-parsers/parser/ImcaMarkovAutomatonParser.cpp

@ -2,7 +2,6 @@
#include "storm/settings/SettingsManager.h"
#include "storm/settings/modules/BuildSettings.h"
#include "storm/settings/modules/CoreSettings.h"
#include "storm/utility/file.h"
#include "storm/utility/builder.h"
@ -127,7 +126,7 @@ namespace storm {
// Fix deadlocks (if required)
assert(stateBehaviors.size() == numStates);
if (!storm::settings::getModule<storm::settings::modules::CoreSettings>().isDontFixDeadlocksSet()) {
if (!storm::settings::getModule<storm::settings::modules::BuildSettings>().isDontFixDeadlocksSet()) {
StateType state = 0;
for (auto& behavior : stateBehaviors) {
if (!behavior.wasExpanded()) {

6
src/storm-parsers/parser/MarkovAutomatonSparseTransitionParser.cpp

@ -1,7 +1,7 @@
#include "MarkovAutomatonSparseTransitionParser.h"
#include "storm/settings/SettingsManager.h"
#include "storm/settings/modules/CoreSettings.h"
#include "storm/settings/modules/BuildSettings.h"
#include "storm/exceptions/WrongFormatException.h"
#include "storm/exceptions/FileIoException.h"
#include "storm-parsers/parser/MappedFile.h"
@ -18,7 +18,7 @@ namespace storm {
typename MarkovAutomatonSparseTransitionParser<ValueType>::FirstPassResult MarkovAutomatonSparseTransitionParser<ValueType>::firstPass(char const* buf) {
MarkovAutomatonSparseTransitionParser::FirstPassResult result;
bool dontFixDeadlocks = storm::settings::getModule<storm::settings::modules::CoreSettings>().isDontFixDeadlocksSet();
bool dontFixDeadlocks = storm::settings::getModule<storm::settings::modules::BuildSettings>().isDontFixDeadlocksSet();
// Skip the format hint if it is there.
buf = trimWhitespaces(buf);
@ -171,7 +171,7 @@ namespace storm {
typename MarkovAutomatonSparseTransitionParser<ValueType>::Result MarkovAutomatonSparseTransitionParser<ValueType>::secondPass(char const* buf, FirstPassResult const& firstPassResult) {
Result result(firstPassResult);
bool dontFixDeadlocks = storm::settings::getModule<storm::settings::modules::CoreSettings>().isDontFixDeadlocksSet();
bool dontFixDeadlocks = storm::settings::getModule<storm::settings::modules::BuildSettings>().isDontFixDeadlocksSet();
// Skip the format hint if it is there.
buf = trimWhitespaces(buf);

4
src/storm-parsers/parser/NondeterministicSparseTransitionParser.cpp

@ -4,7 +4,7 @@
#include "storm-parsers/parser/MappedFile.h"
#include "storm/settings/SettingsManager.h"
#include "storm/settings/modules/CoreSettings.h"
#include "storm/settings/modules/BuildSettings.h"
#include "storm/exceptions/FileIoException.h"
#include "storm/exceptions/OutOfRangeException.h"
@ -91,7 +91,7 @@ namespace storm {
// Initialize variables for the parsing run.
uint_fast64_t source = 0, target = 0, lastSource = 0, choice = 0, lastChoice = 0, curRow = 0;
double val = 0.0;
bool dontFixDeadlocks = storm::settings::getModule<storm::settings::modules::CoreSettings>().isDontFixDeadlocksSet();
bool dontFixDeadlocks = storm::settings::getModule<storm::settings::modules::BuildSettings>().isDontFixDeadlocksSet();
bool hadDeadlocks = false;
// The first state already starts a new row group of the matrix.

4
src/storm/builder/DdJaniModelBuilder.cpp

@ -28,7 +28,7 @@
#include "storm/models/symbolic/StandardRewardModel.h"
#include "storm/settings/SettingsManager.h"
#include "storm/settings/modules/CoreSettings.h"
#include "storm/settings/modules/BuildSettings.h"
#include "storm/utility/macros.h"
#include "storm/utility/jani.h"
@ -1932,7 +1932,7 @@ namespace storm {
if (!deadlockStates.isZero()) {
// If we need to fix deadlocks, we do so now.
if (!storm::settings::getModule<storm::settings::modules::CoreSettings>().isDontFixDeadlocksSet()) {
if (!storm::settings::getModule<storm::settings::modules::BuildSettings>().isDontFixDeadlocksSet()) {
STORM_LOG_INFO("Fixing deadlocks in " << deadlockStates.getNonZeroCount() << " states. The first three of these states are: ");
storm::dd::Add<Type, ValueType> deadlockStatesAdd = deadlockStates.template toAdd<ValueType>();

4
src/storm/builder/DdPrismModelBuilder.cpp

@ -24,7 +24,7 @@
#include "storm/storage/dd/cudd/CuddAddIterator.h"
#include "storm/storage/dd/Bdd.h"
#include "storm/settings/modules/CoreSettings.h"
#include "storm/settings/modules/BuildSettings.h"
#include "storm/adapters/RationalFunctionAdapter.h"
@ -1422,7 +1422,7 @@ namespace storm {
// If there are deadlocks, either fix them or raise an error.
if (!deadlockStates.isZero()) {
// If we need to fix deadlocks, we do so now.
if (!storm::settings::getModule<storm::settings::modules::CoreSettings>().isDontFixDeadlocksSet()) {
if (!storm::settings::getModule<storm::settings::modules::BuildSettings>().isDontFixDeadlocksSet()) {
STORM_LOG_INFO("Fixing deadlocks in " << deadlockStates.getNonZeroCount() << " states. The first three of these states are: ");
storm::dd::Add<Type, ValueType> deadlockStatesAdd = deadlockStates.template toAdd<ValueType>();

3
src/storm/builder/ExplicitModelBuilder.cpp

@ -10,7 +10,6 @@
#include "storm/storage/expressions/ExpressionManager.h"
#include "storm/settings/modules/CoreSettings.h"
#include "storm/settings/modules/BuildSettings.h"
#include "storm/builder/RewardModelBuilder.h"
@ -163,7 +162,7 @@ namespace storm {
// If there is no behavior, we might have to introduce a self-loop.
if (behavior.empty()) {
if (!storm::settings::getModule<storm::settings::modules::CoreSettings>().isDontFixDeadlocksSet() || !behavior.wasExpanded()) {
if (!storm::settings::getModule<storm::settings::modules::BuildSettings>().isDontFixDeadlocksSet() || !behavior.wasExpanded()) {
// If the behavior was actually expanded and yet there are no transitions, then we have a deadlock state.
if (behavior.wasExpanded()) {
this->stateStorage.deadlockStateIndices.push_back(currentIndex);

4
src/storm/builder/jit/ExplicitJitJaniModelBuilder.cpp

@ -33,7 +33,7 @@
#include "storm/settings/SettingsManager.h"
#include "storm/settings/modules/JitBuilderSettings.h"
#include "storm/settings/modules/CoreSettings.h"
#include "storm/settings/modules/BuildSettings.h"
#include "storm/utility/OsDetection.h"
#include "storm-config.h"
@ -574,7 +574,7 @@ namespace storm {
modelData["double"] = cpptempl::make_data(list);
list = cpptempl::data_list();
if (storm::settings::getModule<storm::settings::modules::CoreSettings>().isDontFixDeadlocksSet()) {
if (storm::settings::getModule<storm::settings::modules::BuildSettings>().isDontFixDeadlocksSet()) {
list.push_back(cpptempl::data_map());
}
modelData["dontFixDeadlocks"] = cpptempl::make_data(list);

4
src/storm/builder/jit/ModelComponentsBuilder.cpp

@ -10,7 +10,7 @@
#include "storm/builder/RewardModelBuilder.h"
#include "storm/settings/SettingsManager.h"
#include "storm/settings/modules/CoreSettings.h"
#include "storm/settings/modules/BuildSettings.h"
#include "storm/exceptions/WrongFormatException.h"
#include "storm/utility/macros.h"
@ -27,7 +27,7 @@ namespace storm {
markovianStates = std::make_unique<storm::storage::BitVector>(10);
}
dontFixDeadlocks = storm::settings::getModule<storm::settings::modules::CoreSettings>().isDontFixDeadlocksSet();
dontFixDeadlocks = storm::settings::getModule<storm::settings::modules::BuildSettings>().isDontFixDeadlocksSet();
}
template <typename IndexType, typename ValueType>

8
src/storm/settings/SettingsManager.cpp

@ -630,12 +630,8 @@ namespace storm {
return SettingsManager::manager();
}
storm::settings::modules::CoreSettings& mutableCoreSettings() {
return dynamic_cast<storm::settings::modules::CoreSettings&>(mutableManager().getModule(storm::settings::modules::CoreSettings::moduleName));
}
storm::settings::modules::IOSettings& mutableIOSettings() {
return dynamic_cast<storm::settings::modules::IOSettings&>(mutableManager().getModule(storm::settings::modules::IOSettings::moduleName));
storm::settings::modules::BuildSettings& mutableBuildSettings() {
return dynamic_cast<storm::settings::modules::BuildSettings&>(mutableManager().getModule(storm::settings::modules::BuildSettings::moduleName));
}
storm::settings::modules::AbstractionSettings& mutableAbstractionSettings() {

19
src/storm/settings/SettingsManager.h

@ -12,8 +12,7 @@
namespace storm {
namespace settings {
namespace modules {
class CoreSettings;
class IOSettings;
class BuildSettings;
class ModuleSettings;
class AbstractionSettings;
}
@ -27,7 +26,7 @@ namespace storm {
class SettingsManager {
public:
// Explicitely delete copy constructor
// Explicitly delete copy constructor
SettingsManager(SettingsManager const&) = delete;
void operator=(SettingsManager const&) = delete;
@ -305,20 +304,12 @@ namespace storm {
}
/*!
* Retrieves the core settings in a mutable form. This is only meant to be used for debug purposes or very
* Retrieves the build settings in a mutable form. This is only meant to be used for debug purposes or very
* rare cases where it is necessary.
*
* @return An object that allows accessing and modifying the core settings.
* @return An object that allows accessing and modifying the build settings.
*/
storm::settings::modules::CoreSettings& mutableCoreSettings();
/*!
* Retrieves the IO settings in a mutable form. This is only meant to be used for debug purposes or very
* rare cases where it is necessary.
*
* @return An object that allows accessing and modifying the IO settings.
*/
storm::settings::modules::IOSettings& mutableIOSettings();
storm::settings::modules::BuildSettings& mutableBuildSettings();
/*!
* Retrieves the abstraction settings in a mutable form. This is only meant to be used for debug purposes or very

12
src/storm/settings/modules/BuildSettings.cpp

@ -25,15 +25,19 @@ namespace storm {
const std::string explorationChecksOptionShortName = "ec";
const std::string prismCompatibilityOptionName = "prismcompat";
const std::string prismCompatibilityOptionShortName = "pc";
const std::string dontFixDeadlockOptionName = "nofixdl";
const std::string dontFixDeadlockOptionShortName = "ndl";
const std::string noBuildOptionName = "nobuild";
const std::string fullModelBuildOptionName = "buildfull";
const std::string buildChoiceLabelOptionName = "buildchoicelab";
const std::string buildStateValuationsOptionName = "buildstateval";
const std::string buildOutOfBoundsStateOptionName = "buildoutofboundsstate";
const std::string bitsForUnboundedVariablesOptionName = "int-bits";
BuildSettings::BuildSettings() : ModuleSettings(moduleName) {
this->addOption(storm::settings::OptionBuilder(moduleName, prismCompatibilityOptionName, false, "Enables PRISM compatibility. This may be necessary to process some PRISM models.").setShortName(prismCompatibilityOptionShortName).build());
this->addOption(storm::settings::OptionBuilder(moduleName, dontFixDeadlockOptionName, false, "If the model contains deadlock states, they need to be fixed by setting this option.").setShortName(dontFixDeadlockOptionShortName).setIsAdvanced().build());
this->addOption(storm::settings::OptionBuilder(moduleName, jitOptionName, false, "If set, the model is built using the JIT model builder.").build());
this->addOption(storm::settings::OptionBuilder(moduleName, fullModelBuildOptionName, false, "If set, include all rewards and labels.").build());
this->addOption(storm::settings::OptionBuilder(moduleName, buildChoiceLabelOptionName, false, "If set, also build the choice labels").setIsAdvanced().build());
@ -61,6 +65,14 @@ namespace storm {
return this->getOption(prismCompatibilityOptionName).getHasOptionBeenSet();
}
bool BuildSettings::isDontFixDeadlocksSet() const {
return this->getOption(dontFixDeadlockOptionName).getHasOptionBeenSet();
}
std::unique_ptr<storm::settings::SettingMemento> BuildSettings::overrideDontFixDeadlocksSet(bool stateToSet) {
return this->overrideOption(dontFixDeadlockOptionName, stateToSet);
}
bool BuildSettings::isBuildFullModelSet() const {
return this->getOption(fullModelBuildOptionName).getHasOptionBeenSet();
}

16
src/storm/settings/modules/BuildSettings.h

@ -51,6 +51,22 @@ namespace storm {
*/
bool isPrismCompatibilityEnabled() const;
/*!
* Retrieves whether the dont-fix-deadlocks option was set.
*
* @return True if the dont-fix-deadlocks option was set.
*/
bool isDontFixDeadlocksSet() const;
/*!
* Overrides the option to not fix deadlocks by setting it to the specified value. As soon as the
* returned memento goes out of scope, the original value is restored.
*
* @param stateToSet The value that is to be set for the fix-deadlocks option.
* @return The memento that will eventually restore the original value.
*/
std::unique_ptr<storm::settings::SettingMemento> overrideDontFixDeadlocksSet(bool stateToSet);
/**
* Retrieves whether no model should be build at all, in case one just want to translate models or parse a file.
*/

15
src/storm/settings/modules/CoreSettings.cpp

@ -22,8 +22,6 @@ namespace storm {
const std::string CoreSettings::moduleName = "core";
const std::string CoreSettings::counterexampleOptionName = "counterexample";
const std::string CoreSettings::counterexampleOptionShortName = "cex";
const std::string CoreSettings::dontFixDeadlockOptionName = "nofixdl";
const std::string CoreSettings::dontFixDeadlockOptionShortName = "ndl";
const std::string CoreSettings::eqSolverOptionName = "eqsolver";
const std::string CoreSettings::lpSolverOptionName = "lpsolver";
const std::string CoreSettings::smtSolverOptionName = "smtsolver";
@ -38,8 +36,7 @@ namespace storm {
CoreSettings::CoreSettings() : ModuleSettings(moduleName), engine(CoreSettings::Engine::Sparse) {
this->addOption(storm::settings::OptionBuilder(moduleName, counterexampleOptionName, false, "Generates a counterexample for the given PRCTL formulas if not satisfied by the model.").setShortName(counterexampleOptionShortName).build());
this->addOption(storm::settings::OptionBuilder(moduleName, dontFixDeadlockOptionName, false, "If the model contains deadlock states, they need to be fixed by setting this option.").setShortName(dontFixDeadlockOptionShortName).setIsAdvanced().build());
std::vector<std::string> engines = {"sparse", "hybrid", "dd", "dd-to-sparse", "expl", "abs"};
this->addOption(storm::settings::OptionBuilder(moduleName, engineOptionName, false, "Sets which engine is used for model building and model checking.").setShortName(engineOptionShortName)
.addArgument(storm::settings::ArgumentBuilder::createStringArgument("name", "The name of the engine to use.").addValidatorString(ArgumentValidatorFactory::createMultipleChoiceValidator(engines)).setDefaultValueString("sparse").build()).build());
@ -68,15 +65,7 @@ namespace storm {
bool CoreSettings::isCounterexampleSet() const {
return this->getOption(counterexampleOptionName).getHasOptionBeenSet();
}
bool CoreSettings::isDontFixDeadlocksSet() const {
return this->getOption(dontFixDeadlockOptionName).getHasOptionBeenSet();
}
std::unique_ptr<storm::settings::SettingMemento> CoreSettings::overrideDontFixDeadlocksSet(bool stateToSet) {
return this->overrideOption(dontFixDeadlockOptionName, stateToSet);
}
storm::solver::EquationSolverType CoreSettings::getEquationSolver() const {
std::string equationSolverName = this->getOption(eqSolverOptionName).getArgumentByName("name").getValueAsString();
if (equationSolverName == "gmm++") {

18
src/storm/settings/modules/CoreSettings.h

@ -51,22 +51,6 @@ namespace storm {
*/
std::string getCounterexampleFilename() const;
/*!
* Retrieves whether the dont-fix-deadlocks option was set.
*
* @return True if the dont-fix-deadlocks option was set.
*/
bool isDontFixDeadlocksSet() const;
/*!
* Overrides the option to not fix deadlocks by setting it to the specified value. As soon as the
* returned memento goes out of scope, the original value is restored.
*
* @param stateToSet The value that is to be set for the fix-deadlocks option.
* @return The memento that will eventually restore the original value.
*/
std::unique_ptr<storm::settings::SettingMemento> overrideDontFixDeadlocksSet(bool stateToSet);
/*!
* Retrieves the selected equation solver.
*
@ -168,8 +152,6 @@ namespace storm {
// Define the string names of the options as constants.
static const std::string counterexampleOptionName;
static const std::string counterexampleOptionShortName;
static const std::string dontFixDeadlockOptionName;
static const std::string dontFixDeadlockOptionShortName;
static const std::string eqSolverOptionName;
static const std::string lpSolverOptionName;
static const std::string smtSolverOptionName;

6
src/test/storm/parser/DeterministicSparseTransitionParserTest.cpp

@ -11,7 +11,7 @@
#include "storm-parsers/parser/DeterministicSparseTransitionParser.h"
#include "storm/storage/SparseMatrix.h"
#include "storm/settings/SettingsManager.h"
#include "storm/settings/modules/CoreSettings.h"
#include "storm/settings/modules/BuildSettings.h"
#include "storm/settings/SettingMemento.h"
#include "storm/exceptions/FileIoException.h"
#include "storm/exceptions/WrongFormatException.h"
@ -179,7 +179,7 @@ TEST(DeterministicSparseTransitionParserTest, MixedTransitionOrder) {
TEST(DeterministicSparseTransitionParserTest, FixDeadlocks) {
// Set the fixDeadlocks flag temporarily. It is set to its old value once the deadlockOption object is destructed.
std::unique_ptr<storm::settings::SettingMemento> fixDeadlocks = storm::settings::mutableCoreSettings().overrideDontFixDeadlocksSet(false);
std::unique_ptr<storm::settings::SettingMemento> fixDeadlocks = storm::settings::mutableBuildSettings().overrideDontFixDeadlocksSet(false);
// Parse a transitions file with the fixDeadlocks Flag set and test if it works.
storm::storage::SparseMatrix<double> transitionMatrix = storm::parser::DeterministicSparseTransitionParser<>::parseDeterministicTransitions(STORM_TEST_RESOURCES_DIR "/tra/dtmc_deadlock.tra");
@ -200,7 +200,7 @@ TEST(DeterministicSparseTransitionParserTest, FixDeadlocks) {
TEST(DeterministicSparseTransitionParserTest, DontFixDeadlocks) {
// Try to parse a transitions file containing a deadlock state with the fixDeadlocksFlag unset. This should throw an exception.
std::unique_ptr<storm::settings::SettingMemento> dontFixDeadlocks = storm::settings::mutableCoreSettings().overrideDontFixDeadlocksSet(true);
std::unique_ptr<storm::settings::SettingMemento> dontFixDeadlocks = storm::settings::mutableBuildSettings().overrideDontFixDeadlocksSet(true);
ASSERT_THROW(storm::parser::DeterministicSparseTransitionParser<>::parseDeterministicTransitions(STORM_TEST_RESOURCES_DIR "/tra/dtmc_deadlock.tra"), storm::exceptions::WrongFormatException);
}

6
src/test/storm/parser/MarkovAutomatonSparseTransitionParserTest.cpp

@ -8,7 +8,7 @@
#include "gtest/gtest.h"
#include "storm-config.h"
#include "storm/settings/SettingsManager.h"
#include "storm/settings/modules/CoreSettings.h"
#include "storm/settings/modules/BuildSettings.h"
#include <vector>
@ -187,7 +187,7 @@ TEST(MarkovAutomatonSparseTransitionParserTest, Whitespaces) {
TEST(MarkovAutomatonSparseTransitionParserTest, FixDeadlocks) {
// Set the fixDeadlocks flag temporarily. It is set to its old value once the deadlockOption object is destructed.
std::unique_ptr<storm::settings::SettingMemento> fixDeadlocks = storm::settings::mutableCoreSettings().overrideDontFixDeadlocksSet(false);
std::unique_ptr<storm::settings::SettingMemento> fixDeadlocks = storm::settings::mutableBuildSettings().overrideDontFixDeadlocksSet(false);
// Parse a Markov Automaton transition file with the fixDeadlocks Flag set and test if it works.
typename storm::parser::MarkovAutomatonSparseTransitionParser<>::Result result = storm::parser::MarkovAutomatonSparseTransitionParser<>::parseMarkovAutomatonTransitions(STORM_TEST_RESOURCES_DIR "/tra/ma_deadlock.tra");
@ -206,7 +206,7 @@ TEST(MarkovAutomatonSparseTransitionParserTest, FixDeadlocks) {
TEST(MarkovAutomatonSparseTransitionParserTest, DontFixDeadlocks) {
// Try to parse a Markov Automaton transition file containing a deadlock state with the fixDeadlocksFlag unset. This should throw an exception.
std::unique_ptr<storm::settings::SettingMemento> dontFixDeadlocks = storm::settings::mutableCoreSettings().overrideDontFixDeadlocksSet(true);
std::unique_ptr<storm::settings::SettingMemento> dontFixDeadlocks = storm::settings::mutableBuildSettings().overrideDontFixDeadlocksSet(true);
ASSERT_THROW(storm::parser::MarkovAutomatonSparseTransitionParser<>::parseMarkovAutomatonTransitions(STORM_TEST_RESOURCES_DIR "/tra/ma_deadlock.tra"), storm::exceptions::WrongFormatException);
}

6
src/test/storm/parser/NondeterministicSparseTransitionParserTest.cpp

@ -13,7 +13,7 @@
#include "storm/settings/SettingMemento.h"
#include "storm/settings/SettingsManager.h"
#include "storm/settings/modules/CoreSettings.h"
#include "storm/settings/modules/BuildSettings.h"
#include "storm/exceptions/FileIoException.h"
#include "storm/exceptions/WrongFormatException.h"
@ -210,7 +210,7 @@ TEST(NondeterministicSparseTransitionParserTest, MixedTransitionOrder) {
TEST(NondeterministicSparseTransitionParserTest, FixDeadlocks) {
// Set the fixDeadlocks flag temporarily. It is set to its old value once the deadlockOption object is destructed.
std::unique_ptr<storm::settings::SettingMemento> fixDeadlocks = storm::settings::mutableCoreSettings().overrideDontFixDeadlocksSet(false);
std::unique_ptr<storm::settings::SettingMemento> fixDeadlocks = storm::settings::mutableBuildSettings().overrideDontFixDeadlocksSet(false);
// Parse a transitions file with the fixDeadlocks Flag set and test if it works.
storm::storage::SparseMatrix<double> result(storm::parser::NondeterministicSparseTransitionParser<>::parseNondeterministicTransitions(STORM_TEST_RESOURCES_DIR "/tra/mdp_deadlock.tra"));
@ -251,7 +251,7 @@ TEST(NondeterministicSparseTransitionParserTest, FixDeadlocks) {
TEST(NondeterministicSparseTransitionParserTest, DontFixDeadlocks) {
// Try to parse a transitions file containing a deadlock state with the fixDeadlocksFlag unset. This should throw an exception.
std::unique_ptr<storm::settings::SettingMemento> dontFixDeadlocks = storm::settings::mutableCoreSettings().overrideDontFixDeadlocksSet(true);
std::unique_ptr<storm::settings::SettingMemento> dontFixDeadlocks = storm::settings::mutableBuildSettings().overrideDontFixDeadlocksSet(true);
ASSERT_THROW(storm::parser::NondeterministicSparseTransitionParser<>::parseNondeterministicTransitions(STORM_TEST_RESOURCES_DIR "/tra/mdp_deadlock.tra"), storm::exceptions::WrongFormatException);
}

Loading…
Cancel
Save