diff --git a/src/storm-pomdp/storage/PomdpMemory.cpp b/src/storm-pomdp/storage/PomdpMemory.cpp index 1c5f74cf4..161f89f8c 100644 --- a/src/storm-pomdp/storage/PomdpMemory.cpp +++ b/src/storm-pomdp/storage/PomdpMemory.cpp @@ -2,6 +2,7 @@ #include "storm/utility/macros.h" #include "storm/exceptions/InvalidArgumentException.h" +#include "storm/exceptions/IllegalArgumentException.h" namespace storm { namespace storage { @@ -110,6 +111,7 @@ namespace storm { case PomdpMemoryPattern::Full: return buildFullyConnectedMemory(numStates); } + STORM_LOG_THROW(false, storm::exceptions::IllegalArgumentException, "Unknown PomdpMemoryPattern"); } PomdpMemory PomdpMemoryBuilder::buildTrivialMemory() const { @@ -177,4 +179,4 @@ namespace storm { return PomdpMemory(transitions, 0); } } -} \ No newline at end of file +} diff --git a/src/storm/logic/Bound.h b/src/storm/logic/Bound.h index 0b152ea06..e429dbc6e 100644 --- a/src/storm/logic/Bound.h +++ b/src/storm/logic/Bound.h @@ -1,10 +1,11 @@ #ifndef STORM_LOGIC_BOUND_H_ #define STORM_LOGIC_BOUND_H_ +#include "storm/exceptions/IllegalArgumentException.h" #include "storm/logic/ComparisonType.h" #include "storm/storage/expressions/Expression.h" #include "storm/utility/constants.h" - +#include "storm/utility/macros.h" namespace storm { namespace logic { @@ -29,6 +30,7 @@ namespace storm { case ComparisonType::LessEqual: return compareValue <= thresholdAsValueType; } + STORM_LOG_THROW(false, storm::exceptions::IllegalArgumentException, "Unknown ComparisonType"); } friend std::ostream& operator<<(std::ostream& out, Bound const& bound); diff --git a/src/storm/logic/ComparisonType.h b/src/storm/logic/ComparisonType.h index 19475960f..c47fb2786 100644 --- a/src/storm/logic/ComparisonType.h +++ b/src/storm/logic/ComparisonType.h @@ -3,6 +3,9 @@ #include +#include "storm/utility/macros.h" +#include "storm/exceptions/IllegalArgumentException.h" + namespace storm { namespace logic { enum class ComparisonType { Less, LessEqual, Greater, GreaterEqual }; @@ -26,6 +29,7 @@ namespace storm { case ComparisonType::GreaterEqual: return ComparisonType::Less; } + STORM_LOG_THROW(false, storm::exceptions::IllegalArgumentException, "Unknown ComparisonType"); } inline ComparisonType invertPreserveStrictness(ComparisonType t) { @@ -39,6 +43,7 @@ namespace storm { case ComparisonType::GreaterEqual: return ComparisonType::LessEqual; } + STORM_LOG_THROW(false, storm::exceptions::IllegalArgumentException, "Unknown ComparisonType"); } std::ostream& operator<<(std::ostream& out, ComparisonType const& comparisonType); diff --git a/src/storm/modelchecker/results/FilterType.cpp b/src/storm/modelchecker/results/FilterType.cpp index 17a69063e..e7eac999b 100644 --- a/src/storm/modelchecker/results/FilterType.cpp +++ b/src/storm/modelchecker/results/FilterType.cpp @@ -1,5 +1,7 @@ #include "FilterType.h" +#include "storm/utility/macros.h" +#include "storm/exceptions/IllegalArgumentException.h" namespace storm { namespace modelchecker { @@ -27,6 +29,7 @@ namespace storm { case FilterType::VALUES: return "the values"; } + STORM_LOG_THROW(false, storm::exceptions::IllegalArgumentException, "Unknown FilterType"); } } } diff --git a/src/storm/solver/LinearEquationSolverRequirements.cpp b/src/storm/solver/LinearEquationSolverRequirements.cpp index 445e776d7..e4075b1e1 100644 --- a/src/storm/solver/LinearEquationSolverRequirements.cpp +++ b/src/storm/solver/LinearEquationSolverRequirements.cpp @@ -1,5 +1,8 @@ #include "storm/solver/LinearEquationSolverRequirements.h" +#include "storm/utility/macros.h" +#include "storm/exceptions/IllegalArgumentException.h" + namespace storm { namespace solver { @@ -36,6 +39,7 @@ namespace storm { case Element::LowerBounds: return lowerBounds(); break; case Element::UpperBounds: return upperBounds(); break; } + STORM_LOG_THROW(false, storm::exceptions::IllegalArgumentException, "Unknown ElementType"); } void LinearEquationSolverRequirements::clearLowerBounds() { diff --git a/src/storm/solver/MinMaxLinearEquationSolverRequirements.cpp b/src/storm/solver/MinMaxLinearEquationSolverRequirements.cpp index 3e5e867ab..3d7cdc607 100644 --- a/src/storm/solver/MinMaxLinearEquationSolverRequirements.cpp +++ b/src/storm/solver/MinMaxLinearEquationSolverRequirements.cpp @@ -1,5 +1,8 @@ #include "storm/solver/MinMaxLinearEquationSolverRequirements.h" +#include "storm/utility/macros.h" +#include "storm/exceptions/IllegalArgumentException.h" + namespace storm { namespace solver { @@ -56,6 +59,7 @@ namespace storm { case Element::LowerBounds: return lowerBounds(); break; case Element::UpperBounds: return upperBounds(); break; } + STORM_LOG_THROW(false, storm::exceptions::IllegalArgumentException, "Unknown ElementType"); } void MinMaxLinearEquationSolverRequirements::clearUniqueSolution() { diff --git a/src/storm/solver/Multiplier.cpp b/src/storm/solver/Multiplier.cpp index 3347ef2dc..abcb53f3d 100644 --- a/src/storm/solver/Multiplier.cpp +++ b/src/storm/solver/Multiplier.cpp @@ -12,6 +12,7 @@ #include "storm/solver/NativeMultiplier.h" #include "storm/solver/GmmxxMultiplier.h" #include "storm/environment/solver/MultiplierEnvironment.h" +#include "storm/exceptions/IllegalArgumentException.h" namespace storm { namespace solver { @@ -79,6 +80,7 @@ namespace storm { case MultiplierType::Native: return std::make_unique>(matrix); } + STORM_LOG_THROW(false, storm::exceptions::IllegalArgumentException, "Unknown MultiplierType"); } template class Multiplier; diff --git a/src/storm/storage/dd/bisimulation/SignatureComputer.cpp b/src/storm/storage/dd/bisimulation/SignatureComputer.cpp index 89345ee9d..407ed33b9 100644 --- a/src/storm/storage/dd/bisimulation/SignatureComputer.cpp +++ b/src/storm/storage/dd/bisimulation/SignatureComputer.cpp @@ -6,6 +6,7 @@ #include "storm/utility/macros.h" #include "storm/exceptions/OutOfRangeException.h" +#include "storm/exceptions/IllegalArgumentException.h" namespace storm { namespace dd { @@ -23,6 +24,7 @@ namespace storm { case SignatureMode::Eager: return position < 1; case SignatureMode::Lazy: return position < 2; } + STORM_LOG_THROW(false, storm::exceptions::IllegalArgumentException, "Unknown SignatureMode"); } template diff --git a/src/storm/storage/jani/JSONExporter.cpp b/src/storm/storage/jani/JSONExporter.cpp index be2c98e9f..b0b315e8a 100644 --- a/src/storm/storage/jani/JSONExporter.cpp +++ b/src/storm/storage/jani/JSONExporter.cpp @@ -12,6 +12,7 @@ #include "storm/exceptions/InvalidJaniException.h" #include "storm/exceptions/NotImplementedException.h" #include "storm/exceptions/InvalidPropertyException.h" +#include "storm/exceptions/IllegalArgumentException.h" #include "storm/storage/expressions/RationalLiteralExpression.h" #include "storm/storage/expressions/IntegerLiteralExpression.h" @@ -120,9 +121,8 @@ namespace storm { return ">"; case storm::logic::ComparisonType::GreaterEqual: return "≥"; - default: - assert(false); } + STORM_LOG_THROW(false, storm::exceptions::IllegalArgumentException, "Unknown ComparisonType"); } modernjson::json numberToJson(storm::RationalNumber rn) { @@ -1104,10 +1104,8 @@ namespace storm { return "argmax"; case storm::modelchecker::FilterType::VALUES: return "values"; - default: - assert(false); - } + STORM_LOG_THROW(false, storm::exceptions::IllegalArgumentException, "Unknown FilterType"); } modernjson::json convertFilterExpression(storm::jani::FilterExpression const& fe, storm::jani::Model const& model, storm::jani::ModelFeatures& modelFeatures) { diff --git a/src/storm/utility/builder.cpp b/src/storm/utility/builder.cpp index a6b85e9b1..481ed8020 100644 --- a/src/storm/utility/builder.cpp +++ b/src/storm/utility/builder.cpp @@ -7,6 +7,8 @@ #include "storm/models/sparse/Pomdp.h" #include "storm/models/sparse/MarkovAutomaton.h" +#include "storm/exceptions/InvalidModelException.h" + namespace storm { namespace utility { namespace builder { @@ -27,6 +29,7 @@ namespace storm { case storm::models::ModelType::S2pg: return std::make_shared>(std::move(components)); } + STORM_LOG_THROW(false, storm::exceptions::InvalidModelException, "Unknown model type"); } template std::shared_ptr> buildModelFromComponents(storm::models::ModelType modelType, storm::storage::sparse::ModelComponents&& components); @@ -35,4 +38,4 @@ namespace storm { template std::shared_ptr> buildModelFromComponents(storm::models::ModelType modelType, storm::storage::sparse::ModelComponents&& components); } } -} \ No newline at end of file +}