STORM_LOG_THROW(variablePair!=variableMapping->end(),storm::exceptions::InvalidArgumentException,"Cannot translate the given expression, because it contains the variable '"<<expression.getVariableName()<<"' for which no DD counterpart is known.");
STORM_LOG_THROW(false,storm::exceptions::InvalidArgumentException,"Program still contains these undefined constants: "<<boost::join(strings,", ")<<".");
STORM_LOG_THROW(automata.size()==this->model.getNumberOfAutomata(),storm::exceptions::InvalidArgumentException,"Cannot build symbolic model from JANI model whose system composition refers to a subset of automata.");
// Then, check that the model does not contain unbounded integer variables.
// Then, check that the model does not contain unbounded integer or non-transient real variables.
STORM_LOG_THROW(!this->model.getGlobalVariables().containsUnboundedIntegerVariables(),storm::exceptions::InvalidArgumentException,"Cannot build symbolic model from JANI model that contains global unbounded integer variables.");
STORM_LOG_THROW(!automaton.getVariables().containsUnboundedIntegerVariables(),storm::exceptions::InvalidArgumentException,"Cannot build symbolic model from JANI model that contains unbounded integer variables in automaton '"<<automaton.getName()<<"'.");
}
STORM_LOG_THROW(!this->model.getGlobalVariables().containsNonTransientRealVariables(),storm::exceptions::InvalidArgumentException,"Cannot build symbolic model from JANI model that contains global non-transient real variables.");
STORM_LOG_THROW(!automaton.getVariables().containsNonTransientRealVariables(),storm::exceptions::InvalidArgumentException,"Cannot build symbolic model from JANI model that contains non-transient real variables in automaton '"<<automaton.getName()<<"'.");
}
// Based on this assumption, we create the variables.
returncreateVariables();
@ -243,6 +241,7 @@ namespace storm {
// Start by creating a meta variable for the location of the automaton.
STORM_LOG_THROW(rewardModelName.empty(),storm::exceptions::InvalidArgumentException,"Cannot build unknown reward model '"<<rewardModelName<<"'.");
STORM_LOG_THROW(globalVariables.getNumberOfTransientVariables()==1,storm::exceptions::InvalidArgumentException,"Reference to standard reward model is ambiguous.");
}
}
// If no reward model was yet added, but there was one that was given in the options, we try to build the
STORM_LOG_THROW(labelName=="init"||labelName=="deadlock",storm::exceptions::InvalidArgumentException,"Terminal states refer to illegal label '"<<labelName<<"'.");
STORM_LOG_THROW(labelName=="init"||labelName=="deadlock",storm::exceptions::InvalidArgumentException,"Terminal states refer to illegal label '"<<labelName<<"'.");
}
@ -1377,18 +1370,18 @@ namespace storm {
// First, we make sure that all selected reward models actually exist.
STORM_LOG_THROW(rewardModelName.empty()||preparedProgram->hasRewardModel(rewardModelName),storm::exceptions::InvalidArgumentException,"Model does not possess a reward model with the name '"<<rewardModelName<<"'.");
STORM_LOG_THROW(rewardModelName.empty()||program.hasRewardModel(rewardModelName),storm::exceptions::InvalidArgumentException,"Model does not possess a reward model with the name '"<<rewardModelName<<"'.");
STORM_LOG_THROW(storm::settings::getModule<storm::settings::modules::CoreSettings>().getEngine()==storm::settings::modules::CoreSettings::Engine::Sparse,storm::exceptions::InvalidSettingsException,"Only the sparse engine supports explicit model input.");
STORM_LOG_THROW(model.isPrismProgram(),storm::exceptions::InvalidSettingsException,"Exploration engine is currently only applicable to PRISM models.");
STORM_LOG_THROW(program.getModelType()==storm::prism::Program::ModelType::DTMC||program.getModelType()==storm::prism::Program::ModelType::MDP,storm::exceptions::InvalidSettingsException,"Currently exploration-based verification is only available for DTMCs and MDPs.");
STORM_LOG_THROW(storm::settings::getModule<storm::settings::modules::CoreSettings>().getEngine()==storm::settings::modules::CoreSettings::Engine::Sparse,storm::exceptions::InvalidSettingsException,"Cannot use this data type with an engine different than the sparse one.");
STORM_LOG_THROW(storm::settings::getModule<storm::settings::modules::CoreSettings>().getEngine()==storm::settings::modules::CoreSettings::Engine::Sparse,storm::exceptions::InvalidSettingsException,"Cannot use this data type with an engine different than the sparse one.");
STORM_LOG_THROW(model.hasDefaultComposition(),storm::exceptions::WrongFormatException,"The explicit next-state generator currently does not support custom system compositions.");
STORM_LOG_THROW(!this->options.isBuildAllRewardModelsSet()&&this->options.getRewardModelNames().empty(),storm::exceptions::InvalidSettingsException,"The explicit next-state generator currently does not support building reward models.");
STORM_LOG_THROW(!model.hasNonGlobalTransientVariable(),storm::exceptions::InvalidSettingsException,"The explicit next-state generator currently does not support automata-local transient variables.");
STORM_LOG_THROW(rewardModelName.empty(),storm::exceptions::InvalidArgumentException,"Cannot build unknown reward model '"<<rewardModelName<<"'.");
STORM_LOG_THROW(globalVariables.getNumberOfTransientVariables()==1,storm::exceptions::InvalidArgumentException,"Reference to standard reward model is ambiguous.");
}
}
// If no reward model was yet added, but there was one that was given in the options, we try to build the
// Check that the resulting distribution is in fact a distribution.
STORM_LOG_THROW(!this->isDiscreteTimeModel()||this->comparator.isOne(probabilitySum),storm::exceptions::WrongFormatException,"Probabilities do not sum to one for edge (actually sum to "<<probabilitySum<<").");
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.");
// Only after checking validity of the program, we initialize the variable information.
STORM_LOG_THROW(rewardModelName.empty(),storm::exceptions::InvalidArgumentException,"Cannot build unknown reward model '"<<rewardModelName<<"'.");
STORM_LOG_THROW(this->program.getNumberOfRewardModels()==1,storm::exceptions::InvalidArgumentException,"Reference to standard reward model is ambiguous.");
STORM_LOG_THROW(this->program.getNumberOfRewardModels()>0,storm::exceptions::InvalidArgumentException,"Reference to standard reward model is invalid, because there is no reward model.");
}
}
// If no reward model was yet added, but there was one that was given in the options, we try to build
// If no reward model was yet added, but there was one that was given in the options, we try to build the
STORM_LOG_THROW(transientValueEntry.count("ref")==1,storm::exceptions::InvalidJaniException,"Transient values in location "<<locName<<" need exactly one ref that is assigned to");
STORM_LOG_THROW(transientValueEntry.count("value")==1,storm::exceptions::InvalidJaniException,"Transient values in location "<<locName<<" need exactly one assigned value");
storm::jani::Variableconst&lhs=getLValue(transientValueEntry.at("ref"),parentModel.getGlobalVariables(),automaton.getVariables(),"LHS of assignment in location "+locName+" (automaton '"+name+"')");
STORM_LOG_THROW(lhs.isTransientVariable(),storm::exceptions::InvalidJaniException,"Assigned non-transient variable "+lhs.getName()+" in location "+locName+" (automaton: '"+name+"')");
STORM_LOG_THROW(lhs.isTransient(),storm::exceptions::InvalidJaniException,"Assigned non-transient variable "+lhs.getName()+" in location "+locName+" (automaton: '"+name+"')");
storm::expressions::Expressionrhs=parseExpression(transientValueEntry.at("value"),"Assignment of variable "+lhs.getName()+" in location "+locName+" (automaton: '"+name+"')");
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)<<": 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")
@ -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());
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,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());
// Ensure that the model was given either symbolically or explicitly.
STORM_LOG_THROW(!isMinimalCommandSetGenerationSet()||storm::settings::getModule<storm::settings::modules::IOSettings>().isSymbolicSet(),storm::exceptions::InvalidSettingsException,"For the generation of a minimal command set, the model has to be specified symbolically.");
STORM_LOG_THROW(!isMinimalCommandSetGenerationSet()||storm::settings::getModule<storm::settings::modules::IOSettings>().isPrismInputSet(),storm::exceptions::InvalidSettingsException,"For the generation of a minimal command set, the model has to be specified in the PRISM format.");
if(isMinimalCommandSetGenerationSet()){
STORM_LOG_WARN_COND(isUseMaxSatBasedMinimalCommandSetGenerationSet()||!isEncodeReachabilitySet(),"Encoding reachability is only available for the MaxSat-based minimal command set generation, so selecting it has no effect.");
this->addOption(storm::settings::OptionBuilder(moduleName,explicitOptionName,false,"Parses the model given in an explicit (sparse) representation.").setShortName(explicitOptionShortName)
.addArgument(storm::settings::ArgumentBuilder::createStringArgument("transition filename","The name of the file from which to read the transitions.").addValidationFunctionString(storm::settings::ArgumentValidators::existingReadableFileValidator()).build())
.addArgument(storm::settings::ArgumentBuilder::createStringArgument("labeling filename","The name of the file from which to read the state labeling.").addValidationFunctionString(storm::settings::ArgumentValidators::existingReadableFileValidator()).build()).build());
this->addOption(storm::settings::OptionBuilder(moduleName,symbolicOptionName,false,"Parses the model given in a symbolic representation.").setShortName(symbolicOptionShortName)
.addArgument(storm::settings::ArgumentBuilder::createStringArgument("filename","The name of the file from which to read the symbolic model.").addValidationFunctionString(storm::settings::ArgumentValidators::existingReadableFileValidator()).build()).build());
this->addOption(storm::settings::OptionBuilder(moduleName,prismInputOptionName,false,"Parses the model given in the PRISM format.")
.addArgument(storm::settings::ArgumentBuilder::createStringArgument("filename","The name of the file from which to read the PRISM input.").addValidationFunctionString(storm::settings::ArgumentValidators::existingReadableFileValidator()).build()).build());
this->addOption(storm::settings::OptionBuilder(moduleName,janiInputOptionName,false,"Parses the model given in the JANI format.")
.addArgument(storm::settings::ArgumentBuilder::createStringArgument("filename","The name of the file from which to read the JANI input.").addValidationFunctionString(storm::settings::ArgumentValidators::existingReadableFileValidator()).build()).build());
this->addOption(storm::settings::OptionBuilder(moduleName,prismToJaniOptionName,false,"If set, the input PRISM model is transformed to JANI.").build());
this->addOption(storm::settings::OptionBuilder(moduleName,explorationOrderOptionName,false,"Sets which exploration order to use.").setShortName(explorationOrderOptionShortName)
@ -51,7 +55,7 @@ namespace storm {
.addArgument(storm::settings::ArgumentBuilder::createStringArgument("filename","The file from which to read the state rewards.").addValidationFunctionString(storm::settings::ArgumentValidators::existingReadableFileValidator()).build()).build());
this->addOption(storm::settings::OptionBuilder(moduleName,choiceLabelingOptionName,false,"If given, the choice labels are read from this file and added to the explicit model. Note that this requires the model to be given as an explicit model (i.e., via --"+explicitOptionName+").")
.addArgument(storm::settings::ArgumentBuilder::createStringArgument("filename","The file from which to read the choice labels.").addValidationFunctionString(storm::settings::ArgumentValidators::existingReadableFileValidator()).build()).build());
this->addOption(storm::settings::OptionBuilder(moduleName,constantsOptionName,false,"Specifies the constant replacements to use in symbolic models. Note that Note that this requires the model to be given as an symbolic model (i.e., via --"+symbolicOptionName+").").setShortName(constantsOptionShortName)
this->addOption(storm::settings::OptionBuilder(moduleName,constantsOptionName,false,"Specifies the constant replacements to use in symbolic models. Note that this requires the model to be given as an symbolic model (i.e., via --"+prismInputOptionName+" or --"+janiInputOptionName+").").setShortName(constantsOptionShortName)
.addArgument(storm::settings::ArgumentBuilder::createStringArgument("values","A comma separated list of constants and their value, e.g. a=1,b=2,c=3.").setDefaultValueString("").build()).build());
// Ensure that not two symbolic input models were given.
STORM_LOG_THROW(!isJaniInputSet()||!isPrismInputSet(),storm::exceptions::InvalidSettingsException,"Symbolic model ");
// Ensure that the model was given either symbolically or explicitly.
STORM_LOG_THROW(!isSymbolicSet()||!isExplicitSet(),storm::exceptions::InvalidSettingsException,"The model may be either given in an explicit or a symbolic format, but not both.");
STORM_LOG_THROW(!isJaniInputSet()||!isPrismInputSet()||!isExplicitSet(),storm::exceptions::InvalidSettingsException,"The model may be either given in an explicit or a symbolic format (PRISM or JANI), but not both.");
// Make sure PRISM-to-JANI conversion is only set if the actual input is in PRISM format.
STORM_LOG_THROW(!isPrismToJaniSet()||isPrismInputSet(),storm::exceptions::InvalidSettingsException,"For the transformation from PRISM to JANI, the input model must be given in the prism format.");
STORM_LOG_THROW(isJaniModel(),storm::exceptions::InvalidOperationException,"Cannot retrieve JANI model, because the symbolic description has a different type.");
STORM_LOG_THROW(isPrismProgram(),storm::exceptions::InvalidOperationException,"Cannot retrieve JANI model, because the symbolic description has a different type.");
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(!this->hasLocation(location.getName()),storm::exceptions::WrongFormatException,"Cannot add location with name '"<<location.getName()<<"', because a location with this name already exists.");
STORM_LOG_THROW(lowerBound&&upperBound,storm::exceptions::NotImplementedException,"Jani Bounded Integer variables (for now) have to be bounded from both sides");
}
if(initValue){
STORM_LOG_THROW(lowerBound&&upperBound,storm::exceptions::NotImplementedException,"Jani Bounded Integer variables (for now) have to be bounded from both sides");
// We make sure that there are no two assignments to the same variable.
for(autoconst&oldAssignment:assignments){
STORM_LOG_THROW(oldAssignment.getExpressionVariable()!=assignment.getExpressionVariable(),storm::exceptions::WrongFormatException,"Cannot add assignment '"<<assignment<<"', because another assignment '"<<assignment<<"' writes to the same target variable.");
xxxxxxxxxx