Exemplo n.º 1
0
 /**
  * Checks if guard matches the following format. Guards are of the form <M "op" C [ and/or M "op"
  * C]> where M is a port variable, "op" is "=, !=, <=, >=, <, >" and C is a constant.
  */
 public boolean areAllActionGuardsSimple() {
   for (Action action : getActor().getImplementation().getActions()) {
     if (action.hasGuard()) {
       Guard guard = action.getGuard();
       UnionOfDisjointIntervals modeSet = guard.matchModeControlGuard();
       if (modeSet == null) return false;
     }
   }
   return true;
 }
Exemplo n.º 2
0
 /**
  * Checks if the guards of those non-deterministic actions matches the following format. Guards
  * are of the form <M "op" C [ (and/or) M "op" C]> where M is a port variable, "op" is "=, !=, <=,
  * >=, <, >" and C is a constant.
  */
 public boolean areNonDeterministicStatesSimplyGuarded() {
   ActorSchedule schedule = mActor.getImplementation().getSchedule();
   for (State state : schedule.getStates()) {
     if (state.getTransitions().size() > 1) {
       for (Transition transition : state.getTransitions()) {
         Action action = transition.getAction();
         if (!action.hasGuard()) return false;
         Guard guard = action.getGuard();
         Map<InputLookAhead, UnionOfDisjointIntervals> modeSet = guard.matchScenarioAwareGuard();
         if (modeSet == null) return false;
       }
     }
   }
   return true;
 }