STORM_LOG_THROW(edgeEntry.count("location")==1,storm::exceptions::InvalidJaniException,"Each edge in automaton '"<<name<<"' must have a source");
STORM_LOG_THROW(edgeEntry.count("location")==1,storm::exceptions::InvalidJaniException,"Each edge in automaton '"<<name<<"' must have a source");
std::stringsourceLoc=getString(edgeEntry.at("location"),"source location for edge in automaton '"+name+"'");
std::stringsourceLoc=getString(edgeEntry.at("location"),"source location for edge in automaton '"+name+"'");
STORM_LOG_THROW(locIds.count(sourceLoc)==1,storm::exceptions::InvalidJaniException,"Source of edge has unknown location '"<<sourceLoc<<"' in automaton '"<<name<<"'.");
STORM_LOG_THROW(locIds.count(sourceLoc)==1,storm::exceptions::InvalidJaniException,"Source of edge has unknown location '"<<sourceLoc<<"' in automaton '"<<name<<"'.");
// action
STORM_LOG_THROW(edgeEntry.count("action")<2,storm::exceptions::InvalidJaniException,"Edge from "<<sourceLoc<<" in automaton "<<name<<" has multiple actions");
STORM_LOG_THROW(edgeEntry.count("action")<2,storm::exceptions::InvalidJaniException,"Edge from "<<sourceLoc<<" in automaton "<<name<<" has multiple actions");
std::stringaction="";
std::stringaction="";// def is tau
if(edgeEntry.count("action")>0){
if(edgeEntry.count("action")>0){
action=getString(edgeEntry.at("action"),"action name in edge from '"+sourceLoc+"' in automaton '"+name+"'");
action=getString(edgeEntry.at("action"),"action name in edge from '"+sourceLoc+"' in automaton '"+name+"'");
// TODO check if action is known
// TODO check if action is known
assert(action!="");
assert(action!="");
}
}
// rate
STORM_LOG_THROW(edgeEntry.count("rate")<2,storm::exceptions::InvalidJaniException,"Edge from '"<<sourceLoc<<"' in automaton '"<<name<<"' has multiple rates");
STORM_LOG_THROW(edgeEntry.count("rate")<2,storm::exceptions::InvalidJaniException,"Edge from '"<<sourceLoc<<"' in automaton '"<<name<<"' has multiple rates");
storm::expressions::ExpressionrateExpr;
storm::expressions::ExpressionrateExpr;
if(edgeEntry.count("rate")>0){
if(edgeEntry.count("rate")>0){
rateExpr=parseExpression(edgeEntry.at("rate"),"rate expression in edge from '"+sourceLoc+"' in automaton '"+name+"'");
rateExpr=parseExpression(edgeEntry.at("rate"),"rate expression in edge from '"+sourceLoc+"' in automaton '"+name+"'");
STORM_LOG_THROW(rateExpr.hasNumericalType(),storm::exceptions::InvalidJaniException,"Rate '"<<rateExpr<<"' has not a numerical type");
STORM_LOG_THROW(rateExpr.hasNumericalType(),storm::exceptions::InvalidJaniException,"Rate '"<<rateExpr<<"' has not a numerical type");
}
}
// guard
STORM_LOG_THROW(edgeEntry.count("guard")==1,storm::exceptions::InvalidJaniException,"A single guard must be given in edge from '"<<sourceLoc<<"' in automaton '"<<name<<"'");
STORM_LOG_THROW(edgeEntry.count("guard")==1,storm::exceptions::InvalidJaniException,"A single guard must be given in edge from '"<<sourceLoc<<"' in automaton '"<<name<<"'");
storm::expressions::ExpressionguardExpr=parseExpression(edgeEntry.at("guard"),"guard expression in edge from '"+sourceLoc+"' in automaton '"+name+"'",localVars);
storm::expressions::ExpressionguardExpr=parseExpression(edgeEntry.at("guard"),"guard expression in edge from '"+sourceLoc+"' in automaton '"+name+"'",localVars);
STORM_LOG_THROW(guardExpr.hasBooleanType(),storm::exceptions::InvalidJaniException,"Guard "<<guardExpr<<" does not have Boolean type.");
STORM_LOG_THROW(guardExpr.hasBooleanType(),storm::exceptions::InvalidJaniException,"Guard "<<guardExpr<<" does not have Boolean type.");
STORM_LOG_THROW(edgeEntry.count("destinations")==1,storm::exceptions::InvalidJaniException,"A single list of destinations must be given in edge from '"<<sourceLoc<<"' in automaton '"<<name<<"'");
STORM_LOG_THROW(edgeEntry.count("location")==1,storm::exceptions::InvalidJaniException,"Each destination in edge from '"<<sourceLoc<<"' in automaton '"<<name<<"' must have a source");
std::stringtargetLoc=getString(edgeEntry.at("location"),"target location for edge from '"+sourceLoc+"' in automaton '"+name+"'");
STORM_LOG_THROW(locIds.count(targetLoc)==1,storm::exceptions::InvalidJaniException,"Target of edge has unknown location '"<<targetLoc<<"' in automaton '"<<name<<"'.");
STORM_LOG_THROW(probDeclCount,storm::exceptions::InvalidJaniException,"Destination in edge from '"<<sourceLoc<<"' to '"<<targetLoc<<"' in automaton '"<<name<<"' has multiple probabilites");
if(probDeclCount==0){
probExpr=expressionManager->rational(1.0);
}else{
probExpr=parseExpression(destEntry.at("probability"),"probability expression in edge from '"+sourceLoc+"' to '"+targetLoc+"' in automaton '"+name+"'",localVars);
}
assert(probExpr.isInitialized());
STORM_LOG_THROW(probExpr.hasRationalType(),storm::exceptions::InvalidJaniException,"Probability expr "<<probExpr<<" does not have rational type.");