Program: 42228
Project: 42228
Buggy source:
/** 
 * iterate of the sst
 */
public static <P1,F1,S1>SST<P1,F1,S1> computeStar(SST<P1,F1,S1> sst,BooleanAlgebraSubst<P1,F1,S1> ba,boolean isLeftIter){
  if (sst.isEmpty)   return getEmptySST(ba);
  Collection<SSTMove<P1,F1,S1>> transitions=new ArrayList<SSTMove<P1,F1,S1>>();
  Map<Integer,OutputUpdate<P1,F1,S1>> outputFunction=new HashMap<Integer,OutputUpdate<P1,F1,S1>>();
  Integer initialState;
  Integer numberOfVariables;
  initialState=sst.maxStateId + 1;
  int accId=sst.variableCount;
  SSTVariable<P1,F1,S1> xAcc=new SSTVariable<P1,F1,S1>(accId);
  numberOfVariables=accId + 1;
  for (  SSTInputMove<P1,F1,S1> t : sst.getInputMovesFrom(sst.states)) {
    FunctionalVariableUpdate<P1,F1,S1> variableUpdate=t.variableUpdate.liftToNVars(numberOfVariables);
    variableUpdate.variableUpdate.get(accId).add(xAcc);
    SSTInputMove<P1,F1,S1> newMove=new SSTInputMove<P1,F1,S1>(t.from,t.to,t.guard,variableUpdate);
    transitions.add(newMove);
  }
  for (  SSTEpsilon<P1,F1,S1> t : sst.getEpsilonMovesFrom(sst.states)) {
    SimpleVariableUpdate<P1,F1,S1> variableUpdate=t.variableUpdate.liftToNVars(numberOfVariables);
    variableUpdate.variableUpdate.get(accId).add(xAcc);
    SSTEpsilon<P1,F1,S1> newMove=new SSTEpsilon<P1,F1,S1>(t.from,t.to,variableUpdate);
    transitions.add(newMove);
  }
  for (  Integer finStateSst : sst.getFinalStates()) {
    ArrayList<List<ConstantToken<P1,F1,S1>>> resUpdate=new ArrayList<List<ConstantToken<P1,F1,S1>>>();
    for (int i=0; i < numberOfVariables; i++) {
      List<ConstantToken<P1,F1,S1>> updateList=new ArrayList<ConstantToken<P1,F1,S1>>();
      if (i == accId)       if (isLeftIter) {
        updateList.addAll(sst.outputFunction.get(finStateSst).update);
        updateList.add(xAcc);
      }
 else {
        updateList.add(xAcc);
        updateList.addAll(sst.outputFunction.get(finStateSst).update);
      }
      resUpdate.add(updateList);
    }
    SSTEpsilon<P1,F1,S1> newMove=new SSTEpsilon<P1,F1,S1>(finStateSst,initialState,new SimpleVariableUpdate<P1,F1,S1>(resUpdate));
    transitions.add(newMove);
  }
  ArrayList<List<ConstantToken<P1,F1,S1>>> initUpdate=new ArrayList<List<ConstantToken<P1,F1,S1>>>();
  for (int i=0; i < numberOfVariables; i++) {
    List<ConstantToken<P1,F1,S1>> updateList=new ArrayList<ConstantToken<P1,F1,S1>>();
    if (i == accId)     updateList.add(xAcc);
    initUpdate.add(updateList);
  }
  SSTEpsilon<P1,F1,S1> initMove=new SSTEpsilon<P1,F1,S1>(initialState,sst.initialState,new SimpleVariableUpdate<P1,F1,S1>(initUpdate));
  transitions.add(initMove);
  List<ConstantToken<P1,F1,S1>> outUpdate=new ArrayList<ConstantToken<P1,F1,S1>>();
  outUpdate.add(xAcc);
  outputFunction.put(initialState,new OutputUpdate<P1,F1,S1>(outUpdate));
  return MkSST(transitions,initialState,numberOfVariables,outputFunction,ba);
}

