benjamin.schwertfeger@gmail.com 14 лет назад
Родитель
Сommit
b00252de6e

+ 0 - 1
plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/transformation/ModelSequencer.xtend

@@ -140,7 +140,6 @@ class ModelSequencer {
 		return r
 	}
 
-
 	def ExecutionChoice mapChoiceTransition(Choice choice) {
 		val _choice = choice.create
 		_choice.reactions.addAll( choice.outgoingTransitions.map(t | t.mapTransition) )

+ 4 - 4
plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/FlowOptimizer.java

@@ -25,7 +25,7 @@ import org.yakindu.sct.model.sexec.SexecFactory;
 import org.yakindu.sct.model.sexec.StateCase;
 import org.yakindu.sct.model.sexec.StateSwitch;
 import org.yakindu.sct.model.sexec.Step;
-import org.yakindu.sct.model.sexec.transformation.FactoryExtension;
+import org.yakindu.sct.model.sexec.transformation.SexecElementMapping;
 import org.yakindu.sct.model.sgraph.SGraphFactory;
 import org.yakindu.sct.model.stext.stext.StextFactory;
 
@@ -36,7 +36,7 @@ public class FlowOptimizer {
   private IQualifiedNameProvider qfnProvider;
   
   @Inject
-  private FactoryExtension factory;
+  private SexecElementMapping factory;
   
   private boolean _inlineReactions;
   
@@ -223,7 +223,7 @@ public class FlowOptimizer {
           final List<CheckRef> cRefs = _arrayList;
           EList<CheckRef> _refs = c.getRefs();
           cRefs.addAll(_refs);
-          for (CheckRef ref : cRefs) {
+          for (final CheckRef ref : cRefs) {
             {
               Check _copy = EcoreUtil.<Check>copy(c);
               final Check clone = _copy;
@@ -322,7 +322,7 @@ public class FlowOptimizer {
           final List<Call> calls = _arrayList;
           EList<Call> _caller = step.getCaller();
           calls.addAll(_caller);
-          for (Call caller : calls) {
+          for (final Call caller : calls) {
             {
               Step _stepCopy = this.stepCopy(step);
               final Step clone = _stepCopy;

+ 5 - 809
plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/ModelSequencer.java

@@ -2,11 +2,9 @@ package org.yakindu.sct.model.sexec.transformation;
 
 import com.google.inject.Inject;
 import com.google.inject.name.Named;
-import java.util.ArrayList;
 import java.util.List;
 import org.eclipse.emf.common.util.EList;
 import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.util.EcoreUtil;
 import org.eclipse.xtext.EcoreUtil2;
 import org.eclipse.xtext.naming.IQualifiedNameProvider;
 import org.eclipse.xtext.xbase.lib.BooleanExtensions;
@@ -24,21 +22,14 @@ import org.yakindu.sct.model.sexec.CheckRef;
 import org.yakindu.sct.model.sexec.ExecutionChoice;
 import org.yakindu.sct.model.sexec.ExecutionFlow;
 import org.yakindu.sct.model.sexec.ExecutionNode;
-import org.yakindu.sct.model.sexec.ExecutionRegion;
-import org.yakindu.sct.model.sexec.ExecutionScope;
 import org.yakindu.sct.model.sexec.ExecutionState;
 import org.yakindu.sct.model.sexec.If;
 import org.yakindu.sct.model.sexec.Reaction;
-import org.yakindu.sct.model.sexec.ReactionFired;
 import org.yakindu.sct.model.sexec.Sequence;
 import org.yakindu.sct.model.sexec.SexecFactory;
-import org.yakindu.sct.model.sexec.StateSwitch;
-import org.yakindu.sct.model.sexec.StateVector;
 import org.yakindu.sct.model.sexec.Step;
 import org.yakindu.sct.model.sexec.TimeEvent;
 import org.yakindu.sct.model.sexec.TraceNodeExecuted;
-import org.yakindu.sct.model.sexec.TraceStateEntered;
-import org.yakindu.sct.model.sexec.TraceStateExited;
 import org.yakindu.sct.model.sexec.transformation.BehaviorMapping;
 import org.yakindu.sct.model.sexec.transformation.SequenceBuilder;
 import org.yakindu.sct.model.sexec.transformation.SexecElementMapping;
@@ -50,38 +41,20 @@ import org.yakindu.sct.model.sexec.transformation.StextExtensions;
 import org.yakindu.sct.model.sexec.transformation.StructureMapping;
 import org.yakindu.sct.model.sexec.transformation.TraceExtensions;
 import org.yakindu.sct.model.sgraph.Choice;
-import org.yakindu.sct.model.sgraph.CompositeElement;
 import org.yakindu.sct.model.sgraph.Declaration;
-import org.yakindu.sct.model.sgraph.Effect;
-import org.yakindu.sct.model.sgraph.Event;
 import org.yakindu.sct.model.sgraph.FinalState;
-import org.yakindu.sct.model.sgraph.Region;
 import org.yakindu.sct.model.sgraph.RegularState;
 import org.yakindu.sct.model.sgraph.State;
 import org.yakindu.sct.model.sgraph.Statechart;
 import org.yakindu.sct.model.sgraph.Statement;
 import org.yakindu.sct.model.sgraph.Transition;
-import org.yakindu.sct.model.sgraph.Trigger;
 import org.yakindu.sct.model.sgraph.Variable;
-import org.yakindu.sct.model.sgraph.Vertex;
-import org.yakindu.sct.model.stext.stext.AlwaysEvent;
 import org.yakindu.sct.model.stext.stext.Assignment;
 import org.yakindu.sct.model.stext.stext.BoolLiteral;
-import org.yakindu.sct.model.stext.stext.DefaultEvent;
 import org.yakindu.sct.model.stext.stext.ElementReferenceExpression;
 import org.yakindu.sct.model.stext.stext.EventDefinition;
-import org.yakindu.sct.model.stext.stext.EventSpec;
-import org.yakindu.sct.model.stext.stext.Expression;
 import org.yakindu.sct.model.stext.stext.Literal;
-import org.yakindu.sct.model.stext.stext.LocalReaction;
-import org.yakindu.sct.model.stext.stext.LogicalAndExpression;
-import org.yakindu.sct.model.stext.stext.LogicalOrExpression;
-import org.yakindu.sct.model.stext.stext.OnCycleEvent;
 import org.yakindu.sct.model.stext.stext.PrimitiveValueExpression;
-import org.yakindu.sct.model.stext.stext.ReactionTrigger;
-import org.yakindu.sct.model.stext.stext.RegularEventSpec;
-import org.yakindu.sct.model.stext.stext.StextFactory;
-import org.yakindu.sct.model.stext.stext.TimeEventSpec;
 import org.yakindu.sct.model.stext.stext.VariableDefinition;
 
 @SuppressWarnings("all")
@@ -139,8 +112,8 @@ public class ModelSequencer {
       this.seqBuilder.defineStateEnterSequences(ef, sc);
       this.seqBuilder.defineStateExitSequences(ef, sc);
       this.seqBuilder.defineStatechartEnterSequence(ef, sc);
-      this.mapTransitions(sc, ef);
-      this.mapLocalReactions(sc, ef);
+      this.behaviorMapping.mapTransitions(sc, ef);
+      this.behaviorMapping.mapLocalReactions(sc, ef);
       this.mapChoiceTransitions(sc, ef);
       this.defineRegularStateReactions(ef, sc);
       this.definePseudoStateReactions(ef, sc);
@@ -171,7 +144,7 @@ public class ModelSequencer {
       EList<Transition> _outgoingTransitions = choice.getOutgoingTransitions();
       final Function1<Transition,Reaction> _function = new Function1<Transition,Reaction>() {
           public Reaction apply(final Transition t) {
-            Reaction _mapTransition = ModelSequencer.this.mapTransition(t);
+            Reaction _mapTransition = ModelSequencer.this.behaviorMapping.mapTransition(t);
             return _mapTransition;
           }
         };
@@ -181,536 +154,6 @@ public class ModelSequencer {
     }
   }
   
-  public ExecutionFlow mapTransitions(final Statechart statechart, final ExecutionFlow r) {
-    {
-      List<EObject> _eAllContentsAsList = EcoreUtil2.eAllContentsAsList(statechart);
-      List<EObject> content = _eAllContentsAsList;
-      final Function1<EObject,Boolean> _function = new Function1<EObject,Boolean>() {
-          public Boolean apply(final EObject e) {
-            return (e instanceof org.yakindu.sct.model.sgraph.State);
-          }
-        };
-      Iterable<EObject> _filter = IterableExtensions.<EObject>filter(content, _function);
-      final Iterable<EObject> allStates = _filter;
-      final Function1<EObject,ExecutionState> _function_1 = new Function1<EObject,ExecutionState>() {
-          public ExecutionState apply(final EObject s) {
-            ExecutionState _mapStateTransition = ModelSequencer.this.mapStateTransition(((State) s));
-            return _mapStateTransition;
-          }
-        };
-      IterableExtensions.<EObject>forEach(allStates, _function_1);
-      return r;
-    }
-  }
-  
-  public ExecutionState mapStateTransition(final State state) {
-    {
-      ExecutionState _create = this.mapping.create(state);
-      final ExecutionState _state = _create;
-      EList<Reaction> _reactions = _state.getReactions();
-      EList<Transition> _outgoingTransitions = state.getOutgoingTransitions();
-      final Function1<Transition,Reaction> _function = new Function1<Transition,Reaction>() {
-          public Reaction apply(final Transition t) {
-            Reaction _mapTransition = ModelSequencer.this.mapTransition(t);
-            return _mapTransition;
-          }
-        };
-      List<Reaction> _map = ListExtensions.<Transition, Reaction>map(_outgoingTransitions, _function);
-      _reactions.addAll(_map);
-      return _state;
-    }
-  }
-  
-  public Reaction mapTransition(final Transition t) {
-    {
-      Reaction _create = this.mapping.create(t);
-      final Reaction r = _create;
-      Trigger _trigger = t.getTrigger();
-      boolean _operator_notEquals = ObjectExtensions.operator_notEquals(_trigger, null);
-      if (_operator_notEquals) {
-        Trigger _trigger_1 = t.getTrigger();
-        Check _mapToCheck = this.mapToCheck(_trigger_1);
-        r.setCheck(_mapToCheck);
-      }
-      Sequence _mapToEffect = this.mapToEffect(t, r);
-      r.setEffect(_mapToEffect);
-      return r;
-    }
-  }
-  
-  public ExecutionFlow mapLocalReactions(final Statechart statechart, final ExecutionFlow r) {
-    {
-      List<EObject> _eAllContentsAsList = EcoreUtil2.eAllContentsAsList(statechart);
-      List<EObject> content = _eAllContentsAsList;
-      final Function1<EObject,Boolean> _function = new Function1<EObject,Boolean>() {
-          public Boolean apply(final EObject e) {
-            return (e instanceof org.yakindu.sct.model.sgraph.State);
-          }
-        };
-      Iterable<EObject> _filter = IterableExtensions.<EObject>filter(content, _function);
-      final Iterable<EObject> allStates = _filter;
-      final Function1<EObject,ExecutionState> _function_1 = new Function1<EObject,ExecutionState>() {
-          public ExecutionState apply(final EObject s) {
-            ExecutionState _mapStateLocalReactions = ModelSequencer.this.mapStateLocalReactions(((State) s));
-            return _mapStateLocalReactions;
-          }
-        };
-      IterableExtensions.<EObject>forEach(allStates, _function_1);
-      return r;
-    }
-  }
-  
-  public ExecutionState mapStateLocalReactions(final State state) {
-    {
-      ExecutionState _create = this.mapping.create(state);
-      final ExecutionState _state = _create;
-      EList<Reaction> _reactions = _state.getReactions();
-      EList<org.yakindu.sct.model.sgraph.Reaction> _localReactions = state.getLocalReactions();
-      Iterable<LocalReaction> _filter = IterableExtensions.<LocalReaction>filter(_localReactions, org.yakindu.sct.model.stext.stext.LocalReaction.class);
-      final Function1<LocalReaction,Boolean> _function = new Function1<LocalReaction,Boolean>() {
-          public Boolean apply(final LocalReaction lr) {
-            boolean _operator_or = false;
-            Trigger _trigger = lr.getTrigger();
-            EList<EventSpec> _triggers = ((ReactionTrigger) _trigger).getTriggers();
-            boolean _isEmpty = _triggers.isEmpty();
-            if (_isEmpty) {
-              _operator_or = true;
-            } else {
-              Trigger _trigger_1 = lr.getTrigger();
-              EList<EventSpec> _triggers_1 = ((ReactionTrigger) _trigger_1).getTriggers();
-              final Function1<EventSpec,Boolean> _function_1 = new Function1<EventSpec,Boolean>() {
-                  public Boolean apply(final EventSpec t) {
-                    boolean _operator_or_1 = false;
-                    boolean _operator_or_2 = false;
-                    boolean _operator_or_3 = false;
-                    if ((t instanceof org.yakindu.sct.model.stext.stext.RegularEventSpec)) {
-                      _operator_or_3 = true;
-                    } else {
-                      _operator_or_3 = BooleanExtensions.operator_or((t instanceof org.yakindu.sct.model.stext.stext.RegularEventSpec), (t instanceof org.yakindu.sct.model.stext.stext.TimeEventSpec));
-                    }
-                    if (_operator_or_3) {
-                      _operator_or_2 = true;
-                    } else {
-                      _operator_or_2 = BooleanExtensions.operator_or(_operator_or_3, (t instanceof org.yakindu.sct.model.stext.stext.OnCycleEvent));
-                    }
-                    if (_operator_or_2) {
-                      _operator_or_1 = true;
-                    } else {
-                      _operator_or_1 = BooleanExtensions.operator_or(_operator_or_2, (t instanceof org.yakindu.sct.model.stext.stext.AlwaysEvent));
-                    }
-                    return ((Boolean)_operator_or_1);
-                  }
-                };
-              Iterable<EventSpec> _filter_1 = IterableExtensions.<EventSpec>filter(_triggers_1, _function_1);
-              List<EventSpec> _list = IterableExtensions.<EventSpec>toList(_filter_1);
-              boolean _isEmpty_1 = _list.isEmpty();
-              boolean _operator_not = BooleanExtensions.operator_not(_isEmpty_1);
-              _operator_or = BooleanExtensions.operator_or(_isEmpty, _operator_not);
-            }
-            return ((Boolean)_operator_or);
-          }
-        };
-      Iterable<LocalReaction> _filter_2 = IterableExtensions.<LocalReaction>filter(_filter, _function);
-      final Function1<LocalReaction,Reaction> _function_2 = new Function1<LocalReaction,Reaction>() {
-          public Reaction apply(final LocalReaction t_1) {
-            Reaction _mapReaction = ModelSequencer.this.mapReaction(t_1);
-            return _mapReaction;
-          }
-        };
-      Iterable<Reaction> _map = IterableExtensions.<LocalReaction, Reaction>map(_filter_2, _function_2);
-      CollectionExtensions.<Reaction>addAll(_reactions, _map);
-      return _state;
-    }
-  }
-  
-  public Reaction mapReaction(final LocalReaction lr) {
-    {
-      Reaction _create = this.mapping.create(lr);
-      final Reaction r = _create;
-      Trigger _trigger = lr.getTrigger();
-      boolean _operator_notEquals = ObjectExtensions.operator_notEquals(_trigger, null);
-      if (_operator_notEquals) {
-        Trigger _trigger_1 = lr.getTrigger();
-        Check _mapToCheck = this.mapToCheck(_trigger_1);
-        r.setCheck(_mapToCheck);
-      }
-      Sequence _mapToEffect = this.mapToEffect(lr);
-      r.setEffect(_mapToEffect);
-      return r;
-    }
-  }
-  
-  protected StateVector _stateVector(final Vertex v) {
-    return null;
-  }
-  
-  protected StateVector _stateVector(final RegularState s) {
-    ExecutionState _create = this.mapping.create(s);
-    StateVector _stateVector = _create.getStateVector();
-    return _stateVector;
-  }
-  
-  protected StateVector _stateVector(final Choice choice) {
-    Region _parentRegion = choice.getParentRegion();
-    ExecutionRegion _create = this.mapping.create(_parentRegion);
-    StateVector _stateVector = _create.getStateVector();
-    return _stateVector;
-  }
-  
-  public Sequence mapToEffect(final Transition t, final Reaction r) {
-    {
-      SexecFactory _factory = this.sexec.factory();
-      Sequence _createSequence = _factory.createSequence();
-      final Sequence sequence = _createSequence;
-      List<State> _exitStates = this.exitStates(t);
-      State _last = IterableExtensions.<State>last(_exitStates);
-      final State topExitState = _last;
-      boolean _operator_notEquals = ObjectExtensions.operator_notEquals(topExitState, null);
-      if (_operator_notEquals) {
-        {
-          ArrayList<RegularState> _arrayList = new ArrayList<RegularState>();
-          List<RegularState> _collectLeafStates = this.sgraph.collectLeafStates(topExitState, _arrayList);
-          final List<RegularState> leafStates = _collectLeafStates;
-          StateVector _stateVector = this.stateVector(topExitState);
-          final StateVector topVector = _stateVector;
-          Vertex _source = t.getSource();
-          StateVector _stateVector_1 = this.stateVector(_source);
-          final StateVector sourceVector = _stateVector_1;
-          int _offset = topVector.getOffset();
-          int _offset_1 = sourceVector.getOffset();
-          Iterable<Integer> _operator_upTo = IntegerExtensions.operator_upTo(((Integer)_offset), ((Integer)_offset_1));
-          int _offset_2 = sourceVector.getOffset();
-          int _offset_3 = topVector.getOffset();
-          int _operator_minus = IntegerExtensions.operator_minus(((Integer)_offset_2), ((Integer)_offset_3));
-          Iterable<Integer> _take = IterableExtensions.<Integer>take(_operator_upTo, _operator_minus);
-          final Iterable<Integer> prepositions = _take;
-          for (Integer i : prepositions) {
-            {
-              StateSwitch _defineExitSwitch = this.seqBuilder.defineExitSwitch(topExitState, leafStates, i);
-              StateSwitch sSwitch = _defineExitSwitch;
-              EList<Step> _steps = sequence.getSteps();
-              _steps.add(sSwitch);
-            }
-          }
-        }
-      }
-      boolean _operator_and = false;
-      Vertex _source_1 = t.getSource();
-      boolean _operator_notEquals_1 = ObjectExtensions.operator_notEquals(_source_1, null);
-      if (!_operator_notEquals_1) {
-        _operator_and = false;
-      } else {
-        Vertex _source_2 = t.getSource();
-        _operator_and = BooleanExtensions.operator_and(_operator_notEquals_1, (_source_2 instanceof org.yakindu.sct.model.sgraph.RegularState));
-      }
-      if (_operator_and) {
-        EList<Step> _steps_1 = sequence.getSteps();
-        Vertex _source_3 = t.getSource();
-        ExecutionState _create = this.mapping.create(((RegularState) _source_3));
-        Sequence _exitSequence = _create.getExitSequence();
-        Call _newCall = this.mapping.newCall(_exitSequence);
-        _steps_1.add(_newCall);
-      }
-      List<State> _exitStates_1 = this.exitStates(t);
-      final Function2<Sequence,State,Sequence> _function = new Function2<Sequence,State,Sequence>() {
-          public Sequence apply(final Sequence seq , final State state) {
-            Sequence _xblockexpression = null;
-            {
-              boolean _operator_and_1 = false;
-              Vertex _source_4 = t.getSource();
-              boolean _operator_notEquals_2 = ObjectExtensions.operator_notEquals(state, _source_4);
-              if (!_operator_notEquals_2) {
-                _operator_and_1 = false;
-              } else {
-                boolean _operator_notEquals_3 = ObjectExtensions.operator_notEquals(state, topExitState);
-                _operator_and_1 = BooleanExtensions.operator_and(_operator_notEquals_2, _operator_notEquals_3);
-              }
-              if (_operator_and_1) {
-                Vertex _source_5 = t.getSource();
-                StateVector _stateVector_2 = ModelSequencer.this.stateVector(_source_5);
-                int _last_1 = ModelSequencer.this.sexec.last(_stateVector_2);
-                ExecutionState _create_1 = ModelSequencer.this.mapping.create(state);
-                StateVector _stateVector_3 = _create_1.getStateVector();
-                int _last_2 = ModelSequencer.this.sexec.last(_stateVector_3);
-                boolean _operator_equals = ObjectExtensions.operator_equals(((Integer)_last_1), ((Integer)_last_2));
-                if (_operator_equals) {
-                  {
-                    ExecutionState _create_2 = ModelSequencer.this.mapping.create(state);
-                    Step _exitAction = _create_2.getExitAction();
-                    boolean _operator_notEquals_4 = ObjectExtensions.operator_notEquals(_exitAction, null);
-                    if (_operator_notEquals_4) {
-                      EList<Step> _steps_2 = seq.getSteps();
-                      ExecutionState _create_3 = ModelSequencer.this.mapping.create(state);
-                      Step _exitAction_1 = _create_3.getExitAction();
-                      Call _newCall_1 = ModelSequencer.this.mapping.newCall(_exitAction_1);
-                      _steps_2.add(_newCall_1);
-                    }
-                    if (ModelSequencer.this._addTraceSteps) {
-                      EList<Step> _steps_3 = seq.getSteps();
-                      ExecutionState _create_4 = ModelSequencer.this.mapping.create(state);
-                      TraceStateExited _newTraceStateExited = ModelSequencer.this.trace.newTraceStateExited(_create_4);
-                      _steps_3.add(_newTraceStateExited);
-                    }
-                  }
-                }
-              }
-              _xblockexpression = (seq);
-            }
-            return _xblockexpression;
-          }
-        };
-      IterableExtensions.<State, Sequence>fold(_exitStates_1, sequence, _function);
-      boolean _operator_notEquals_5 = ObjectExtensions.operator_notEquals(topExitState, null);
-      if (_operator_notEquals_5) {
-        {
-          ArrayList<RegularState> _arrayList_1 = new ArrayList<RegularState>();
-          List<RegularState> _collectLeafStates_1 = this.sgraph.collectLeafStates(topExitState, _arrayList_1);
-          final List<RegularState> leafStates_1 = _collectLeafStates_1;
-          StateVector _stateVector_4 = this.stateVector(topExitState);
-          final StateVector topVector_1 = _stateVector_4;
-          Vertex _source_6 = t.getSource();
-          StateVector _stateVector_5 = this.stateVector(_source_6);
-          final StateVector sourceVector_1 = _stateVector_5;
-          int _last_3 = this.sexec.last(sourceVector_1);
-          int _last_4 = this.sexec.last(topVector_1);
-          Iterable<Integer> _operator_upTo_1 = IntegerExtensions.operator_upTo(((Integer)_last_3), ((Integer)_last_4));
-          Iterable<Integer> _drop = IterableExtensions.<Integer>drop(_operator_upTo_1, 1);
-          final Iterable<Integer> postpositions = _drop;
-          for (Integer i_1 : postpositions) {
-            {
-              StateSwitch _defineExitSwitch_1 = this.seqBuilder.defineExitSwitch(topExitState, leafStates_1, i_1);
-              StateSwitch sSwitch_1 = _defineExitSwitch_1;
-              EList<Step> _steps_4 = sequence.getSteps();
-              _steps_4.add(sSwitch_1);
-            }
-          }
-        }
-      }
-      Vertex _source_7 = t.getSource();
-      boolean _operator_notEquals_6 = ObjectExtensions.operator_notEquals(topExitState, _source_7);
-      if (_operator_notEquals_6) {
-        {
-          ExecutionState _create_5 = this.mapping.create(topExitState);
-          Step _exitAction_2 = _create_5.getExitAction();
-          boolean _operator_notEquals_7 = ObjectExtensions.operator_notEquals(_exitAction_2, null);
-          if (_operator_notEquals_7) {
-            EList<Step> _steps_5 = sequence.getSteps();
-            ExecutionState _create_6 = this.mapping.create(topExitState);
-            Step _exitAction_3 = _create_6.getExitAction();
-            Call _newCall_2 = this.mapping.newCall(_exitAction_3);
-            _steps_5.add(_newCall_2);
-          }
-          if (this._addTraceSteps) {
-            EList<Step> _steps_6 = sequence.getSteps();
-            ExecutionState _create_7 = this.mapping.create(topExitState);
-            TraceStateExited _newTraceStateExited_1 = this.trace.newTraceStateExited(_create_7);
-            CollectionExtensions.<TraceStateExited>operator_add(_steps_6, _newTraceStateExited_1);
-          }
-        }
-      }
-      Effect _effect = t.getEffect();
-      boolean _operator_notEquals_8 = ObjectExtensions.operator_notEquals(_effect, null);
-      if (_operator_notEquals_8) {
-        EList<Step> _steps_7 = sequence.getSteps();
-        Effect _effect_1 = t.getEffect();
-        Sequence _mapEffect = this.behaviorMapping.mapEffect(_effect_1);
-        _steps_7.add(_mapEffect);
-      }
-      if (this._addTraceSteps) {
-        EList<Step> _steps_8 = sequence.getSteps();
-        ReactionFired _newTraceReactionFired = this.trace.newTraceReactionFired(r);
-        CollectionExtensions.<ReactionFired>operator_add(_steps_8, _newTraceReactionFired);
-      }
-      List<ExecutionScope> _entryScopes = this.entryScopes(t);
-      Iterable<ExecutionScope> _drop_1 = IterableExtensions.<ExecutionScope>drop(_entryScopes, 1);
-      List<ExecutionScope> _list = IterableExtensions.<ExecutionScope>toList(_drop_1);
-      List<ExecutionScope> _reverse = ListExtensions.<ExecutionScope>reverse(_list);
-      final Function2<Sequence,ExecutionScope,Sequence> _function_1 = new Function2<Sequence,ExecutionScope,Sequence>() {
-          public Sequence apply(final Sequence seq_1 , final ExecutionScope scope) {
-            Sequence _xblockexpression_1 = null;
-            {
-              if ((scope instanceof org.yakindu.sct.model.sexec.ExecutionRegion)) {
-                {
-                  ExecutionScope _superScope = scope.getSuperScope();
-                  EList<ExecutionScope> _subScopes = _superScope.getSubScopes();
-                  final EList<ExecutionScope> siblingRegions = _subScopes;
-                  int _indexOf = siblingRegions.indexOf(scope);
-                  Iterable<ExecutionScope> _take_1 = IterableExtensions.<ExecutionScope>take(siblingRegions, _indexOf);
-                  for (ExecutionScope region : _take_1) {
-                    ModelSequencer.this.seqBuilder.addEnterRegion(seq_1, region);
-                  }
-                }
-              }
-              if ((scope instanceof org.yakindu.sct.model.sexec.ExecutionState)) {
-                {
-                  Step _entryAction = ((ExecutionState) scope).getEntryAction();
-                  boolean _operator_notEquals_9 = ObjectExtensions.operator_notEquals(_entryAction, null);
-                  if (_operator_notEquals_9) {
-                    EList<Step> _steps_9 = seq_1.getSteps();
-                    Step _entryAction_1 = ((ExecutionState) scope).getEntryAction();
-                    Call _newCall_3 = ModelSequencer.this.mapping.newCall(_entryAction_1);
-                    _steps_9.add(_newCall_3);
-                  }
-                  if (ModelSequencer.this._addTraceSteps) {
-                    EList<Step> _steps_10 = seq_1.getSteps();
-                    TraceStateEntered _newTraceStateEntered = ModelSequencer.this.trace.newTraceStateEntered(((ExecutionState) scope));
-                    _steps_10.add(_newTraceStateEntered);
-                  }
-                }
-              }
-              _xblockexpression_1 = (seq_1);
-            }
-            return _xblockexpression_1;
-          }
-        };
-      IterableExtensions.<ExecutionScope, Sequence>fold(_reverse, sequence, _function_1);
-      Vertex _target = t.getTarget();
-      boolean _operator_notEquals_10 = ObjectExtensions.operator_notEquals(_target, null);
-      if (_operator_notEquals_10) {
-        {
-          Vertex _target_1 = t.getTarget();
-          Region _parentRegion = _target_1.getParentRegion();
-          CompositeElement _composite = _parentRegion.getComposite();
-          EList<Region> _regions = _composite.getRegions();
-          final EList<Region> siblingRegions_1 = _regions;
-          Vertex _target_2 = t.getTarget();
-          if ((_target_2 instanceof org.yakindu.sct.model.sgraph.RegularState)) {
-            EList<Step> _steps_11 = sequence.getSteps();
-            Vertex _target_3 = t.getTarget();
-            ExecutionState _create_8 = this.mapping.create(((RegularState) _target_3));
-            Sequence _enterSequence = _create_8.getEnterSequence();
-            Call _newCall_4 = this.mapping.newCall(_enterSequence);
-            _steps_11.add(_newCall_4);
-          } else {
-            Vertex _target_4 = t.getTarget();
-            if ((_target_4 instanceof org.yakindu.sct.model.sgraph.Choice)) {
-              EList<Step> _steps_12 = sequence.getSteps();
-              Vertex _target_5 = t.getTarget();
-              ExecutionChoice _create_9 = this.mapping.create(((Choice) _target_5));
-              Sequence _reactSequence = _create_9.getReactSequence();
-              Call _newCall_5 = this.mapping.newCall(_reactSequence);
-              _steps_12.add(_newCall_5);
-            }
-          }
-        }
-      }
-      List<ExecutionScope> _entryScopes_1 = this.entryScopes(t);
-      Iterable<ExecutionScope> _drop_2 = IterableExtensions.<ExecutionScope>drop(_entryScopes_1, 1);
-      final Function2<Sequence,ExecutionScope,Sequence> _function_2 = new Function2<Sequence,ExecutionScope,Sequence>() {
-          public Sequence apply(final Sequence seq_2 , final ExecutionScope scope_1) {
-            Sequence _xblockexpression_2 = null;
-            {
-              if ((scope_1 instanceof org.yakindu.sct.model.sexec.ExecutionRegion)) {
-                {
-                  ExecutionScope _superScope_1 = scope_1.getSuperScope();
-                  EList<ExecutionScope> _subScopes_1 = _superScope_1.getSubScopes();
-                  final EList<ExecutionScope> siblingRegions_2 = _subScopes_1;
-                  int _indexOf_1 = siblingRegions_2.indexOf(scope_1);
-                  int _operator_plus = IntegerExtensions.operator_plus(((Integer)_indexOf_1), ((Integer)1));
-                  Iterable<ExecutionScope> _drop_3 = IterableExtensions.<ExecutionScope>drop(siblingRegions_2, _operator_plus);
-                  for (ExecutionScope region_1 : _drop_3) {
-                    ModelSequencer.this.seqBuilder.addEnterRegion(seq_2, region_1);
-                  }
-                }
-              }
-              _xblockexpression_2 = (seq_2);
-            }
-            return _xblockexpression_2;
-          }
-        };
-      IterableExtensions.<ExecutionScope, Sequence>fold(_drop_2, sequence, _function_2);
-      return sequence;
-    }
-  }
-  
-  public List<State> exitStates(final Transition t) {
-    List<State> _xblockexpression = null;
-    {
-      Vertex _source = t.getSource();
-      List<EObject> _containers = this.sgraph.containers(_source);
-      final List<EObject> l = _containers;
-      Vertex _target = t.getTarget();
-      List<EObject> _containers_1 = this.sgraph.containers(_target);
-      l.removeAll(_containers_1);
-      Iterable<State> _filter = IterableExtensions.<State>filter(l, org.yakindu.sct.model.sgraph.State.class);
-      List<State> _list = IterableExtensions.<State>toList(_filter);
-      _xblockexpression = (_list);
-    }
-    return _xblockexpression;
-  }
-  
-  public List<State> entryStates(final Transition t) {
-    List<State> _xblockexpression = null;
-    {
-      Vertex _target = t.getTarget();
-      List<EObject> _containers = this.sgraph.containers(_target);
-      final List<EObject> l = _containers;
-      Vertex _source = t.getSource();
-      List<EObject> _containers_1 = this.sgraph.containers(_source);
-      l.removeAll(_containers_1);
-      Iterable<State> _filter = IterableExtensions.<State>filter(l, org.yakindu.sct.model.sgraph.State.class);
-      List<State> _list = IterableExtensions.<State>toList(_filter);
-      _xblockexpression = (_list);
-    }
-    return _xblockexpression;
-  }
-  
-  public List<ExecutionScope> exitScopes(final Transition t) {
-    return null;
-  }
-  
-  public List<ExecutionScope> entryScopes(final Transition t) {
-    List<ExecutionScope> _xblockexpression = null;
-    {
-      Vertex _target = t.getTarget();
-      List<EObject> _containers = this.sgraph.containers(_target);
-      final List<EObject> l = _containers;
-      Vertex _source = t.getSource();
-      List<EObject> _containers_1 = this.sgraph.containers(_source);
-      l.removeAll(_containers_1);
-      final Function1<EObject,ExecutionScope> _function = new Function1<EObject,ExecutionScope>() {
-          public ExecutionScope apply(final EObject c) {
-            ExecutionScope _xifexpression = null;
-            if ((c instanceof org.yakindu.sct.model.sgraph.RegularState)) {
-              ExecutionState _create = ModelSequencer.this.mapping.create(((RegularState) c));
-              _xifexpression = ((ExecutionScope) _create);
-            } else {
-              ExecutionScope _xifexpression_1 = null;
-              if ((c instanceof org.yakindu.sct.model.sgraph.Region)) {
-                ExecutionRegion _create_1 = ModelSequencer.this.mapping.create(((Region) c));
-                _xifexpression_1 = ((ExecutionScope) _create_1);
-              } else {
-                ExecutionScope _xifexpression_2 = null;
-                if ((c instanceof org.yakindu.sct.model.sgraph.Statechart)) {
-                  ExecutionFlow _create_2 = ModelSequencer.this.mapping.create(((Statechart) c));
-                  _xifexpression_2 = ((ExecutionScope) _create_2);
-                }
-                _xifexpression_1 = _xifexpression_2;
-              }
-              _xifexpression = _xifexpression_1;
-            }
-            return _xifexpression;
-          }
-        };
-      List<ExecutionScope> _map = ListExtensions.<EObject, ExecutionScope>map(l, _function);
-      List<ExecutionScope> _list = IterableExtensions.<ExecutionScope>toList(_map);
-      _xblockexpression = (_list);
-    }
-    return _xblockexpression;
-  }
-  
-  public Sequence mapToEffect(final LocalReaction lr) {
-    Sequence _xifexpression = null;
-    Effect _effect = lr.getEffect();
-    boolean _operator_notEquals = ObjectExtensions.operator_notEquals(_effect, null);
-    if (_operator_notEquals) {
-      Effect _effect_1 = lr.getEffect();
-      Sequence _mapEffect = this.behaviorMapping.mapEffect(_effect_1);
-      _xifexpression = _mapEffect;
-    }
-    return _xifexpression;
-  }
-  
   public ExecutionFlow defineRegularStateReactions(final ExecutionFlow flow, final Statechart sc) {
     {
       List<RegularState> _allRegularStates = this.sct.allRegularStates(sc);
@@ -958,199 +401,6 @@ public class ModelSequencer {
     }
   }
   
-  protected Check _mapToCheck(final Trigger tr) {
-    return null;
-  }
-  
-  protected Check _mapToCheck(final ReactionTrigger tr) {
-    {
-      Check _createCheck = this.mapping.createCheck(tr);
-      final Check check = _createCheck;
-      Statement _buildCondition = this.buildCondition(tr);
-      check.setCondition(_buildCondition);
-      return check;
-    }
-  }
-  
-  protected Statement _buildCondition(final Trigger t) {
-    return null;
-  }
-  
-  protected Statement _buildCondition(final ReactionTrigger t) {
-    Expression _xblockexpression = null;
-    {
-      Expression _xifexpression = null;
-      EList<EventSpec> _triggers = t.getTriggers();
-      boolean _isEmpty = _triggers.isEmpty();
-      boolean _operator_not = BooleanExtensions.operator_not(_isEmpty);
-      if (_operator_not) {
-        EList<EventSpec> _triggers_1 = t.getTriggers();
-        Iterable<EventSpec> _reverseView = ListExtensions.<EventSpec>reverseView(_triggers_1);
-        final Function2<Expression,EventSpec,Expression> _function = new Function2<Expression,EventSpec,Expression>() {
-            public Expression apply(final Expression s , final EventSpec e) {
-              Expression _xblockexpression_1 = null;
-              {
-                Expression _raised = ModelSequencer.this.raised(e);
-                final Expression raised = _raised;
-                Expression _xifexpression_1 = null;
-                boolean _operator_equals = ObjectExtensions.operator_equals(raised, null);
-                if (_operator_equals) {
-                  _xifexpression_1 = s;
-                } else {
-                  Expression _xifexpression_2 = null;
-                  boolean _operator_equals_1 = ObjectExtensions.operator_equals(s, null);
-                  if (_operator_equals_1) {
-                    _xifexpression_2 = raised;
-                  } else {
-                    Expression _or = ModelSequencer.this.or(raised, s);
-                    _xifexpression_2 = _or;
-                  }
-                  _xifexpression_1 = _xifexpression_2;
-                }
-                _xblockexpression_1 = (_xifexpression_1);
-              }
-              return _xblockexpression_1;
-            }
-          };
-        Expression _fold = IterableExtensions.<EventSpec, Expression>fold(_reverseView, ((Expression) null), _function);
-        _xifexpression = _fold;
-      } else {
-        _xifexpression = null;
-      }
-      final Expression triggerCheck = _xifexpression;
-      Expression _xifexpression_3 = null;
-      Expression _guardExpression = t.getGuardExpression();
-      boolean _operator_notEquals = ObjectExtensions.operator_notEquals(_guardExpression, null);
-      if (_operator_notEquals) {
-        Expression _guardExpression_1 = t.getGuardExpression();
-        Expression _copy = EcoreUtil.<Expression>copy(_guardExpression_1);
-        _xifexpression_3 = _copy;
-      } else {
-        _xifexpression_3 = null;
-      }
-      final Expression guard = _xifexpression_3;
-      Expression _xifexpression_4 = null;
-      boolean _operator_and = false;
-      boolean _operator_notEquals_1 = ObjectExtensions.operator_notEquals(triggerCheck, null);
-      if (!_operator_notEquals_1) {
-        _operator_and = false;
-      } else {
-        boolean _operator_notEquals_2 = ObjectExtensions.operator_notEquals(guard, null);
-        _operator_and = BooleanExtensions.operator_and(_operator_notEquals_1, _operator_notEquals_2);
-      }
-      if (_operator_and) {
-        Expression _and = this.and(triggerCheck, guard);
-        _xifexpression_4 = _and;
-      } else {
-        Expression _xifexpression_5 = null;
-        boolean _operator_notEquals_3 = ObjectExtensions.operator_notEquals(triggerCheck, null);
-        if (_operator_notEquals_3) {
-          _xifexpression_5 = triggerCheck;
-        } else {
-          _xifexpression_5 = guard;
-        }
-        _xifexpression_4 = _xifexpression_5;
-      }
-      _xblockexpression = (_xifexpression_4);
-    }
-    return _xblockexpression;
-  }
-  
-  public Expression or(final Expression left, final Expression right) {
-    LogicalOrExpression _xblockexpression = null;
-    {
-      StextFactory _factory = this.stext.factory();
-      LogicalOrExpression _createLogicalOrExpression = _factory.createLogicalOrExpression();
-      final LogicalOrExpression or = _createLogicalOrExpression;
-      or.setLeftOperand(left);
-      or.setRightOperand(right);
-      _xblockexpression = (or);
-    }
-    return _xblockexpression;
-  }
-  
-  public Expression and(final Expression left, final Expression right) {
-    LogicalAndExpression _xblockexpression = null;
-    {
-      StextFactory _factory = this.stext.factory();
-      LogicalAndExpression _createLogicalAndExpression = _factory.createLogicalAndExpression();
-      final LogicalAndExpression or = _createLogicalAndExpression;
-      or.setLeftOperand(left);
-      or.setRightOperand(right);
-      _xblockexpression = (or);
-    }
-    return _xblockexpression;
-  }
-  
-  protected Expression _raised(final EventSpec e) {
-    return null;
-  }
-  
-  protected Expression _raised(final RegularEventSpec e) {
-    {
-      StextFactory _factory = this.stext.factory();
-      ElementReferenceExpression _createElementReferenceExpression = _factory.createElementReferenceExpression();
-      final ElementReferenceExpression r = _createElementReferenceExpression;
-      Event _event = e.getEvent();
-      EventDefinition _create = this.mapping.create(((EventDefinition) _event));
-      r.setValue(_create);
-      return r;
-    }
-  }
-  
-  protected Expression _raised(final TimeEventSpec e) {
-    {
-      StextFactory _factory = this.stext.factory();
-      ElementReferenceExpression _createElementReferenceExpression = _factory.createElementReferenceExpression();
-      final ElementReferenceExpression r = _createElementReferenceExpression;
-      TimeEvent _createDerivedEvent = this.mapping.createDerivedEvent(e);
-      r.setValue(_createDerivedEvent);
-      return r;
-    }
-  }
-  
-  protected Expression _raised(final OnCycleEvent e) {
-    {
-      StextFactory _factory = this.stext.factory();
-      PrimitiveValueExpression _createPrimitiveValueExpression = _factory.createPrimitiveValueExpression();
-      final PrimitiveValueExpression r = _createPrimitiveValueExpression;
-      StextFactory _factory_1 = this.stext.factory();
-      BoolLiteral _createBoolLiteral = _factory_1.createBoolLiteral();
-      final BoolLiteral boolLit = _createBoolLiteral;
-      boolLit.setValue(true);
-      r.setValue(boolLit);
-      return r;
-    }
-  }
-  
-  protected Expression _raised(final AlwaysEvent e) {
-    {
-      StextFactory _factory = this.stext.factory();
-      PrimitiveValueExpression _createPrimitiveValueExpression = _factory.createPrimitiveValueExpression();
-      final PrimitiveValueExpression r = _createPrimitiveValueExpression;
-      StextFactory _factory_1 = this.stext.factory();
-      BoolLiteral _createBoolLiteral = _factory_1.createBoolLiteral();
-      final BoolLiteral boolLit = _createBoolLiteral;
-      boolLit.setValue(true);
-      r.setValue(boolLit);
-      return r;
-    }
-  }
-  
-  protected Expression _raised(final DefaultEvent e) {
-    {
-      StextFactory _factory = this.stext.factory();
-      PrimitiveValueExpression _createPrimitiveValueExpression = _factory.createPrimitiveValueExpression();
-      final PrimitiveValueExpression r = _createPrimitiveValueExpression;
-      StextFactory _factory_1 = this.stext.factory();
-      BoolLiteral _createBoolLiteral = _factory_1.createBoolLiteral();
-      final BoolLiteral boolLit = _createBoolLiteral;
-      boolLit.setValue(true);
-      r.setValue(boolLit);
-      return r;
-    }
-  }
-  
   public void retargetDeclRefs(final ExecutionFlow flow) {
     {
       List<EObject> _eAllContentsAsList = EcoreUtil2.eAllContentsAsList(flow);
@@ -1171,7 +421,7 @@ public class ModelSequencer {
       final List<EObject> declared = _list;
       final Function1<EObject,Boolean> _function_1 = new Function1<EObject,Boolean>() {
           public Boolean apply(final EObject e_1) {
-            return (e_1 instanceof org.yakindu.sct.model.stext.stext.ElementReferenceExpression);
+            return ((Boolean)(e_1 instanceof org.yakindu.sct.model.stext.stext.ElementReferenceExpression));
           }
         };
       Iterable<EObject> _filter_1 = IterableExtensions.<EObject>filter(allContent, _function_1);
@@ -1190,7 +440,7 @@ public class ModelSequencer {
       IterableExtensions.<ElementReferenceExpression>forEach(_map, _function_3);
       final Function1<EObject,Boolean> _function_4 = new Function1<EObject,Boolean>() {
           public Boolean apply(final EObject e_2) {
-            return (e_2 instanceof org.yakindu.sct.model.stext.stext.Assignment);
+            return ((Boolean)(e_2 instanceof org.yakindu.sct.model.stext.stext.Assignment));
           }
         };
       Iterable<EObject> _filter_2 = IterableExtensions.<EObject>filter(allContent, _function_4);
@@ -1250,60 +500,6 @@ public class ModelSequencer {
     return ed;
   }
   
-  public StateVector stateVector(final Vertex choice) {
-    if ((choice instanceof Choice)) {
-      return _stateVector((Choice)choice);
-    } else if ((choice instanceof RegularState)) {
-      return _stateVector((RegularState)choice);
-    } else if ((choice instanceof Vertex)) {
-      return _stateVector((Vertex)choice);
-    } else {
-      throw new IllegalArgumentException("Unhandled parameter types: " +
-        java.util.Arrays.<Object>asList(choice).toString());
-    }
-  }
-  
-  public Check mapToCheck(final Trigger tr) {
-    if ((tr instanceof ReactionTrigger)) {
-      return _mapToCheck((ReactionTrigger)tr);
-    } else if ((tr instanceof Trigger)) {
-      return _mapToCheck((Trigger)tr);
-    } else {
-      throw new IllegalArgumentException("Unhandled parameter types: " +
-        java.util.Arrays.<Object>asList(tr).toString());
-    }
-  }
-  
-  public Statement buildCondition(final Trigger t) {
-    if ((t instanceof ReactionTrigger)) {
-      return _buildCondition((ReactionTrigger)t);
-    } else if ((t instanceof Trigger)) {
-      return _buildCondition((Trigger)t);
-    } else {
-      throw new IllegalArgumentException("Unhandled parameter types: " +
-        java.util.Arrays.<Object>asList(t).toString());
-    }
-  }
-  
-  public Expression raised(final EventSpec e) {
-    if ((e instanceof AlwaysEvent)) {
-      return _raised((AlwaysEvent)e);
-    } else if ((e instanceof DefaultEvent)) {
-      return _raised((DefaultEvent)e);
-    } else if ((e instanceof OnCycleEvent)) {
-      return _raised((OnCycleEvent)e);
-    } else if ((e instanceof RegularEventSpec)) {
-      return _raised((RegularEventSpec)e);
-    } else if ((e instanceof TimeEventSpec)) {
-      return _raised((TimeEventSpec)e);
-    } else if ((e instanceof EventSpec)) {
-      return _raised((EventSpec)e);
-    } else {
-      throw new IllegalArgumentException("Unhandled parameter types: " +
-        java.util.Arrays.<Object>asList(e).toString());
-    }
-  }
-  
   public Declaration replaced(final Declaration ed) {
     if ((ed instanceof TimeEvent)) {
       return _replaced((TimeEvent)ed);