From ac97db8ead1afc82297c0f1de957b9e4da0ddbc6 Mon Sep 17 00:00:00 2001 From: Artur Meski Date: Sun, 23 Sep 2018 13:12:33 +0100 Subject: [PATCH] Printing of the state constraints in the context automaton --- ctx_aut.cc | 7 ++++++- types.hh | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ctx_aut.cc b/ctx_aut.cc index def9d3c..d095f9f 100644 --- a/ctx_aut.cc +++ b/ctx_aut.cc @@ -107,6 +107,7 @@ void CtxAut::addTransition(std::string srcStateName, std::string dstStateName, S new_transition.ctx = tmpProcEntities; // tmpEntities.clear(); tmpProcEntities.clear(); + new_transition.state_constr = stateConstr; new_transition.dst_state = getStateID(dstStateName); transitions.push_back(new_transition); } @@ -118,7 +119,11 @@ void CtxAut::showTransitions(void) for (const auto &t : transitions) { cout << " * [" << getStateName(t.src_state) << " -> " << getStateName( t.dst_state) - << "]: { " << parent_rctsys->procEntitiesToStr(t.ctx) << "}" << endl; + << "]: { " << parent_rctsys->procEntitiesToStr(t.ctx) << "}"; + if (t.state_constr != nullptr) { + cout << " " << t.state_constr->toStr(); + } + cout << endl; } } diff --git a/types.hh b/types.hh index f0a5054..b49eb62 100644 --- a/types.hh +++ b/types.hh @@ -56,9 +56,11 @@ typedef std::vector ReactionConds; typedef std::map DecompReactions; typedef std::vector StateEntityToAction; +class StateConstr; struct CtxAutTransition { State src_state; EntitiesForProc ctx; + StateConstr *state_constr; State dst_state; };