STORM_LOG_THROW(storm::settings::regionSettings().isRegionsSet()||storm::settings::regionSettings().isRegionFileSet(),storm::exceptions::InvalidSettingsException,"Tried to obtain regions from the settings but no regions are specified.");
STORM_LOG_THROW(!(storm::settings::regionSettings().isRegionsSet()&&storm::settings::regionSettings().isRegionFileSet()),storm::exceptions::InvalidSettingsException,"Regions are specified via file AND cmd line. Only one option is allowed.");
STORM_LOG_THROW(storm::settings::getModule<storm::settings::modules::RegionSettings>().isRegionsSet()||storm::settings::getModule<storm::settings::modules::RegionSettings>().isRegionFileSet(),storm::exceptions::InvalidSettingsException,"Tried to obtain regions from the settings but no regions are specified.");
STORM_LOG_THROW(!(storm::settings::getModule<storm::settings::modules::RegionSettings>().isRegionsSet()&&storm::settings::getModule<storm::settings::modules::RegionSettings>().isRegionFileSet()),storm::exceptions::InvalidSettingsException,"Regions are specified via file AND cmd line. Only one option is allowed.");
//if we reach this point we can assume that the region is given as a file.
STORM_LOG_THROW(storm::parser::MappedFile::fileExistsAndIsReadable(storm::settings::regionSettings().getRegionFilePath().c_str()),storm::exceptions::InvalidSettingsException,"The path to the file in which the regions are specified is not valid.");
STORM_LOG_THROW(storm::parser::MappedFile::fileExistsAndIsReadable(storm::settings::getModule<storm::settings::modules::RegionSettings>().getRegionFilePath().c_str()),storm::exceptions::InvalidSettingsException,"The path to the file in which the regions are specified is not valid.");
STORM_LOG_DEBUG("Building the resulting simplified model.");
//The matrix. The flexibleTransitions matrix might have empty rows where states have been eliminated.
//The new matrix should not have such rows. We therefore leave them out, but we have to change the indices of the states accordingly.
std::vector<storm::storage::sparse::state_type>newStateIndexMap(flexibleTransitions.getNumberOfRows(),flexibleTransitions.getNumberOfRows());//initialize with some illegal index to easily check if a transition leads to an unselected state
std::vector<storm::storage::sparse::state_type>newStateIndexMap(flexibleTransitions.getRowCount(),flexibleTransitions.getRowCount());//initialize with some illegal index to easily check if a transition leads to an unselected state
STORM_LOG_THROW(newStateIndexMap[entry.getColumn()]!=flexibleTransitions.getNumberOfRows(),storm::exceptions::UnexpectedException,"There is a transition to a state that should have been eliminated.");
STORM_LOG_THROW(newStateIndexMap[entry.getColumn()]!=flexibleTransitions.getRowCount(),storm::exceptions::UnexpectedException,"There is a transition to a state that should have been eliminated.");
STORM_LOG_THROW((storm::settings::regionSettings().getSmtMode()==storm::settings::modules::RegionSettings::SmtMode::FUNCTION),storm::exceptions::NotImplementedException,"Selected SMT mode has not been implemented.");
STORM_LOG_THROW((storm::settings::getModule<storm::settings::modules::RegionSettings>().getSmtMode()==storm::settings::modules::RegionSettings::SmtMode::FUNCTION),storm::exceptions::NotImplementedException,"Selected SMT mode has not been implemented.");
STORM_LOG_DEBUG("Eliminated "<<subsystem.size()-subsystem.getNumberOfSetBits()<<" of "<<subsystem.size()<<" states that had constant outgoing transitions.");
//Build the simple model
STORM_LOG_DEBUG("Building the resulting simplified model.");
//The matrix. The flexibleTransitions matrix might have empty rows where states have been eliminated.
//The new matrix should not have such rows. We therefore leave them out, but we have to change the indices of the states accordingly.
std::vector<storm::storage::sparse::state_type>newStateIndexMap(flexibleTransitions.getNumberOfRows(),flexibleTransitions.getNumberOfRows());//initialize with some illegal index
std::vector<storm::storage::sparse::state_type>newStateIndexMap(flexibleTransitions.getRowCount(),flexibleTransitions.getRowCount());//initialize with some illegal index
STORM_LOG_THROW(newStateIndexMap[entry.getColumn()]!=flexibleTransitions.getNumberOfRows(),storm::exceptions::UnexpectedException,"There is a transition to a state that should have been eliminated.");
STORM_LOG_THROW(newStateIndexMap[entry.getColumn()]!=flexibleTransitions.getRowCount(),storm::exceptions::UnexpectedException,"There is a transition to a state that should have been eliminated.");
STORM_LOG_WARN_COND((!storm::settings::regionSettings().doApprox()||this->isApproximationApplicable),"the approximation is only correct if the model has only linear functions (more precisely: linear in a single parameter, i.e., functions like p*q are okay). As this is not the case, approximation is deactivated");
STORM_LOG_WARN_COND((!storm::settings::getModule<storm::settings::modules::RegionSettings>().doApprox()||this->isApproximationApplicable),"the approximation is only correct if the model has only linear functions (more precisely: linear in a single parameter, i.e., functions like p*q are okay). As this is not the case, approximation is deactivated");
STORM_LOG_THROW((guard.getType()==carl::VariableType::VT_BOOL),storm::exceptions::IllegalArgumentException,"Tried to add a guarded constraint, but the guard is not of type bool.");
//if some of the occurring variables are not declared yet, we will have to (including the guard!).
STORM_LOG_THROW((variable.getType()==carl::VariableType::VT_BOOL),storm::exceptions::IllegalArgumentException,"Tried to add a constraint that consists of a non-boolean variable.");