Initial RS states vs initial CA states (they are incompatible)

This commit is contained in:
Artur Meski
2018-03-04 19:46:09 +00:00
parent f55d433791
commit 600f5c0daa
3 changed files with 16 additions and 1 deletions

10
rs.cc
View File

@@ -122,6 +122,10 @@ void RctSys::pushStateEntity(std::string entityName)
void RctSys::commitInitState(void)
{
if (ctx_aut != nullptr)
{
FERROR("Initial RS states must not be used with context automaton");
}
initStates.insert(tmpState);
tmpState.clear();
}
@@ -181,6 +185,10 @@ void RctSys::printSystem(void)
void RctSys::ctxAutEnable(void)
{
assert(ctx_aut == nullptr);
if (initStatesDefined())
{
FERROR("Initial states must not be defined if using context automaton");
}
ctx_aut = new CtxAut(opts, this);
}
@@ -208,3 +216,5 @@ void RctSys::ctxAutPushNamedContextEntity(std::string entityName)
Entity entity_id = getEntityID(entityName);
ctx_aut->pushContextEntity(entity_id);
}
/** EOF **/

2
rs.hh
View File

@@ -75,6 +75,8 @@ class RctSys
void ctxAutAddTransition(std::string srcStateName, std::string dstStateName);
void ctxAutPushNamedContextEntity(std::string entity_name);
bool initStatesDefined(void) { return initStates.size() != 0; }
private:
Reactions reactions;
EntitiesSets initStates;

View File

@@ -399,7 +399,8 @@ void SymRS::encode(void)
VERB("Encoding done");
}
BDD SymRS::encActStrEntity(std::string name) const {
BDD SymRS::encActStrEntity(std::string name) const
{
int id = getMappedStateToActID(rs->getEntityID(name));
if (id < 0)
{
@@ -409,3 +410,5 @@ BDD SymRS::encActStrEntity(std::string name) const {
return encActEntity(getMappedStateToActID(rs->getEntityID(name)));
}
}
/** EOF **/