private STS createSemaphore() {
		init();
		State initState = this.createState("s0");
		List<State> stateList = new ArrayList<State>();
		stateList.add(initState);
			
		int index = 1;
		for (Correction corr : corrections) {
			State s = createState("s" + index);
			stateList.add(s);
			index++;
		}
			
		STS sem = new DefaultSTS(states, initState, inputActions, 
				outputActions, transitions);
		sem.labelState(initState, "flag0");
		for (Transition trans : this.mainSTS.getTransitions()) {
			if (!trans.getAction().getName().contains("Resume")) {
				trans.addGuardClause(new DefaultClause(new DefaultLiteral("flag0")));
			}
		}
		
		index = 1;
		for (Correction corr : corrections) {
			sem.labelState(stateList.get(index), "flag" + index);
			Adaptation adaptation = corr.getAdaptation();
			STS adSTS = this.adaptationSTSs.get(adaptation);

			State initial = adSTS.getInitialState();
			int prevIndex = this.getIndexOfPreviousAdaptation(index);
			for (Transition initTrans : adSTS.getTransitionsFromState(initial)) {
				for (int i = prevIndex; i <= index; i++) {
					Action act = initTrans.getAction();
					if (!act.getName().contains("Resume")) {
						sem.addAction(act);
						Transition newTrans = new DefaultTransition(stateList.get(i), 
								new StateFormula(), act, stateList.get(index));
						sem.addTransition(newTrans);      
					}
				}
			}
			Action action = adSTS.getAction("Resume"+index);
			sem.addAction(action);
//			Transition resTrans1 = new DefaultTransition(initState,
//					new StateFormula(), action, initState);
//			sem.addTransition(resTrans1);
			Transition resTrans = new DefaultTransition(stateList.get(index),
					new StateFormula(), action, initState);
			sem.addTransition(resTrans);
			index++;
		}
		return sem;
	}