diff --git a/rs.cc b/rs.cc index 7ccacf3..240f0f2 100644 --- a/rs.cc +++ b/rs.cc @@ -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 **/ diff --git a/rs.hh b/rs.hh index 3470b70..a2a7bdd 100644 --- a/rs.hh +++ b/rs.hh @@ -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; diff --git a/symrs.cc b/symrs.cc index 7fac236..302f4e4 100644 --- a/symrs.cc +++ b/symrs.cc @@ -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 **/