Fixed version (ground truth):
/** 
 * iterate of the sst
 */
public static <P1,F1,S1>SST<P1,F1,S1> computeStar(SST<P1,F1,S1> sst,BooleanAlgebraSubst<P1,F1,S1> ba,boolean isLeftIter){
  if (sst.isEmpty) {
    return getEpsilonSST(new LinkedList<ConstantToken<P1,F1,S1>>(),ba);
  }
  Collection<SSTMove<P1,F1,S1>> transitions=new ArrayList<SSTMove<P1,F1,S1>>();
  Map<Integer,OutputUpdate<P1,F1,S1>> outputFunction=new HashMap<Integer,OutputUpdate<P1,F1,S1>>();
  Integer initialState;
  Integer numberOfVariables;
  initialState=sst.maxStateId + 1;
  int accId=sst.variableCount;
  SSTVariable<P1,F1,S1> xAcc=new SSTVariable<P1,F1,S1>(accId);
  numberOfVariables=accId + 1;
  for (  SSTInputMove<P1,F1,S1> t : sst.getInputMovesFrom(sst.states)) {
    FunctionalVariableUpdate<P1,F1,S1> variableUpdate=t.variableUpdate.liftToNVars(numberOfVariables);
    variableUpdate.variableUpdate.get(accId).add(xAcc);
    SSTInputMove<P1,F1,S1> newMove=new SSTInputMove<P1,F1,S1>(t.from,t.to,t.guard,variableUpdate);
    transitions.add(newMove);
  }
  for (  SSTEpsilon<P1,F1,S1> t : sst.getEpsilonMovesFrom(sst.states)) {
    SimpleVariableUpdate<P1,F1,S1> variableUpdate=t.variableUpdate.liftToNVars(numberOfVariables);
    variableUpdate.variableUpdate.get(accId).add(xAcc);
    SSTEpsilon<P1,F1,S1> newMove=new SSTEpsilon<P1,F1,S1>(t.from,t.to,variableUpdate);
    transitions.add(newMove);
  }
  for (  Integer finStateSst : sst.getFinalStates()) {
    ArrayList<List<ConstantToken<P1,F1,S1>>> resUpdate=new ArrayList<List<ConstantToken<P1,F1,S1>>>();
    for (int i=0; i < numberOfVariables; i++) {
      List<ConstantToken<P1,F1,S1>> updateList=new ArrayList<ConstantToken<P1,F1,S1>>();
      if (i == accId)       if (isLeftIter) {
        updateList.addAll(sst.outputFunction.get(finStateSst).update);
        updateList.add(xAcc);
      }
 else {
        updateList.add(xAcc);
        updateList.addAll(sst.outputFunction.get(finStateSst).update);
      }
      resUpdate.add(updateList);
    }
    SSTEpsilon<P1,F1,S1> newMove=new SSTEpsilon<P1,F1,S1>(finStateSst,initialState,new SimpleVariableUpdate<P1,F1,S1>(resUpdate));
    transitions.add(newMove);
  }
  ArrayList<List<ConstantToken<P1,F1,S1>>> initUpdate=new ArrayList<List<ConstantToken<P1,F1,S1>>>();
  for (int i=0; i < numberOfVariables; i++) {
    List<ConstantToken<P1,F1,S1>> updateList=new ArrayList<ConstantToken<P1,F1,S1>>();
    if (i == accId)     updateList.add(xAcc);
    initUpdate.add(updateList);
  }
  SSTEpsilon<P1,F1,S1> initMove=new SSTEpsilon<P1,F1,S1>(initialState,sst.initialState,new SimpleVariableUpdate<P1,F1,S1>(initUpdate));
  transitions.add(initMove);
  List<ConstantToken<P1,F1,S1>> outUpdate=new ArrayList<ConstantToken<P1,F1,S1>>();
  outUpdate.add(xAcc);
  outputFunction.put(initialState,new OutputUpdate<P1,F1,S1>(outUpdate));
  return MkSST(transitions,initialState,numberOfVariables,outputFunction,ba);
}