STORM_LOG_TRACE("Creating next-state generator for PRISM program: "<<program);
STORM_LOG_THROW(!this->program.specifiesSystemComposition(),storm::exceptions::WrongFormatException,"The explicit next-state generator currently does not support custom system compositions.");
STORM_LOG_THROW(!this->program.specifiesSystemComposition(),storm::exceptions::WrongFormatException,"The explicit next-state generator currently does not support custom system compositions.");
// Only after checking validity of the program, we initialize the variable information.
// Only after checking validity of the program, we initialize the variable information.
STORM_LOG_THROW(!globalProgramInformation.hasInitialConstruct,storm::exceptions::WrongFormatException,"Parsing error in "<<this->getFilename()<<", line "<<get_line(qi::_3)<<": Program must not define two initial constructs.");
STORM_LOG_THROW(!globalProgramInformation.hasInitialConstruct,storm::exceptions::WrongFormatException,"Parsing error in "<<this->getFilename()<<", line "<<get_line(qi::_3)<<": Program must not define two initial constructs.");
STORM_LOG_THROW(renamingPair!=renaming.end(),storm::exceptions::WrongFormatException,"Parsing error in "<<this->getFilename()<<", line "<<get_line(qi::_3)<<": Boolean variable '"<<variable.getName()<<" was not renamed.");
STORM_LOG_THROW(renamingPair!=renaming.end(),storm::exceptions::WrongFormatException,"Parsing error in "<<this->getFilename()<<", line "<<get_line(qi::_3)<<": Boolean variable '"<<variable.getName()<<" was not renamed.");
STORM_LOG_THROW(renamingPair!=renaming.end(),storm::exceptions::WrongFormatException,"Parsing error in "<<this->getFilename()<<", line "<<get_line(qi::_3)<<": Integer variable '"<<variable.getName()<<" was not renamed.");
STORM_LOG_THROW(renamingPair!=renaming.end(),storm::exceptions::WrongFormatException,"Parsing error in "<<this->getFilename()<<", line "<<get_line(qi::_3)<<": Integer variable '"<<variable.getName()<<" was not renamed.");
this->addOption(storm::settings::OptionBuilder(moduleName,counterexampleOptionName,false,"Generates a counterexample for the given PRCTL formulas if not satisfied by the model")
this->addOption(storm::settings::OptionBuilder(moduleName,counterexampleOptionName,false,"Generates a counterexample for the given PRCTL formulas if not satisfied by the model")
@ -57,10 +56,6 @@ namespace storm {
.addArgument(storm::settings::ArgumentBuilder::createStringArgument("name","The name of an SMT solver. Available are: z3 and mathsat.").addValidationFunctionString(storm::settings::ArgumentValidators::stringInListValidator(smtSolvers)).setDefaultValueString("z3").build()).build());
.addArgument(storm::settings::ArgumentBuilder::createStringArgument("name","The name of an SMT solver. Available are: z3 and mathsat.").addValidationFunctionString(storm::settings::ArgumentValidators::stringInListValidator(smtSolvers)).setDefaultValueString("z3").build()).build());
this->addOption(storm::settings::OptionBuilder(moduleName,statisticsOptionName,false,"Sets whether to display statistics if available.").setShortName(statisticsOptionShortName).build());
this->addOption(storm::settings::OptionBuilder(moduleName,statisticsOptionName,false,"Sets whether to display statistics if available.").setShortName(statisticsOptionShortName).build());
this->addOption(storm::settings::OptionBuilder(moduleName,cudaOptionName,false,"Sets whether to use CUDA to speed up computation time.").build());
this->addOption(storm::settings::OptionBuilder(moduleName,cudaOptionName,false,"Sets whether to use CUDA to speed up computation time.").build());
this->addOption(storm::settings::OptionBuilder(moduleName,minMaxEquationSolvingTechniqueOptionName,false,"Sets which min/max linear equation solving technique is preferred.")
.addArgument(storm::settings::ArgumentBuilder::createStringArgument("name","The name of a min/max linear equation solving technique. Available are: value-iteration (vi) and policy-iteration (pi).").addValidationFunctionString(storm::settings::ArgumentValidators::stringInListValidator(minMaxSolvingTechniques)).setDefaultValueString("vi").build()).build());
STORM_LOG_THROW(storm::utility::isInteger(secondOperandAsRationalFunction),storm::exceptions::InvalidArgumentException,"Exponent of power operator must be a positive integer.");
STORM_LOG_THROW(storm::utility::isInteger(secondOperandAsRationalNumber),storm::exceptions::InvalidArgumentException,"Exponent of power operator must be a positive integer.");
STORM_LOG_THROW(lowerBound&&upperBound,storm::exceptions::NotImplementedException,"Jani Bounded Integer variables (for now) have to be bounded from both sides");
STORM_LOG_THROW(lowerBound&&upperBound,storm::exceptions::NotImplementedException,"Jani Bounded Integer variables (for now) have to be bounded from both sides");
STORM_LOG_THROW(definedUndefinedConstants.find(constantExpressionPair.first)!=definedUndefinedConstants.end(),storm::exceptions::InvalidArgumentException,"Unable to define non-existant constant.");
STORM_LOG_THROW(definedUndefinedConstants.find(constantExpressionPair.first)!=definedUndefinedConstants.end(),storm::exceptions::InvalidArgumentException,"Unable to define non-existant constant.");
STORM_LOG_THROW(!this->hasInitialConstruct(),storm::exceptions::WrongFormatException,"Error in "<<variable.getFilename()<<", line "<<variable.getLineNumber()<<": illegal to specify initial value if an initial construct is present.");
STORM_LOG_THROW(isValid,storm::exceptions::WrongFormatException,"Error in "<<variable.getFilename()<<", line "<<variable.getLineNumber()<<": initial value expression refers to unknown constants: "<<boost::algorithm::join(illegalVariableNames,",")<<".");
}
}
STORM_LOG_THROW(isValid,storm::exceptions::WrongFormatException,"Error in "<<variable.getFilename()<<", line "<<variable.getLineNumber()<<": initial value expression refers to unknown constants: "<<boost::algorithm::join(illegalVariableNames,",")<<".");
}
}
// Record the new identifier for future checks.
// Record the new identifier for future checks.
@ -853,16 +906,20 @@ namespace storm {
STORM_LOG_THROW(isValid,storm::exceptions::WrongFormatException,"Error in "<<variable.getFilename()<<", line "<<variable.getLineNumber()<<": upper bound expression refers to unknown constants: "<<boost::algorithm::join(illegalVariableNames,",")<<".");
STORM_LOG_THROW(isValid,storm::exceptions::WrongFormatException,"Error in "<<variable.getFilename()<<", line "<<variable.getLineNumber()<<": upper bound expression refers to unknown constants: "<<boost::algorithm::join(illegalVariableNames,",")<<".");
STORM_LOG_THROW(!this->hasInitialConstruct(),storm::exceptions::WrongFormatException,"Error in "<<variable.getFilename()<<", line "<<variable.getLineNumber()<<": illegal to specify initial value if an initial construct is present.");
STORM_LOG_THROW(isValid,storm::exceptions::WrongFormatException,"Error in "<<variable.getFilename()<<", line "<<variable.getLineNumber()<<": initial value expression refers to unknown constants: "<<boost::algorithm::join(illegalVariableNames,",")<<".");
}
}
STORM_LOG_THROW(isValid,storm::exceptions::WrongFormatException,"Error in "<<variable.getFilename()<<", line "<<variable.getLineNumber()<<": initial value expression refers to unknown constants: "<<boost::algorithm::join(illegalVariableNames,",")<<".");
STORM_LOG_THROW(!this->hasInitialConstruct(),storm::exceptions::WrongFormatException,"Error in "<<variable.getFilename()<<", line "<<variable.getLineNumber()<<": illegal to specify initial value if an initial construct is present.");
STORM_LOG_THROW(isValid,storm::exceptions::WrongFormatException,"Error in "<<variable.getFilename()<<", line "<<variable.getLineNumber()<<": initial value expression refers to unknown constants: "<<boost::algorithm::join(illegalVariableNames,",")<<".");
}
}
STORM_LOG_THROW(isValid,storm::exceptions::WrongFormatException,"Error in "<<variable.getFilename()<<", line "<<variable.getLineNumber()<<": initial value expression refers to unknown constants: "<<boost::algorithm::join(illegalVariableNames,",")<<".");
}
}
// Record the new identifier for future checks.
// Record the new identifier for future checks.
@ -918,17 +979,21 @@ namespace storm {
STORM_LOG_THROW(isValid,storm::exceptions::WrongFormatException,"Error in "<<variable.getFilename()<<", line "<<variable.getLineNumber()<<": upper bound expression refers to unknown constants: "<<boost::algorithm::join(illegalVariableNames,",")<<".");
STORM_LOG_THROW(isValid,storm::exceptions::WrongFormatException,"Error in "<<variable.getFilename()<<", line "<<variable.getLineNumber()<<": upper bound expression refers to unknown constants: "<<boost::algorithm::join(illegalVariableNames,",")<<".");
STORM_LOG_THROW(!this->hasInitialConstruct(),storm::exceptions::WrongFormatException,"Error in "<<variable.getFilename()<<", line "<<variable.getLineNumber()<<": illegal to specify initial value if an initial construct is present.");
STORM_LOG_THROW(isValid,storm::exceptions::WrongFormatException,"Error in "<<variable.getFilename()<<", line "<<variable.getLineNumber()<<": initial value expression refers to unknown constants: "<<boost::algorithm::join(illegalVariableNames,",")<<".");
}
}
STORM_LOG_THROW(isValid,storm::exceptions::WrongFormatException,"Error in "<<variable.getFilename()<<", line "<<variable.getLineNumber()<<": initial value expression refers to unknown constants: "<<boost::algorithm::join(illegalVariableNames,",")<<".");
STORM_LOG_THROW(isValid,storm::exceptions::WrongFormatException,"Error in "<<this->getInitialConstruct().getFilename()<<", line "<<this->getInitialConstruct().getLineNumber()<<": initial expression refers to unknown identifiers.");
STORM_LOG_THROW(isValid,storm::exceptions::WrongFormatException,"Error in "<<this->getInitialConstruct().getFilename()<<", line "<<this->getInitialConstruct().getLineNumber()<<": initial construct refers to unknown identifiers.");
}
// Check the system composition if given.
// Check the system composition if given.
if(systemCompositionConstruct){
if(systemCompositionConstruct){
@ -1151,17 +1218,28 @@ namespace storm {
}
}
ProgramProgram::simplify(){
ProgramProgram::simplify(){
// Start by substituting the constants, because this will potentially erase some commands or even actions.
xxxxxxxxxx