STORM_LOG_THROW(discreteTimeModel->isOfType(storm::models::ModelType::Dtmc)||discreteTimeModel->isOfType(storm::models::ModelType::Mdp),storm::exceptions::UnexpectedException,"Transformation to discrete time model has failed.");
STORM_LOG_THROW(this->currentCheckTask,storm::exceptions::InvalidStateException,"Checking has been invoked but no property has been specified before.");
STORM_LOG_THROW(this->currentCheckTask,storm::exceptions::InvalidStateException,"Checking has been invoked but no property has been specified before.");
STORM_LOG_THROW(this->currentCheckTask,storm::exceptions::InvalidStateException,"Checking has been invoked but no property has been specified before.");
STORM_LOG_THROW(this->currentCheckTask,storm::exceptions::InvalidStateException,"Checking has been invoked but no property has been specified before.");
STORM_LOG_THROW(false,storm::exceptions::NotImplementedException,"Could not get a string from the region check engine. The case has not been implemented");
ExactParameterLifting,/*!< Parameter lifting approach with exact arithmethics*/
ValidatingParameterLifting,/*!< Parameter lifting approach with a) inexact (and fast) computation first and b) exact validation of obtained results second */
STORM_LOG_THROW(parametricModel.getInitialStates().getNumberOfSetBits()==1,storm::exceptions::NotSupportedException,"Parameter lifting requires models with only one initial state");
STORM_LOG_THROW(checkTask.isOnlyInitialStatesRelevantSet(),storm::exceptions::NotSupportedException,"Parameter lifting requires a property where only the value in the initial states is relevant.");
STORM_LOG_THROW(checkTask.isBoundSet(),storm::exceptions::NotSupportedException,"Parameter lifting requires a bounded property.");
STORM_LOG_THROW(!unprocessedRegions.empty(),storm::exceptions::InvalidStateException,"Threshold for undiscovered area not reached but no unprocessed regions left.");
STORM_LOG_INFO("Analyzing region #"<<numOfAnalyzedRegions<<" ("<<storm::utility::convertNumber<double>(fractionOfUndiscoveredArea)*100<<"% still unknown)");
STORM_LOG_THROW(false,storm::exceptions::NotImplementedException,"Could not get a string from the region check result. The case has not been implemented");
STORM_LOG_THROW(false,storm::exceptions::NotImplementedException,"Could not get a string from the region check result. The case has not been implemented");
STORM_LOG_THROW(!checkTask.getFormula().hasLowerBound(),storm::exceptions::NotSupportedException,"Lower step bounds are not supported.");
STORM_LOG_THROW(checkTask.getFormula().hasUpperBound(),storm::exceptions::NotSupportedException,"Expected a bounded until formula with an upper bound.");
STORM_LOG_THROW(checkTask.getFormula().isStepBounded(),storm::exceptions::NotSupportedException,"Expected a bounded until formula with step bounds.");
STORM_LOG_THROW(*stepBound>0,storm::exceptions::NotSupportedException,"Can not apply parameter lifting on step bounded formula: The step bound has to be positive.");
if(checkTask.getFormula().isUpperBoundStrict()){
STORM_LOG_THROW(*stepBound>0,storm::exceptions::NotSupportedException,"Expected a strict upper step bound that is greater than zero.");
--(*stepBound);
}
STORM_LOG_THROW(*stepBound>0,storm::exceptions::NotSupportedException,"Can not apply parameter lifting on step bounded formula: The step bound has to be positive.");
STORM_LOG_THROW(propositionalChecker.canHandle(checkTask.getFormula().getLeftSubformula())&&propositionalChecker.canHandle(checkTask.getFormula().getRightSubformula()),storm::exceptions::NotSupportedException,"Parameter lifting with non-propositional subformulas is not supported");
STORM_LOG_THROW(!checkTask.getFormula().hasLowerBound(),storm::exceptions::NotSupportedException,"Lower step bounds are not supported.");
STORM_LOG_THROW(checkTask.getFormula().hasUpperBound(),storm::exceptions::NotSupportedException,"Expected a bounded until formula with an upper bound.");
STORM_LOG_THROW(checkTask.getFormula().isStepBounded(),storm::exceptions::NotSupportedException,"Expected a bounded until formula with step bounds.");
STORM_LOG_THROW(*stepBound>0,storm::exceptions::NotSupportedException,"Can not apply parameter lifting on step bounded formula: The step bound has to be positive.");
if(checkTask.getFormula().isUpperBoundStrict()){
STORM_LOG_THROW(*stepBound>0,storm::exceptions::NotSupportedException,"Expected a strict upper step bound that is greater than zero.");
--(*stepBound);
}
STORM_LOG_THROW(*stepBound>0,storm::exceptions::NotSupportedException,"Can not apply parameter lifting on step bounded formula: The step bound has to be positive.");
STORM_LOG_THROW(propositionalChecker.canHandle(checkTask.getFormula().getLeftSubformula())&&propositionalChecker.canHandle(checkTask.getFormula().getRightSubformula()),storm::exceptions::NotSupportedException,"Parameter lifting with non-propositional subformulas is not supported");
STORM_LOG_THROW(propositionalChecker.canHandle(checkTask.getFormula().getLeftSubformula())&&propositionalChecker.canHandle(checkTask.getFormula().getRightSubformula()),storm::exceptions::NotSupportedException,"Parameter lifting with non-propositional subformulas is not supported");
STORM_LOG_THROW(propositionalChecker.canHandle(checkTask.getFormula().getSubformula()),storm::exceptions::NotSupportedException,"Parameter lifting with non-propositional subformulas is not supported");
// if there are maybestates, create the parameterLifter
if(!maybeStates.empty()){
// Create the reward vector
STORM_LOG_THROW((checkTask.isRewardModelSet()&&this->parametricModel.hasRewardModel(checkTask.getRewardModel()))||(!checkTask.isRewardModelSet()&&this->parametricModel.hasUniqueRewardModel()),storm::exceptions::InvalidPropertyException,"The reward model specified by the CheckTask is not available in the given model.");
STORM_LOG_THROW(propositionalChecker.canHandle(checkTask.getFormula().getLeftSubformula())&&propositionalChecker.canHandle(checkTask.getFormula().getRightSubformula()),storm::exceptions::NotSupportedException,"Parameter lifting with non-propositional subformulas is not supported");
STORM_LOG_THROW(*stepBound>0,storm::exceptions::NotSupportedException,"Expected a strict upper step bound that is greater than zero.");
--(*stepBound);
}
STORM_LOG_THROW(*stepBound>0,storm::exceptions::NotSupportedException,"Can not apply parameter lifting on step bounded formula: The step bound has to be positive.");
STORM_LOG_THROW(propositionalChecker.canHandle(checkTask.getFormula().getSubformula()),storm::exceptions::NotSupportedException,"Parameter lifting with non-propositional subformulas is not supported");
// if there are maybestates, create the parameterLifter
if(!maybeStates.empty()){
// Create the reward vector
STORM_LOG_THROW((checkTask.isRewardModelSet()&&this->parametricModel.hasRewardModel(checkTask.getRewardModel()))||(!checkTask.isRewardModelSet()&&this->parametricModel.hasUniqueRewardModel()),storm::exceptions::InvalidPropertyException,"The reward model specified by the CheckTask is not available in the given model.");
STORM_LOG_THROW(*stepBound>0,storm::exceptions::NotSupportedException,"Expected a strict upper step bound that is greater than zero.");
--(*stepBound);
}
STORM_LOG_THROW(*stepBound>0,storm::exceptions::NotSupportedException,"Can not apply parameter lifting on step bounded formula: The step bound has to be positive.");
STORM_LOG_THROW((checkTask.isRewardModelSet()&&this->parametricModel.hasRewardModel(checkTask.getRewardModel()))||(!checkTask.isRewardModelSet()&&this->parametricModel.hasUniqueRewardModel()),storm::exceptions::InvalidPropertyException,"The reward model specified by the CheckTask is not available in the given model.");
STORM_LOG_THROW(!checkTask.getFormula().hasLowerBound(),storm::exceptions::NotSupportedException,"Lower step bounds are not supported.");
STORM_LOG_THROW(checkTask.getFormula().hasUpperBound(),storm::exceptions::NotSupportedException,"Expected a bounded until formula with an upper bound.");
STORM_LOG_THROW(checkTask.getFormula().isStepBounded(),storm::exceptions::NotSupportedException,"Expected a bounded until formula with step bounds.");
STORM_LOG_THROW(*stepBound>0,storm::exceptions::NotSupportedException,"Can not apply parameter lifting on step bounded formula: The step bound has to be positive.");
if(checkTask.getFormula().isUpperBoundStrict()){
STORM_LOG_THROW(*stepBound>0,storm::exceptions::NotSupportedException,"Expected a strict upper step bound that is greater than zero.");
STORM_LOG_THROW(!checkTask.getFormula().hasLowerBound(),storm::exceptions::NotSupportedException,"Lower step bounds are not supported.");
STORM_LOG_THROW(checkTask.getFormula().hasUpperBound(),storm::exceptions::NotSupportedException,"Expected a bounded until formula with an upper bound.");
STORM_LOG_THROW(checkTask.getFormula().isStepBounded(),storm::exceptions::NotSupportedException,"Expected a bounded until formula with step bounds.");
STORM_LOG_THROW(*stepBound>0,storm::exceptions::NotSupportedException,"Can not apply parameter lifting on step bounded formula: The step bound has to be positive.");
if(checkTask.getFormula().isUpperBoundStrict()){
STORM_LOG_THROW(*stepBound>0,storm::exceptions::NotSupportedException,"Expected a strict upper step bound that is greater than zero.");
--(*stepBound);
}
STORM_LOG_THROW(*stepBound>0,storm::exceptions::NotSupportedException,"Can not apply parameter lifting on step bounded formula: The step bound has to be positive.");
STORM_LOG_THROW(*stepBound>0,storm::exceptions::NotSupportedException,"Can not apply parameter lifting on step bounded formula: The step bound has to be positive.");
STORM_LOG_THROW(propositionalChecker.canHandle(checkTask.getFormula().getLeftSubformula())&&propositionalChecker.canHandle(checkTask.getFormula().getRightSubformula()),storm::exceptions::NotSupportedException,"Parameter lifting with non-propositional subformulas is not supported");
STORM_LOG_THROW(propositionalChecker.canHandle(checkTask.getFormula().getLeftSubformula())&&propositionalChecker.canHandle(checkTask.getFormula().getRightSubformula()),storm::exceptions::NotSupportedException,"Parameter lifting with non-propositional subformulas is not supported");
STORM_LOG_THROW(propositionalChecker.canHandle(checkTask.getFormula().getLeftSubformula())&&propositionalChecker.canHandle(checkTask.getFormula().getRightSubformula()),storm::exceptions::NotSupportedException,"Parameter lifting with non-propositional subformulas is not supported");
STORM_LOG_THROW(propositionalChecker.canHandle(checkTask.getFormula().getLeftSubformula())&&propositionalChecker.canHandle(checkTask.getFormula().getRightSubformula()),storm::exceptions::NotSupportedException,"Parameter lifting with non-propositional subformulas is not supported");
// Check whether there is an EC consisting of maybestates
applyPreviousResultAsHint=storm::solver::minimize(checkTask.getOptimizationDirection())||// when minimizing, there can not be an EC within the maybestates
// Check whether there is an EC consisting of maybestates
applyPreviousResultAsHint=storm::solver::minimize(checkTask.getOptimizationDirection())||// when minimizing, there can not be an EC within the maybestates
STORM_LOG_THROW(propositionalChecker.canHandle(checkTask.getFormula().getSubformula()),storm::exceptions::NotSupportedException,"Parameter lifting with non-propositional subformulas is not supported");
STORM_LOG_THROW(propositionalChecker.canHandle(checkTask.getFormula().getSubformula()),storm::exceptions::NotSupportedException,"Parameter lifting with non-propositional subformulas is not supported");
// if there are maybestates, create the parameterLifter
if(!maybeStates.empty()){
// Create the reward vector
STORM_LOG_THROW((checkTask.isRewardModelSet()&&this->parametricModel.hasRewardModel(checkTask.getRewardModel()))||(!checkTask.isRewardModelSet()&&this->parametricModel.hasUniqueRewardModel()),storm::exceptions::InvalidPropertyException,"The reward model specified by the CheckTask is not available in the given model.");
// We need to handle choices that lead to an infinity state.
// As a maybeState does not have reward infinity, a choice leading to an infinity state will never be picked. Hence, we can unselect the corresponding rows
// if there are maybestates, create the parameterLifter
if(!maybeStates.empty()){
// Create the reward vector
STORM_LOG_THROW((checkTask.isRewardModelSet()&&this->parametricModel.hasRewardModel(checkTask.getRewardModel()))||(!checkTask.isRewardModelSet()&&this->parametricModel.hasUniqueRewardModel()),storm::exceptions::InvalidPropertyException,"The reward model specified by the CheckTask is not available in the given model.");
// Check whether there is an EC consisting of maybestates
applyPreviousResultAsHint=!storm::solver::minimize(checkTask.getOptimizationDirection())||// when maximizing, there can not be an EC within the maybestates
// We need to handle choices that lead to an infinity state.
// As a maybeState does not have reward infinity, a choice leading to an infinity state will never be picked. Hence, we can unselect the corresponding rows
// Check whether there is an EC consisting of maybestates
applyPreviousResultAsHint=!storm::solver::minimize(checkTask.getOptimizationDirection())||// when maximizing, there can not be an EC within the maybestates
STORM_LOG_THROW(*stepBound>0,storm::exceptions::NotSupportedException,"Expected a strict upper step bound that is greater than zero.");
--(*stepBound);
}
STORM_LOG_THROW(*stepBound>0,storm::exceptions::NotSupportedException,"Can not apply parameter lifting on step bounded formula: The step bound has to be positive.");
STORM_LOG_THROW(*stepBound>0,storm::exceptions::NotSupportedException,"Can not apply parameter lifting on step bounded formula: The step bound has to be positive.");
STORM_LOG_THROW((checkTask.isRewardModelSet()&&this->parametricModel.hasRewardModel(checkTask.getRewardModel()))||(!checkTask.isRewardModelSet()&&this->parametricModel.hasUniqueRewardModel()),storm::exceptions::InvalidPropertyException,"The reward model specified by the CheckTask is not available in the given model.");
STORM_LOG_THROW((checkTask.isRewardModelSet()&&this->parametricModel.hasRewardModel(checkTask.getRewardModel()))||(!checkTask.isRewardModelSet()&&this->parametricModel.hasUniqueRewardModel()),storm::exceptions::InvalidPropertyException,"The reward model specified by the CheckTask is not available in the given model.");
STORM_LOG_THROW(this->currentCheckTask->isOnlyInitialStatesRelevantSet(),storm::exceptions::NotSupportedException,"Analyzing regions with parameter lifting requires a property where only the value in the initial states is relevant.");
STORM_LOG_THROW(this->currentCheckTask->isBoundSet(),storm::exceptions::NotSupportedException,"Analyzing regions with parameter lifting requires a bounded property.");
STORM_LOG_THROW(this->parametricModel.getInitialStates().getNumberOfSetBits()==1,storm::exceptions::NotSupportedException,"Analyzing regions with parameter lifting requires a model with a single initial state.");
STORM_LOG_THROW(positionOfFirstRelation!=std::string::npos,storm::exceptions::InvalidArgumentException,"When parsing the region"<<parameterBoundariesString<<" I could not find a '<=' after the first number");
STORM_LOG_THROW(positionOfSecondRelation!=std::string::npos,storm::exceptions::InvalidArgumentException,"When parsing the region"<<parameterBoundariesString<<" I could not find a '<=' after the parameter");
STORM_LOG_THROW(parameter.length()>0,storm::exceptions::InvalidArgumentException,"When parsing the region"<<parameterBoundariesString<<" I could not find a parameter");
std::unique_ptr<VariableType>var;
for(autoconst&v:consideredVariables){
std::stringstreamstream;
stream<<v;
std::stringvAsString=stream.str();
if(parameter==stream.str()){
var=std::make_unique<VariableType>(v);
}
}
STORM_LOG_ASSERT(var,"Could not find parameter "<<parameter<<" in the set of considered variables");
this->addOption(storm::settings::OptionBuilder(moduleName,encodeSmt2StrategyOptionName,true,"Set the smt2 encoding strategy.")
.addArgument(storm::settings::ArgumentBuilder::createStringArgument("strategy","the used strategy").build()).build());
this->addOption(storm::settings::OptionBuilder(moduleName,exportSmt2DestinationPathOptionName,true,"A path to a file where the result should be saved.")
this->addOption(storm::settings::OptionBuilder(moduleName,exportResultOptionName,true,"A path to a file where the parametric result should be saved.")
this->addOption(storm::settings::OptionBuilder(moduleName,exportResultDestinationPathOptionName,true,"A path to a file where the smt2 encoding should be saved.")
this->addOption(storm::settings::OptionBuilder(moduleName,parameterSpaceOptionName,true,"Sets the considered parameter-space (i.e., the initial region) for parameter lifting.")
.addArgument(storm::settings::ArgumentBuilder::createStringArgument("region","The parameter-space (given in format a<=x<=b,c<=y<=d).").build()).build());
this->addOption(storm::settings::OptionBuilder(moduleName,refinementThresholdOptionName,true,"Parameter space refinement converges if the fraction of unknown area falls below this threshold.")
this->addOption(storm::settings::OptionBuilder(moduleName,exactValidationOptionName,true,"Sets whether numerical results from Parameter lifting should be validated with exact techniques.").build());
this->addOption(storm::settings::OptionBuilder(moduleName,simplifyOptionName,true,"Sets whether to perform simplification steps before model analysis.").build());
this->addOption(storm::settings::OptionBuilder(moduleName,derivativesOptionName,true,"Sets whether to generate the derivatives of the resulting rational function.").build());
this->addOption(storm::settings::OptionBuilder(moduleName,regionOptionName,true,"Sets the region(s) considered for analysis.")
.addArgument(storm::settings::ArgumentBuilder::createStringArgument("regioninput","The region(s) given in format a<=x<=b,c<=y<=d seperated by ';'. Can also be point to a file.").build()).build());
this->addOption(storm::settings::OptionBuilder(moduleName,refineOptionName,true,"Enables region refinement.")
.addArgument(storm::settings::ArgumentBuilder::createDoubleArgument("threshold","Refinement converges if the fraction of unknown area falls below this threshold.").setDefaultValueDouble(0.05).addValidatorDouble(storm::settings::ArgumentValidatorFactory::createDoubleRangeValidatorExcluding(0.0,1.0)).build()).build());
this->addOption(storm::settings::OptionBuilder(moduleName,checkEngineOptionName,false,"Sets which engine is used for analyzing regions.")
.addArgument(storm::settings::ArgumentBuilder::createStringArgument("name","The name of the engine to use.").addValidatorString(ArgumentValidatorFactory::createMultipleChoiceValidator(engines)).setDefaultValueString("pl").build()).build());
this->addOption(storm::settings::OptionBuilder(moduleName,printNoIllustrationOptionName,true,"If set, no illustration of the result is printed.").build());
this->addOption(storm::settings::OptionBuilder(moduleName,printFullResultOptionName,true,"If set, the full result for every region is printed.").build());
STORM_LOG_THROW(positionOfFirstRelation!=std::string::npos,storm::exceptions::InvalidArgumentException,"When parsing the region"<<parameterBoundariesString<<" I could not find a '<=' after the first number");
STORM_LOG_THROW(positionOfSecondRelation!=std::string::npos,storm::exceptions::InvalidArgumentException,"When parsing the region"<<parameterBoundariesString<<" I could not find a '<=' after the parameter");
STORM_LOG_THROW(parameter.length()>0,storm::exceptions::InvalidArgumentException,"When parsing the region"<<parameterBoundariesString<<" I could not find a parameter");
std::unique_ptr<VariableType>var;
for(autoconst&v:consideredVariables){
std::stringstreamstream;
stream<<v;
std::stringvAsString=stream.str();
if(parameter==stream.str()){
var=std::make_unique<VariableType>(v);
}
}
STORM_LOG_ASSERT(var,"Could not find parameter "<<parameter<<" in the set of considered variables");
STORM_LOG_WARN("The input model contains a non-linear polynomial as transition: '"<<entry.getValue()<<"'. Can not validate that parameter lifting is sound on this model.");
STORM_LOG_WARN("The input model contains a non-linear polynomial as transition rate: '"<<storm::utility::simplify(entry.getValue()*exitRate)<<"'. Can not validate that parameter lifting is sound on this model.");
STORM_LOG_WARN("The input model contains a non-linear polynomial as transition: '"<<entry.getValue()<<"'. Can not validate that parameter lifting is sound on this model.");
STORM_LOG_WARN("The input model contains a non-linear polynomial as action reward: '"<<rew<<"'. Can not validate that parameter lifting is sound on this model.");