storm::jani::FunctionDefinitionfunDef=parseFunctionDefinition(funStructure,scope.refine("functions["+std::to_string(globalFuns.size())+"] of model "+name));
dummyFunctionDefinitions.push_back(parseFunctionDefinition(funStructure,scope.refine("functions["+std::to_string(globalFuns.size())+"] of model "+name),
true));
}
// Store references to the dummy function definitions. This needs to happen in a separate loop since otherwise, references to FunDefs can be invalidated after calling dummyFunctionDefinitions.push_back
STORM_LOG_THROW(unused,storm::exceptions::InvalidJaniException,"Multiple definitions of functions with the name "<<funDef.getName()<<" in "<<scope.description);
storm::jani::FunctionDefinitionfunDef=parseFunctionDefinition(funStructure,scope.refine("functions["+std::to_string(globalFuns.size())+"] of model "+name),
STORM_LOG_THROW(functionDefinitionStructure.count("name")==1,storm::exceptions::InvalidJaniException,"Function definition (scope: "+scope.description+") must have a name");
std::stringfunctionName=getString(functionDefinitionStructure.at("name"),"function-name in "+scope.description);
// TODO check existence of name.
STORM_LOG_THROW(functionDefinitionStructure.count("type")==1,storm::exceptions::InvalidJaniException,"Function definition '"+functionName+"' (scope: "+scope.description+") must have a (single) type-declaration.");
STORM_LOG_THROW(functionDefinitionStructure.count("parameters")==1,storm::exceptions::InvalidJaniException,"Function definition '"+functionName+"' (scope: "+scope.description+") must have exactly one list of parameters.");
STORM_LOG_THROW(parameterStructure.count("name")==1,storm::exceptions::InvalidJaniException,"Parameter declaration of parameter "+std::to_string(parameters.size())+" of Function definition '"+functionName+"' (scope: "+scope.description+") must have a name");
@ -769,9 +782,11 @@ namespace storm {
}
STORM_LOG_THROW(functionDefinitionStructure.count("body")==1,storm::exceptions::InvalidJaniException,"Function definition '"+functionName+"' (scope: "+scope.description+") must have a (single) body.");
storm::expressions::ExpressionfunctionBody=parseExpression(functionDefinitionStructure.at("body"),scope.refine("body of function definition "+functionName),false,parameterNameToVariableMap);
storm::expressions::ExpressionfunctionBody;
if(!firstPass){
functionBody=parseExpression(functionDefinitionStructure.at("body"),scope.refine("body of function definition "+functionName),false,parameterNameToVariableMap);
STORM_LOG_WARN_COND(functionBody.getType()==type.expressionType,"Type of body of function "+functionName+"' (scope: "+scope.description+") has type "<<functionBody.getType()<<" although the function type is given as "<<type.expressionType);
dummyFunctionDefinitions.push_back(parseFunctionDefinition(funStructure,scope.refine("functions["+std::to_string(localFuns.size())+"] of automaton "+name),true));
}
// Store references to the dummy function definitions. This needs to happen in a separate loop since otherwise, references to FunDefs can be invalidated after calling dummyFunctionDefinitions.push_back
STORM_LOG_THROW(unused,storm::exceptions::InvalidJaniException,"Multiple definitions of functions with the name "<<funDef.getName()<<" in "<<scope.description);
storm::jani::FunctionDefinitionfunDef=parseFunctionDefinition(funStructure,scope.refine("functions["+std::to_string(localFuns.size())+"] of automaton "+name),name+VARIABLE_AUTOMATON_DELIMITER);
storm::jani::FunctionDefinitionfunDef=parseFunctionDefinition(funStructure,scope.refine("functions["+std::to_string(localFuns.size())+"] of automaton "+name),