nus-yam/ex-repair huggingface dataset:
Program: 42148
Project: 42148
Buggy source:
public static SFT<CharPred,CharFunc,Character> getTestSFTTotal(){
  List<SFTMove<CharPred,CharFunc,Character>> transitions=new LinkedList<>();
  Map<Integer,Set<List<Character>>> finalStates;
  transitions.add(new SFTInputMove<CharPred,CharFunc,Character>(0,1,new CharPred('a'),stringToCharFunc("String_Node_Str")));
  transitions.add(new SFTInputMove<CharPred,CharFunc,Character>(0,2,new CharPred('b'),stringToCharFunc("String_Node_Str")));
  transitions.add(new SFTInputMove<CharPred,CharFunc,Character>(1,3,new CharPred('a'),stringToCharFunc("String_Node_Str")));
  transitions.add(new SFTInputMove<CharPred,CharFunc,Character>(1,3,new CharPred('b'),stringToCharFunc("String_Node_Str")));
  transitions.add(new SFTInputMove<CharPred,CharFunc,Character>(2,3,new CharPred('a'),stringToCharFunc("String_Node_Str")));
  transitions.add(new SFTInputMove<CharPred,CharFunc,Character>(2,3,new CharPred('b'),stringToCharFunc("String_Node_Str")));
  transitions.add(new SFTInputMove<CharPred,CharFunc,Character>(3,3,new CharPred('a'),stringToCharFunc("String_Node_Str")));
  transitions.add(new SFTInputMove<CharPred,CharFunc,Character>(3,3,new CharPred('b'),stringToCharFunc("String_Node_Str")));
  HashSet<Integer> finalStatesSet=new HashSet<>();
  finalStatesSet.add(0);
  finalStatesSet.add(1);
  finalStatesSet.add(2);
  finalStatesSet.add(3);
  finalStates=setToFTMap(finalStatesSet);
  return SFT.MkSFT(transitions,0,finalStates,ba);
}

Fixed version (ground truth):
public static SFT<CharPred,CharFunc,Character> getTestSFTTotal() throws Exception {
  List<SFTMove<CharPred,CharFunc,Character>> transitions=new LinkedList<>();
  Map<Integer,Set<List<Character>>> finalStates;
  transitions.add(new SFTInputMove<CharPred,CharFunc,Character>(0,1,new CharPred('a'),stringToCharFunc("String_Node_Str")));
  transitions.add(new SFTInputMove<CharPred,CharFunc,Character>(0,2,new CharPred('b'),stringToCharFunc("String_Node_Str")));
  transitions.add(new SFTInputMove<CharPred,CharFunc,Character>(1,3,new CharPred('a'),stringToCharFunc("String_Node_Str")));
  transitions.add(new SFTInputMove<CharPred,CharFunc,Character>(1,3,new CharPred('b'),stringToCharFunc("String_Node_Str")));
  transitions.add(new SFTInputMove<CharPred,CharFunc,Character>(2,3,new CharPred('a'),stringToCharFunc("String_Node_Str")));
  transitions.add(new SFTInputMove<CharPred,CharFunc,Character>(2,3,new CharPred('b'),stringToCharFunc("String_Node_Str")));
  transitions.add(new SFTInputMove<CharPred,CharFunc,Character>(3,3,new CharPred('a'),stringToCharFunc("String_Node_Str")));
  transitions.add(new SFTInputMove<CharPred,CharFunc,Character>(3,3,new CharPred('b'),stringToCharFunc("String_Node_Str")));
  HashSet<Integer> finalStatesSet=new HashSet<>();
  finalStatesSet.add(0);
  finalStatesSet.add(1);
  finalStatesSet.add(2);
  finalStatesSet.add(3);
  finalStates=setToFTMap(finalStatesSet);
  return SFT.MkSFT(transitions,0,finalStates,ba);
}
Program: 42151
Project: 42151
Buggy source:
/** 
 * Check whether a SFT is deterministic
 */
private boolean checkDeterminism(BooleanAlgebraSubst<P,F,S> ba) throws TimeoutException {
  if (!isEpsilonFree) {
    return false;
  }
 else {
    for (    Integer state : getStates()) {
      ArrayList<SFTInputMove<P,F,S>> trset=new ArrayList<SFTInputMove<P,F,S>>(getInputMovesFrom(state));
      for (int i=0; i < trset.size(); i++) {
        for (int j=i + 1; j < trset.size(); j++) {
          P union=ba.MkAnd(trset.get(i).guard,trset.get(j).guard);
          if (ba.IsSatisfiable(union)) {
            if (trset.get(i).outputFunctions.size() != trset.get(j).outputFunctions.size())             return false;
            for (int k=0; k < trset.get(i).outputFunctions.size(); k++)             if (!ba.CheckGuardedEquality(union,trset.get(i).outputFunctions.get(k),trset.get(j).outputFunctions.get(k)))             return false;
          }
        }
      }
    }
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Check whether a SFT is deterministic
 */
private boolean checkDeterminism(BooleanAlgebraSubst<P,F,S> ba) throws TimeoutException {
  if (!isEpsilonFree) {
    return false;
  }
 else {
    for (    Integer state : getStates()) {
      ArrayList<SFTInputMove<P,F,S>> trset=new ArrayList<SFTInputMove<P,F,S>>(getInputMovesFrom(state));
      for (int i=0; i < trset.size(); i++) {
        for (int j=i + 1; j < trset.size(); j++) {
          if (ba.IsSatisfiable(ba.MkAnd(trset.get(i).guard,trset.get(j).guard))) {
            return false;
          }
        }
      }
    }
  }
  return true;
}
Program: 42153
Project: 42153
Buggy source:
public CharPred substIn(CharPred p,UnaryCharIntervalSolver cs){
  return checkNotNull(p).isSatisfiedBy(c) ? StdCharPred.TRUE : StdCharPred.FALSE;
}

Fixed version (ground truth):
public CharPred substIn(CharPred p,UnaryCharIntervalSolver cs){
  return new CharPred(c);
}
Program: 42154
Project: 42154
Buggy source:
public CharPred substIn(CharPred p,UnaryCharIntervalSolver cs){
  ImmutableList.Builder<ImmutablePair<Character,Character>> intervals=ImmutableList.builder();
  for (  ImmutablePair<Character,Character> interval : checkNotNull(p).intervals) {
    long leftPrime=charSnap(interval.left - increment);
    long rightPrime=charSnap(interval.right - increment);
    intervals.add(ImmutablePair.of((char)leftPrime,(char)rightPrime));
  }
  return new CharPred(intervals.build());
}

Fixed version (ground truth):
public CharPred substIn(CharPred p,UnaryCharIntervalSolver cs){
  ImmutableList.Builder<ImmutablePair<Character,Character>> intervals=ImmutableList.builder();
  for (  ImmutablePair<Character,Character> interval : checkNotNull(p).intervals) {
    long leftPrime=charSnap(interval.left + increment);
    long rightPrime=charSnap(interval.right + increment);
    intervals.add(ImmutablePair.of((char)leftPrime,(char)rightPrime));
  }
  return new CharPred(intervals.build());
}
Program: 42156
Project: 42156
Buggy source:
/** 
 * Given a symbolic finite transducer and the start state, return all possible transition chains in <code>steps</code> steps
 * @param sft symbolic finite transducer
 * @param startState the start state which could be any state, including but not limited to the initial state
 * @param steps the number of steps, which should be a natural number
 * @return
 */
private static <P,F,S>List<List<Integer>> possibleTransitionChains(SFTProduct<P,F,S> sft,Integer startState,int steps){
  List<List<Integer>> chains=new LinkedList<List<Integer>>();
  List<Integer> tempList=new LinkedList<Integer>();
  tempList.add(startState);
  backtrack(chains,tempList,sft,startState,steps);
  return chains;
}

Fixed version (ground truth):
/** 
 * Given a symbolic finite transducer and the start state, return all possible transition chains in <code>steps</code> steps
 * @param sft symbolic finite transducer
 * @param startState the start state which could be any state, including but not limited to the initial state
 * @param steps the number of steps, which should be a natural number
 * @return
 */
private static <P,F,S>List<List<SFTProductInputMove<P,F,S>>> possibleTransitionChains(SFTProduct<P,F,S> sft,Integer startState,int steps){
  List<List<SFTProductInputMove<P,F,S>>> chains=new ArrayList<List<SFTProductInputMove<P,F,S>>>();
  for (  SFTProductInputMove<P,F,S> initialTransition : sft.getInputMovesFrom(startState)) {
    List<SFTProductInputMove<P,F,S>> tempList=new LinkedList<SFTProductInputMove<P,F,S>>();
    tempList.add(initialTransition);
    backtrack(chains,tempList,sft,steps - 1);
  }
  return chains;
}
Program: 42157
Project: 42157
Buggy source:
private List<List<Integer>> getPossibleTransitionChains(Integer startState,int steps){
  return possibleTransitionChains(this,startState,steps);
}

Fixed version (ground truth):
private List<List<SFTProductInputMove<P,F,S>>> getPossibleTransitionChains(Integer startState,int steps){
  return possibleTransitionChains(this,startState,steps);
}
Program: 42158
Project: 42158
Buggy source:
private static <P,F,S>void backtrack(List<List<Integer>> chains,List<Integer> tempList,SFTProduct<P,F,S> sft,Integer currentState,int remainSteps){
  if (remainSteps < 0)   return;
 else   if (remainSteps == 0)   chains.add(new ArrayList<>(tempList));
 else {
    for (    SFTProductInputMove<P,F,S> transition : sft.getInputMovesFrom(currentState)) {
      tempList.add(transition.to);
      backtrack(chains,tempList,sft,transition.to,remainSteps - 1);
      tempList.remove(tempList.size() - 1);
    }
  }
}

Fixed version (ground truth):
private static <P,F,S>void backtrack(List<List<SFTProductInputMove<P,F,S>>> chains,List<SFTProductInputMove<P,F,S>> tempList,SFTProduct<P,F,S> sft,int remainSteps){
  if (remainSteps < 0)   return;
 else   if (remainSteps == 0)   chains.add(new ArrayList<SFTProductInputMove<P,F,S>>(tempList));
 else {
    Integer currentState=tempList.get(tempList.size() - 1).to;
    for (    SFTProductInputMove<P,F,S> transition : sft.getInputMovesFrom(currentState)) {
      tempList.add(transition);
      backtrack(chains,tempList,sft,remainSteps - 1);
      tempList.remove(tempList.size() - 1);
    }
  }
}
Program: 42160
Project: 42160
Buggy source:
@Override public boolean CheckGuardedEquality(CharPred p,CharFunc f1,CharFunc f2){
  CharPred f1Output, f2Output;
  if (checkNotNull(f1) instanceof CharOffset) {
    CharFunc inverseF1=new CharOffset(-((CharOffset)f1).increment);
    f1Output=this.MkSubstFuncPred(inverseF1,checkNotNull(p));
  }
 else {
    f1Output=new CharPred(((CharConstant)f1).c);
  }
  if (checkNotNull(f2) instanceof CharOffset) {
    CharFunc inverseF2=new CharOffset(-((CharOffset)f2).increment);
    f2Output=this.MkSubstFuncPred(inverseF2,checkNotNull(p));
  }
 else {
    f2Output=new CharPred(((CharConstant)f2).c);
  }
  return this.AreEquivalent(f1Output,f2Output);
}

Fixed version (ground truth):
@Override public boolean CheckGuardedEquality(CharPred p,CharFunc f1,CharFunc f2){
  CharPred f1IsNotEqualTof2;
  if (checkNotNull(f1) instanceof CharConstant && checkNotNull(f2) instanceof CharConstant)   f1IsNotEqualTof2=((CharConstant)f1).c == ((CharConstant)f2).c ? False() : True();
 else   if (checkNotNull(f1) instanceof CharConstant && checkNotNull(f2) instanceof CharOffset)   f1IsNotEqualTof2=MkNot(MkSubstFuncPred(f2,new CharPred(((CharConstant)f1).c)));
 else   if (checkNotNull(f1) instanceof CharOffset && checkNotNull(f2) instanceof CharConstant)   f1IsNotEqualTof2=MkNot(MkSubstFuncPred(f1,new CharPred(((CharConstant)f2).c)));
 else   f1IsNotEqualTof2=((CharOffset)f1).increment == ((CharOffset)f2).increment ? False() : True();
  return !IsSatisfiable(MkAnd(p,f1IsNotEqualTof2));
}
Program: 42161
Project: 42161
Buggy source:
@Override public CartesianProduct<P1,P2> MkNot(CartesianProduct<P1,P2> p) throws TimeoutException {
  ArrayList<Pair<P1,P2>> newProducts=new ArrayList<>();
  P1 leftover=ba1.True();
  for (  Pair<P1,P2> pair : p.getProducts()) {
    leftover=ba1.MkAnd(leftover,ba1.MkNot(pair.first));
    P2 newRight=ba2.MkNot(pair.second);
    if (ba2.IsSatisfiable(newRight))     newProducts.add(new Pair<P1,P2>(pair.first,newRight));
  }
  if (ba1.IsSatisfiable(leftover))   newProducts.add(new Pair<P1,P2>(leftover,ba2.True()));
  return new CartesianProduct<>(newProducts);
}

Fixed version (ground truth):
@Override public CartesianProduct<P1,P2> MkNot(CartesianProduct<P1,P2> p) throws TimeoutException {
  ArrayList<CartesianProduct<P1,P2>> conjuncts=new ArrayList<>();
  for (  Pair<P1,P2> pair : p.getProducts()) {
    List<Pair<P1,P2>> temp=new ArrayList<Pair<P1,P2>>();
    temp.add(new Pair<P1,P2>(ba1.MkNot(pair.first),ba2.True()));
    temp.add(new Pair<P1,P2>(ba1.True(),ba2.MkNot(pair.second)));
    conjuncts.add(new CartesianProduct<P1,P2>(temp));
  }
  return MkAnd(conjuncts);
}
Program: 42163
Project: 42163
Buggy source:
/** 
 * @return true iff <code>p1</code> and <code>p2</code> are equivalent
 */
public abstract boolean AreEquivalent(P p1,P p2);

Fixed version (ground truth):
/** 
 * @return true iff <code>p1</code> and <code>p2</code> are equivalent
 * @throws TimeoutException 
 */
public abstract boolean AreEquivalent(P p1,P p2) throws TimeoutException ;
Program: 42164
Project: 42164
Buggy source:
@Override public boolean AreEquivalent(Pair<P1,P2> p1,Pair<P1,P2> p2){
  return ba1.AreEquivalent(p1.first,p2.first) && ba2.AreEquivalent(p1.second,p2.second);
}

Fixed version (ground truth):
@Override public boolean AreEquivalent(Pair<P1,P2> p1,Pair<P1,P2> p2) throws TimeoutException {
  return ba1.AreEquivalent(p1.first,p2.first) && ba2.AreEquivalent(p1.second,p2.second);
}
Program: 42165
Project: 42165
Buggy source:
@Override public Pair<P1,P2> MkAtom(Choice<S1,S2> s) throws TimeoutException {
  if (s.isLeft())   return new Pair<P1,P2>(ba1.MkAtom(s.left),ba2.False());
 else   return new Pair<P1,P2>(ba1.False(),ba2.MkAtom(s.right));
}

Fixed version (ground truth):
@Override public Pair<P1,P2> MkAtom(Choice<S1,S2> s) throws TimeoutException {
  if (s.isLeft()) {
    InL<S1,S2> cast=(InL<S1,S2>)s;
    return new Pair<P1,P2>(ba1.MkAtom(cast.left),ba2.False());
  }
 else {
    InR<S1,S2> cast=(InR<S1,S2>)s;
    return new Pair<P1,P2>(ba1.False(),ba2.MkAtom(cast.right));
  }
}
Program: 42166
Project: 42166
Buggy source:
@Override public ArrayList<Pair<P1,P2>> GetSeparatingPredicates(ArrayList<Collection<Choice<S1,S2>>> groups,long timeout) throws TimeoutException {
  ArrayList<Collection<S1>> g1=new ArrayList<Collection<S1>>();
  ArrayList<Collection<S2>> g2=new ArrayList<Collection<S2>>();
  for (  Collection<Choice<S1,S2>> c : groups) {
    Collection<S1> s1set=new HashSet<S1>();
    Collection<S2> s2set=new HashSet<S2>();
    for (    Choice<S1,S2> p : c) {
      if (p.isLeft())       s1set.add(p.left);
 else       s2set.add(p.right);
    }
    g1.add(s1set);
    g2.add(s2set);
  }
  ArrayList<P1> preds1=ba1.GetSeparatingPredicates(g1,timeout);
  ArrayList<P2> preds2=ba2.GetSeparatingPredicates(g2,timeout);
  checkArgument(preds1.size() == preds2.size());
  ArrayList<Pair<P1,P2>> ret=new ArrayList<Pair<P1,P2>>();
  for (int i=0; i < preds1.size(); i++) {
    ret.add(new Pair<P1,P2>(preds1.get(i),preds2.get(i)));
  }
  return ret;
}

Fixed version (ground truth):
@Override public ArrayList<Pair<P1,P2>> GetSeparatingPredicates(ArrayList<Collection<Choice<S1,S2>>> groups,long timeout) throws TimeoutException {
  ArrayList<Collection<S1>> g1=new ArrayList<Collection<S1>>();
  ArrayList<Collection<S2>> g2=new ArrayList<Collection<S2>>();
  for (  Collection<Choice<S1,S2>> c : groups) {
    Collection<S1> s1set=new HashSet<S1>();
    Collection<S2> s2set=new HashSet<S2>();
    for (    Choice<S1,S2> p : c) {
      if (p.isLeft()) {
        InL<S1,S2> cast=(InL<S1,S2>)p;
        s1set.add(cast.left);
      }
 else {
        InR<S1,S2> cast=(InR<S1,S2>)p;
        s2set.add(cast.right);
      }
    }
    g1.add(s1set);
    g2.add(s2set);
  }
  ArrayList<P1> preds1=ba1.GetSeparatingPredicates(g1,timeout);
  ArrayList<P2> preds2=ba2.GetSeparatingPredicates(g2,timeout);
  checkArgument(preds1.size() == preds2.size());
  ArrayList<Pair<P1,P2>> ret=new ArrayList<Pair<P1,P2>>();
  for (int i=0; i < preds1.size(); i++) {
    ret.add(new Pair<P1,P2>(preds1.get(i),preds2.get(i)));
  }
  return ret;
}
Program: 42167
Project: 42167
Buggy source:
@Override public boolean HasModel(Pair<P1,P2> p1,Pair<S1,S2> el1,Pair<S1,S2> el2){
  return false;
}

Fixed version (ground truth):
@Override public boolean HasModel(CartesianProduct<P1,P2> p1,Pair<S1,S2> el1,Pair<S1,S2> el2){
  for (  Pair<P1,P2> p : p1.getProducts())   if (ba1.HasModel(p.first,el1.first,el2.first) && ba2.HasModel(p.second,el1.second,el2.second))   return true;
  return false;
}
Program: 42168
Project: 42168
Buggy source:
@Override public boolean IsSatisfiable(Pair<P1,P2> p1){
  return ba1.IsSatisfiable(p1.first) && ba2.IsSatisfiable(p1.second);
}

Fixed version (ground truth):
@Override public boolean IsSatisfiable(CartesianProduct<P1,P2> p1){
  for (  Pair<P1,P2> p : p1.getProducts())   if (ba1.IsSatisfiable(p.first) && ba2.IsSatisfiable(p.second))   return true;
  return false;
}
Program: 42169
Project: 42169
Buggy source:
@Override public Pair<S1,S2> generateWitness(Pair<P1,P2> p1){
  S1 wit1=ba1.generateWitness(p1.first);
  S2 wit2=ba2.generateWitness(p1.second);
  if (wit1 == null || wit2 == null)   return null;
  return new Pair<S1,S2>(wit1,wit2);
}

Fixed version (ground truth):
@Override public Pair<S1,S2> generateWitness(CartesianProduct<P1,P2> p1){
  for (  Pair<P1,P2> p : p1.getProducts())   if (ba1.IsSatisfiable(p.first) && ba2.IsSatisfiable(p.second))   return new Pair<>(ba1.generateWitness(p.first),ba2.generateWitness(p.second));
  return null;
}
Program: 42170
Project: 42170
Buggy source:
@Override public Pair<P1,P2> MkOr(Pair<P1,P2> p1,Pair<P1,P2> p2) throws TimeoutException {
  return null;
}

Fixed version (ground truth):
@Override public CartesianProduct<P1,P2> MkOr(CartesianProduct<P1,P2> p1,CartesianProduct<P1,P2> p2) throws TimeoutException {
  ArrayList<Pair<P1,P2>> newProducts=new ArrayList<>(p1.getProducts());
  newProducts.addAll(p2.getProducts());
  CartesianProduct<P1,P2> pp=new CartesianProduct<>(newProducts);
  pp.normalize(ba1,ba2);
  return pp;
}
Program: 42171
Project: 42171
Buggy source:
@Override public boolean AreEquivalent(Pair<P1,P2> p1,Pair<P1,P2> p2){
  return ba1.AreEquivalent(p1.first,p2.first) && ba2.AreEquivalent(p1.second,p2.second);
}

Fixed version (ground truth):
@Override public boolean AreEquivalent(CartesianProduct<P1,P2> p1,CartesianProduct<P1,P2> p2) throws TimeoutException {
  return IsSatisfiable(MkAnd(p1,MkNot(p2))) || IsSatisfiable(MkAnd(MkNot(p1),p2));
}
Program: 42172
Project: 42172
Buggy source:
@Override public Pair<P1,P2> MkAtom(Pair<S1,S2> s) throws TimeoutException {
  return new Pair<P1,P2>(ba1.MkAtom(s.first),ba2.MkAtom(s.second));
}

Fixed version (ground truth):
@Override public CartesianProduct<P1,P2> MkAtom(Pair<S1,S2> s) throws TimeoutException {
  return new CartesianProduct<>(ba1.MkAtom(s.first),ba2.MkAtom(s.second));
}
Program: 42173
Project: 42173
Buggy source:
@Override public Pair<P1,P2> MkAnd(Pair<P1,P2> p1,Pair<P1,P2> p2) throws TimeoutException {
  return null;
}

Fixed version (ground truth):
@Override public CartesianProduct<P1,P2> MkAnd(CartesianProduct<P1,P2> p1,CartesianProduct<P1,P2> p2) throws TimeoutException {
  ArrayList<Pair<P1,P2>> newProducts=new ArrayList<>();
  for (  Pair<P1,P2> pair1 : p1.getProducts())   for (  Pair<P1,P2> pair2 : p2.getProducts()) {
    P1 newFirst=ba1.MkAnd(pair1.first,pair2.first);
    if (ba1.IsSatisfiable(newFirst)) {
      P2 newSecond=ba2.MkAnd(pair1.second,pair2.second);
      if (ba2.IsSatisfiable(newSecond))       newProducts.add(new Pair<P1,P2>(newFirst,newSecond));
    }
  }
  return new CartesianProduct<>(newProducts);
}
Program: 42174
Project: 42174
Buggy source:
@Override public Pair<Pair<S1,S2>,Pair<S1,S2>> generateWitnesses(Pair<P1,P2> p1){
  return null;
}

Fixed version (ground truth):
@Override public Pair<Pair<S1,S2>,Pair<S1,S2>> generateWitnesses(CartesianProduct<P1,P2> p1){
  for (  Pair<P1,P2> p : p1.getProducts())   if (ba1.IsSatisfiable(p.first) && ba2.IsSatisfiable(p.second)) {
    Pair<S1,S1> w1=ba1.generateWitnesses(p.first);
    Pair<S2,S2> w2=ba2.generateWitnesses(p.second);
    return new Pair<>(new Pair<>(w1.first,w2.first),new Pair<>(w1.second,w2.second));
  }
  return null;
}
Program: 42175
Project: 42175
Buggy source:
@Override public Pair<P1,P2> True(){
  return new Pair<P1,P2>(ba1.True(),ba2.True());
}

Fixed version (ground truth):
@Override public CartesianProduct<P1,P2> True(){
  return new CartesianProduct<>(ba1.True(),ba2.True());
}
Program: 42176
Project: 42176
Buggy source:
@Override public Pair<P1,P2> MkNot(Pair<P1,P2> p) throws TimeoutException {
  return null;
}

Fixed version (ground truth):
@Override public CartesianProduct<P1,P2> MkNot(CartesianProduct<P1,P2> p) throws TimeoutException {
  ArrayList<Pair<P1,P2>> newProducts=new ArrayList<>();
  P1 leftover=ba1.True();
  for (  Pair<P1,P2> pair : p.getProducts()) {
    leftover=ba1.MkAnd(leftover,ba1.MkNot(pair.first));
    P2 newRight=ba2.MkNot(pair.second);
    if (ba2.IsSatisfiable(newRight))     newProducts.add(new Pair<P1,P2>(pair.first,newRight));
  }
  if (ba1.IsSatisfiable(leftover))   newProducts.add(new Pair<P1,P2>(leftover,ba2.True()));
  return new CartesianProduct<>(newProducts);
}
Program: 42177
Project: 42177
Buggy source:
@Override public Pair<P1,P2> False(){
  return new Pair<P1,P2>(ba1.False(),ba2.False());
}

Fixed version (ground truth):
@Override public CartesianProduct<P1,P2> False(){
  return new CartesianProduct<>();
}
Program: 42178
Project: 42178
Buggy source:
public void normalize(BooleanAlgebra<CharPred,Character> ba) throws TimeoutException {
  ArrayList<Pair<CharPred,CharPred>> newNotEqual=new ArrayList<Pair<CharPred,CharPred>>();
  ArrayList<CharPred> firstProj=new ArrayList<>();
  for (  Pair<CharPred,CharPred> pair : notEqual)   firstProj.add(pair.first);
  Collection<Pair<CharPred,ArrayList<Integer>>> minterms=ba.GetMinterms(firstProj);
  for (  Pair<CharPred,ArrayList<Integer>> minterm : minterms) {
    CharPred currA=minterm.first;
    CharPred currB=ba.False();
    for (int bit=0; bit < notEqual.size(); bit++)     if (minterm.second.get(bit) == 1)     currB=ba.MkOr(notEqual.get(bit).second,notEqual.get(bit).second);
    newNotEqual.add(new Pair<>(currA,currB));
  }
  notEqual=newNotEqual;
}

Fixed version (ground truth):
public void normalize(BooleanAlgebra<CharPred,Character> ba) throws TimeoutException {
  ArrayList<Pair<CharPred,CharPred>> newNotEqual=new ArrayList<Pair<CharPred,CharPred>>();
  ArrayList<CharPred> firstProj=new ArrayList<>();
  for (  Pair<CharPred,CharPred> pair : notEqual)   firstProj.add(pair.first);
  Collection<Pair<CharPred,ArrayList<Integer>>> minterms=ba.GetMinterms(firstProj);
  for (  Pair<CharPred,ArrayList<Integer>> minterm : minterms) {
    CharPred currA=minterm.first;
    CharPred currB=ba.False();
    for (int bit=0; bit < notEqual.size(); bit++)     if (minterm.second.get(bit) == 1)     currB=ba.MkOr(currB,notEqual.get(bit).second);
    newNotEqual.add(new Pair<>(currA,currB));
  }
  notEqual=newNotEqual;
}
Program: 42182
Project: 42182
Buggy source:
public static void main(String[] args) throws TimeoutException {
  try {
    inFile=new FileReader("String_Node_Str");
  }
 catch (  FileNotFoundException ex) {
    System.err.println("String_Node_Str");
    System.exit(-1);
  }
  try (BufferedReader br=new BufferedReader(inFile)){
    String line;
    while ((line=br.readLine()) != null) {
      list.add(line);
    }
    System.out.println(list.size());
    inFile.close();
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
  for (  String regex : list) {
    SFA<CharPred,Character> sfa=(new SFAprovider(regex,solver)).getSFA();
    if (sfa == null) {
      System.err.println("String_Node_Str" + regex);
    }
    sfaList.add(sfa);
  }
  for (  SFA<CharPred,Character> sfa : sfaList) {
    safaList.add(sfa.getSAFA(solver));
  }
  ArrayList<String> temp=new ArrayList<>();
  temp.add("String_Node_Str");
  temp.add("String_Node_Str");
  temp.add("String_Node_Str");
  System.out.println("String_Node_Str");
  for (  String s : temp) {
    equivalentTest(s.split("String_Node_Str"),60000);
    long sfaMinussafa=totalTimeSFA - fullTimeSAFA;
    System.out.println(fullTimeSAFA + "String_Node_Str" + solverTimeSAFA+ "String_Node_Str"+ subTimeSAFA+ "String_Node_Str"+ exploredStatesSAFA+ "String_Node_Str"+ successfulSubsumptionsSAFA+ "String_Node_Str"+ totalTimeSFA+ "String_Node_Str"+ exploredStatesSFA+ "String_Node_Str"+ sfaMinussafa);
  }
}

Fixed version (ground truth):
public static void main(String[] args) throws TimeoutException {
  try {
    inFile=new FileReader("String_Node_Str");
  }
 catch (  FileNotFoundException ex) {
    System.err.println("String_Node_Str");
    System.exit(-1);
  }
  try (BufferedReader br=new BufferedReader(inFile)){
    String line;
    while ((line=br.readLine()) != null) {
      list.add(line);
    }
    System.out.println(list.size());
    inFile.close();
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
  for (  String regex : list) {
    SFA<CharPred,Character> sfa=(new SFAprovider(regex,solver)).getSFA();
    if (sfa == null) {
      System.err.println("String_Node_Str" + regex);
    }
    sfaList.add(sfa);
  }
  for (  SFA<CharPred,Character> sfa : sfaList) {
    safaList.add(sfa.getSAFA(solver));
  }
  ArrayList<String> temp=new ArrayList<>();
  temp.add("String_Node_Str");
  temp.add("String_Node_Str");
  temp.add("String_Node_Str");
  temp.add("String_Node_Str");
  temp.add("String_Node_Str");
  temp.add("String_Node_Str");
  temp.add("String_Node_Str");
  System.out.println("String_Node_Str");
  for (  String s : temp) {
    equivalentTest(s.split("String_Node_Str"),60000);
    long sfaMinussafa=totalTimeSFA - fullTimeSAFA;
    System.out.println(fullTimeSAFA + "String_Node_Str" + solverTimeSAFA+ "String_Node_Str"+ subTimeSAFA+ "String_Node_Str"+ exploredStatesSAFA+ "String_Node_Str"+ successfulSubsumptionsSAFA+ "String_Node_Str"+ totalTimeSFA+ "String_Node_Str"+ exploredStatesSFA+ "String_Node_Str"+ sfaMinussafa);
  }
}
Program: 42184
Project: 42184
Buggy source:
private static void generate3to4(long timeOut){
  HashSet<String> tripleSet=new HashSet<String>();
  for (  String str : tripleList) {
    tripleSet.add(str);
  }
  for (  String str : quadraList) {
    String[] splited=str.split("String_Node_Str");
    StringBuilder builder=new StringBuilder();
    String first=splited[0];
    String second=splited[1];
    String third=splited[2];
    builder.append(first + "String_Node_Str" + second+ "String_Node_Str"+ third);
    String possiblePair=builder.toString();
    if (tripleList.contains(possiblePair)) {
      System.out.println("String_Node_Str" + possiblePair + "String_Node_Str"+ str);
      equivalentTest(splited,timeOut);
      equivalence3to4.print(possiblePair + "String_Node_Str" + str+ "String_Node_Str");
      equivalence3to4.print(safa1Size + "String_Node_Str" + safa2Size+ "String_Node_Str"+ sfa1Size+ "String_Node_Str"+ sfa2Size+ "String_Node_Str");
      long sfaMinussafa=totalTimeSFA - fullTimeSAFA;
      equivalence3to4.print(fullTimeSAFA + "String_Node_Str" + solverTimeSAFA+ "String_Node_Str"+ subTimeSAFA+ "String_Node_Str"+ totalTimeSFA+ "String_Node_Str"+ sfaMinussafa+ "String_Node_Str");
    }
  }
}

Fixed version (ground truth):
private static void generate3to4(long timeOut){
  HashSet<String> tripleSet=new HashSet<String>();
  for (  String str : tripleList) {
    tripleSet.add(str);
  }
  for (  String str : quadraList) {
    String[] splited=str.split("String_Node_Str");
    StringBuilder builder=new StringBuilder();
    String first=splited[0];
    String second=splited[1];
    String third=splited[2];
    builder.append(first + "String_Node_Str" + second+ "String_Node_Str"+ third);
    String possiblePair=builder.toString();
    if (tripleList.contains(possiblePair)) {
      System.out.println("String_Node_Str" + possiblePair + "String_Node_Str"+ str);
      equivalentTest(splited,timeOut);
      equivalence3to4.print(possiblePair + "String_Node_Str" + str+ "String_Node_Str");
      equivalence3to4.print(safa1Size + "String_Node_Str" + safa2Size+ "String_Node_Str"+ sfa1Size+ "String_Node_Str"+ sfa2Size+ "String_Node_Str");
      long sfaMinussafa=totalTimeSFA - fullTimeSAFA;
      equivalence3to4.print(fullTimeSAFA + "String_Node_Str" + solverTimeSAFA+ "String_Node_Str"+ subTimeSAFA+ "String_Node_Str"+ totalTimeSFA+ "String_Node_Str"+ sfaMinussafa+ "String_Node_Str");
      System.out.print(fullTimeSAFA + "String_Node_Str" + solverTimeSAFA+ "String_Node_Str"+ subTimeSAFA+ "String_Node_Str"+ totalTimeSFA+ "String_Node_Str"+ sfaMinussafa+ "String_Node_Str");
    }
  }
}
Program: 42185
Project: 42185
Buggy source:
private static void generate4to5(long timeOut){
  HashSet<String> quadraSet=new HashSet<String>();
  for (  String str : quadraList) {
    quadraSet.add(str);
  }
  for (  String str : pentaList) {
    String[] splited=str.split("String_Node_Str");
    StringBuilder builder=new StringBuilder();
    String first=splited[0];
    String second=splited[1];
    String third=splited[2];
    String fourth=splited[3];
    builder.append(first + "String_Node_Str" + second+ "String_Node_Str"+ third+ "String_Node_Str"+ fourth);
    String possiblePair=builder.toString();
    if (tripleList.contains(possiblePair)) {
      System.out.println("String_Node_Str" + possiblePair + "String_Node_Str"+ str);
      equivalentTest(splited,timeOut);
      equivalence4to5.print(possiblePair + "String_Node_Str" + str+ "String_Node_Str");
      equivalence4to5.print(safa1Size + "String_Node_Str" + safa2Size+ "String_Node_Str"+ sfa1Size+ "String_Node_Str"+ sfa2Size+ "String_Node_Str");
      long sfaMinussafa=totalTimeSFA - fullTimeSAFA;
      equivalence4to5.print(fullTimeSAFA + "String_Node_Str" + solverTimeSAFA+ "String_Node_Str"+ subTimeSAFA+ "String_Node_Str"+ totalTimeSFA+ "String_Node_Str"+ sfaMinussafa+ "String_Node_Str");
    }
  }
}

Fixed version (ground truth):
private static void generate4to5(long timeOut){
  HashSet<String> quadraSet=new HashSet<String>();
  for (  String str : quadraList) {
    quadraSet.add(str);
  }
  for (  String str : pentaList) {
    String[] splited=str.split("String_Node_Str");
    StringBuilder builder=new StringBuilder();
    String first=splited[0];
    String second=splited[1];
    String third=splited[2];
    String fourth=splited[3];
    builder.append(first + "String_Node_Str" + second+ "String_Node_Str"+ third+ "String_Node_Str"+ fourth);
    String possiblePair=builder.toString();
    if (tripleList.contains(possiblePair)) {
      System.out.println("String_Node_Str" + possiblePair + "String_Node_Str"+ str);
      equivalentTest(splited,timeOut);
      equivalence4to5.print(possiblePair + "String_Node_Str" + str+ "String_Node_Str");
      equivalence4to5.print(safa1Size + "String_Node_Str" + safa2Size+ "String_Node_Str"+ sfa1Size+ "String_Node_Str"+ sfa2Size+ "String_Node_Str");
      long sfaMinussafa=totalTimeSFA - fullTimeSAFA;
      equivalence4to5.print(fullTimeSAFA + "String_Node_Str" + solverTimeSAFA+ "String_Node_Str"+ subTimeSAFA+ "String_Node_Str"+ totalTimeSFA+ "String_Node_Str"+ sfaMinussafa+ "String_Node_Str");
      System.out.print(fullTimeSAFA + "String_Node_Str" + solverTimeSAFA+ "String_Node_Str"+ subTimeSAFA+ "String_Node_Str"+ totalTimeSFA+ "String_Node_Str"+ sfaMinussafa+ "String_Node_Str");
    }
  }
}
Program: 42186
Project: 42186
Buggy source:
private static void generate2to3(long timeOut){
  HashSet<String> pairSet=new HashSet<String>();
  for (  String str : pairList) {
    pairSet.add(str);
  }
  for (  String str : tripleList) {
    String[] splited=str.split("String_Node_Str");
    StringBuilder builder=new StringBuilder();
    String first=splited[0];
    String second=splited[1];
    builder.append(first + "String_Node_Str" + second);
    String possiblePair=builder.toString();
    if (pairSet.contains(possiblePair)) {
      System.out.println("String_Node_Str" + possiblePair + "String_Node_Str"+ str);
      equivalentTest(splited,timeOut);
      equivalence2to3.print(possiblePair + "String_Node_Str" + str+ "String_Node_Str");
      equivalence2to3.print(safa1Size + "String_Node_Str" + safa2Size+ "String_Node_Str"+ sfa1Size+ "String_Node_Str"+ sfa2Size+ "String_Node_Str");
      long sfaMinussafa=totalTimeSFA - fullTimeSAFA;
      equivalence2to3.print(fullTimeSAFA + "String_Node_Str" + solverTimeSAFA+ "String_Node_Str"+ subTimeSAFA+ "String_Node_Str"+ totalTimeSFA+ "String_Node_Str"+ sfaMinussafa+ "String_Node_Str");
    }
  }
}

Fixed version (ground truth):
private static void generate2to3(long timeOut){
  HashSet<String> pairSet=new HashSet<String>();
  for (  String str : pairList) {
    pairSet.add(str);
  }
  for (  String str : tripleList) {
    String[] splited=str.split("String_Node_Str");
    StringBuilder builder=new StringBuilder();
    String first=splited[0];
    String second=splited[1];
    builder.append(first + "String_Node_Str" + second);
    String possiblePair=builder.toString();
    if (pairSet.contains(possiblePair)) {
      System.out.println("String_Node_Str" + possiblePair + "String_Node_Str"+ str);
      equivalentTest(splited,timeOut);
      equivalence2to3.print(possiblePair + "String_Node_Str" + str+ "String_Node_Str");
      equivalence2to3.print(safa1Size + "String_Node_Str" + safa2Size+ "String_Node_Str"+ sfa1Size+ "String_Node_Str"+ sfa2Size+ "String_Node_Str");
      long sfaMinussafa=totalTimeSFA - fullTimeSAFA;
      equivalence2to3.print(fullTimeSAFA + "String_Node_Str" + solverTimeSAFA+ "String_Node_Str"+ subTimeSAFA+ "String_Node_Str"+ totalTimeSFA+ "String_Node_Str"+ sfaMinussafa+ "String_Node_Str");
      System.out.print(fullTimeSAFA + "String_Node_Str" + solverTimeSAFA+ "String_Node_Str"+ subTimeSAFA+ "String_Node_Str"+ totalTimeSFA+ "String_Node_Str"+ sfaMinussafa+ "String_Node_Str");
    }
  }
}
Program: 42188
Project: 42188
Buggy source:
private static void generate3to4(long timeOut){
  for (  String str : quadraList) {
    String[] splited=str.split("String_Node_Str");
    StringBuilder builder=new StringBuilder();
    String first=splited[0];
    String second=splited[1];
    String third=splited[2];
    builder.append(first + "String_Node_Str" + second+ "String_Node_Str"+ third);
    String possiblePair=builder.toString();
    System.out.println("String_Node_Str" + possiblePair + "String_Node_Str"+ str);
    equivalentTest(splited,timeOut);
    equivalence3to4.print(possiblePair + "String_Node_Str" + str+ "String_Node_Str");
    equivalence3to4.print(safa1Size + "String_Node_Str" + safa2Size+ "String_Node_Str"+ sfa1Size+ "String_Node_Str"+ sfa2Size+ "String_Node_Str");
    long sfaMinussafa=totalTimeSFA - fullTimeSAFA;
    equivalence3to4.print(fullTimeSAFA + "String_Node_Str" + solverTimeSAFA+ "String_Node_Str"+ subTimeSAFA+ "String_Node_Str"+ totalTimeSFA+ "String_Node_Str"+ sfaMinussafa+ "String_Node_Str");
  }
}

Fixed version (ground truth):
private static void generate3to4(long timeOut){
  for (  String str : quadraList) {
    String[] splited=str.split("String_Node_Str");
    StringBuilder builder=new StringBuilder();
    String first=splited[0];
    String second=splited[1];
    String third=splited[2];
    builder.append(first + "String_Node_Str" + second+ "String_Node_Str"+ third);
    String possiblePair=builder.toString();
    System.out.println("String_Node_Str" + possiblePair + "String_Node_Str"+ str);
    equivalentTest(splited,timeOut);
    equivalence3to4.print(possiblePair + "String_Node_Str" + str+ "String_Node_Str");
    equivalence3to4.print(safa1Size + "String_Node_Str" + safa2Size+ "String_Node_Str"+ sfa1Size+ "String_Node_Str"+ sfa2Size+ "String_Node_Str");
    long sfaMinussafa=totalTimeSFA - fullTimeSAFA;
    equivalence3to4.print(fullTimeSAFA + "String_Node_Str" + solverTimeSAFA+ "String_Node_Str"+ subTimeSAFA+ "String_Node_Str"+ totalTimeSFA+ "String_Node_Str"+ sfaMinussafa+ "String_Node_Str");
    System.out.print(fullTimeSAFA + "String_Node_Str" + solverTimeSAFA+ "String_Node_Str"+ subTimeSAFA+ "String_Node_Str"+ totalTimeSFA+ "String_Node_Str"+ sfaMinussafa+ "String_Node_Str");
  }
}
Program: 42189
Project: 42189
Buggy source:
private static void generate4to5(long timeOut){
  for (  String str : pentaList) {
    String[] splited=str.split("String_Node_Str");
    StringBuilder builder=new StringBuilder();
    String first=splited[0];
    String second=splited[1];
    String third=splited[2];
    String fourth=splited[3];
    builder.append(first + "String_Node_Str" + second+ "String_Node_Str"+ third+ "String_Node_Str"+ fourth);
    String possiblePair=builder.toString();
    System.out.println("String_Node_Str" + possiblePair + "String_Node_Str"+ str);
    equivalentTest(splited,timeOut);
    equivalence4to5.print(possiblePair + "String_Node_Str" + str+ "String_Node_Str");
    equivalence4to5.print(safa1Size + "String_Node_Str" + safa2Size+ "String_Node_Str"+ sfa1Size+ "String_Node_Str"+ sfa2Size+ "String_Node_Str");
    long sfaMinussafa=totalTimeSFA - fullTimeSAFA;
    equivalence4to5.print(fullTimeSAFA + "String_Node_Str" + solverTimeSAFA+ "String_Node_Str"+ subTimeSAFA+ "String_Node_Str"+ totalTimeSFA+ "String_Node_Str"+ sfaMinussafa+ "String_Node_Str");
  }
}

Fixed version (ground truth):
private static void generate4to5(long timeOut){
  for (  String str : pentaList) {
    String[] splited=str.split("String_Node_Str");
    StringBuilder builder=new StringBuilder();
    String first=splited[0];
    String second=splited[1];
    String third=splited[2];
    String fourth=splited[3];
    builder.append(first + "String_Node_Str" + second+ "String_Node_Str"+ third+ "String_Node_Str"+ fourth);
    String possiblePair=builder.toString();
    System.out.println("String_Node_Str" + possiblePair + "String_Node_Str"+ str);
    equivalentTest(splited,timeOut);
    equivalence4to5.print(possiblePair + "String_Node_Str" + str+ "String_Node_Str");
    equivalence4to5.print(safa1Size + "String_Node_Str" + safa2Size+ "String_Node_Str"+ sfa1Size+ "String_Node_Str"+ sfa2Size+ "String_Node_Str");
    long sfaMinussafa=totalTimeSFA - fullTimeSAFA;
    equivalence4to5.print(fullTimeSAFA + "String_Node_Str" + solverTimeSAFA+ "String_Node_Str"+ subTimeSAFA+ "String_Node_Str"+ totalTimeSFA+ "String_Node_Str"+ sfaMinussafa+ "String_Node_Str");
    System.out.print(fullTimeSAFA + "String_Node_Str" + solverTimeSAFA+ "String_Node_Str"+ subTimeSAFA+ "String_Node_Str"+ totalTimeSFA+ "String_Node_Str"+ sfaMinussafa+ "String_Node_Str");
  }
}
Program: 42190
Project: 42190
Buggy source:
private static void generate2to3(long timeOut){
  for (  String str : tripleList) {
    String[] splited=str.split("String_Node_Str");
    StringBuilder builder=new StringBuilder();
    String first=splited[0];
    String second=splited[1];
    builder.append(first + "String_Node_Str" + second);
    String possiblePair=builder.toString();
    System.out.println("String_Node_Str" + possiblePair + "String_Node_Str"+ str);
    equivalentTest(splited,timeOut);
    equivalence2to3.print(possiblePair + "String_Node_Str" + str+ "String_Node_Str");
    equivalence2to3.print(safa1Size + "String_Node_Str" + safa2Size+ "String_Node_Str"+ sfa1Size+ "String_Node_Str"+ sfa2Size+ "String_Node_Str");
    long sfaMinussafa=totalTimeSFA - fullTimeSAFA;
    equivalence2to3.print(fullTimeSAFA + "String_Node_Str" + solverTimeSAFA+ "String_Node_Str"+ subTimeSAFA+ "String_Node_Str"+ totalTimeSFA+ "String_Node_Str"+ sfaMinussafa+ "String_Node_Str");
  }
}

Fixed version (ground truth):
private static void generate2to3(long timeOut){
  for (  String str : tripleList) {
    String[] splited=str.split("String_Node_Str");
    StringBuilder builder=new StringBuilder();
    String first=splited[0];
    String second=splited[1];
    builder.append(first + "String_Node_Str" + second);
    String possiblePair=builder.toString();
    System.out.println("String_Node_Str" + possiblePair + "String_Node_Str"+ str);
    equivalentTest(splited,timeOut);
    equivalence2to3.print(possiblePair + "String_Node_Str" + str+ "String_Node_Str");
    equivalence2to3.print(safa1Size + "String_Node_Str" + safa2Size+ "String_Node_Str"+ sfa1Size+ "String_Node_Str"+ sfa2Size+ "String_Node_Str");
    long sfaMinussafa=totalTimeSFA - fullTimeSAFA;
    equivalence2to3.print(fullTimeSAFA + "String_Node_Str" + solverTimeSAFA+ "String_Node_Str"+ subTimeSAFA+ "String_Node_Str"+ totalTimeSFA+ "String_Node_Str"+ sfaMinussafa+ "String_Node_Str");
    System.out.print(fullTimeSAFA + "String_Node_Str" + solverTimeSAFA+ "String_Node_Str"+ subTimeSAFA+ "String_Node_Str"+ totalTimeSFA+ "String_Node_Str"+ sfaMinussafa+ "String_Node_Str");
  }
}
Program: 42192
Project: 42192
Buggy source:
public Distance(int size){
  distance=new int[size];
  for (int s=0; s < size; s++) {
    distance[s]=size;
  }
}

Fixed version (ground truth):
public Distance(int size){
  distance=new int[size];
  for (int s=0; s < size; s++) {
    distance[s]=size + 1;
  }
}
Program: 42193
Project: 42193
Buggy source:
private Distance computeDistances(){
  Distance distance=new Distance(maxStateId + 1);
  for (  Integer s : finalStates) {
    distance.setDistance(s,0);
  }
  BooleanExpressionMorphism<Integer> formulaDistance=new BooleanExpressionMorphism<>((s) -> distance.getDistance(s),distance);
  boolean changed=true;
  while (changed) {
    changed=false;
    for (    Integer s : getStates()) {
      for (      SAFAInputMove<P,S> tr : getInputMovesFrom(s)) {
        changed=distance.setDistance(s,1 + formulaDistance.apply(tr.to)) || changed;
      }
    }
  }
  return distance;
}

Fixed version (ground truth):
private Distance computeDistances(){
  Distance distance=new Distance(maxStateId + 1);
  for (  Integer s : finalStates) {
    distance.setDistance(s,0);
  }
  boolean changed;
  do {
    changed=false;
    for (    Integer s : getStates()) {
      for (      SAFAInputMove<P,S> tr : getInputMovesFrom(s)) {
        BooleanExpressionMorphism<Integer> formulaDistance=new BooleanExpressionMorphism<>((st) -> distance.getDistance(st),distance);
        changed=distance.setDistance(s,1 + formulaDistance.apply(tr.to)) || changed;
      }
    }
  }
 while (changed);
  return distance;
}
Program: 42194
Project: 42194
Buggy source:
public SAFA<P,S> simplify(BooleanAlgebra<P,S> ba) throws TimeoutException {
  Distance distance=computeDistances();
  BooleanExpressionFactory<PositiveBooleanExpression> boolexpr=getBooleanExpressionFactory();
  BooleanExpressionMorphism<PositiveBooleanExpression> simplify=new BooleanExpressionMorphism<>((s) -> distance.getDistance(s) > maxStateId ? boolexpr.False() : boolexpr.MkState(s),boolexpr);
  Collection<SAFAInputMove<P,S>> transitions=new LinkedList<SAFAInputMove<P,S>>();
  PositiveBooleanExpression initial=simplify.apply(initialState);
  Collection<Integer> states=new TreeSet<Integer>();
  Collection<Integer> worklist=new TreeSet<Integer>();
  worklist.addAll(initial.getStates());
  while (!worklist.isEmpty()) {
    int s=worklist.iterator().next();
    worklist.remove(s);
    states.add(s);
    for (    SAFAInputMove<P,S> tr : getInputMovesFrom(s)) {
      PositiveBooleanExpression postState=simplify.apply(tr.to);
      if (!postState.equals(boolexpr.False())) {
        transitions.add(new SAFAInputMove<P,S>(s,postState,tr.guard));
        for (        Integer succ : postState.getStates()) {
          if (!states.contains(succ)) {
            worklist.add(succ);
          }
        }
      }
    }
  }
  Collection<Integer> finalStates=new TreeSet<Integer>();
  for (  Integer s : this.finalStates) {
    if (states.contains(s)) {
      finalStates.add(s);
    }
  }
  return MkSAFA(transitions,initial,finalStates,ba,false,false,false);
}

Fixed version (ground truth):
public SAFA<P,S> simplify(BooleanAlgebra<P,S> ba) throws TimeoutException {
  Distance distance=computeDistances();
  BooleanExpressionFactory<PositiveBooleanExpression> boolexpr=getBooleanExpressionFactory();
  BooleanExpressionMorphism<PositiveBooleanExpression> simplify=new BooleanExpressionMorphism<>((s) -> distance.getDistance(s) > maxStateId + 1 ? boolexpr.False() : boolexpr.MkState(s),boolexpr);
  Collection<SAFAInputMove<P,S>> transitions=new LinkedList<SAFAInputMove<P,S>>();
  PositiveBooleanExpression initial=simplify.apply(initialState);
  Collection<Integer> states=new TreeSet<Integer>();
  Collection<Integer> worklist=new TreeSet<Integer>();
  worklist.addAll(initial.getStates());
  while (!worklist.isEmpty()) {
    int s=worklist.iterator().next();
    worklist.remove(s);
    states.add(s);
    for (    SAFAInputMove<P,S> tr : getInputMovesFrom(s)) {
      PositiveBooleanExpression postState=simplify.apply(tr.to);
      if (!postState.equals(boolexpr.False())) {
        transitions.add(new SAFAInputMove<P,S>(s,postState,tr.guard));
        for (        Integer succ : postState.getStates()) {
          if (!states.contains(succ)) {
            worklist.add(succ);
          }
        }
      }
    }
  }
  Collection<Integer> finalStates=new TreeSet<Integer>();
  for (  Integer s : this.finalStates) {
    if (states.contains(s)) {
      finalStates.add(s);
    }
  }
  return MkSAFA(transitions,initial,finalStates,ba,false,false,false);
}
Program: 42195
Project: 42195
Buggy source:
@Override public <R>R apply(LatticeMorphism<BooleanExpression,R> f) throws TimeoutException {
  return apply(f,this.bdd);
}

Fixed version (ground truth):
@Override public <R>R apply(LatticeMorphism<BooleanExpression,R> f) throws TimeoutException {
  if (bdd.isOne()) {
    return f.True();
  }
 else   if (bdd.isZero()) {
    return f.False();
  }
 else {
    return f.MkOr(f.MkAnd(f.apply(bdd.var()),f.apply(new BDDExpression(bdd.high()))),f.apply(new BDDExpression(bdd.low())));
  }
}
Program: 42196
Project: 42196
Buggy source:
int bdd_support(int r){
  int n;
  int res=1;
  CHECKa(r,bddfalse);
  if (r < 2)   return bddtrue;
  if (supportSize < bddvarnum) {
    supportSet=new int[bddvarnum];
    supportSize=bddvarnum;
    supportID=0;
  }
  if (supportID == 0x0FFFFFFF) {
    for (int i=0; i < bddvarnum; ++i)     supportSet[i]=0;
    supportID=0;
  }
  ++supportID;
  supportMin=LEVEL(r);
  supportMax=supportMin;
  support_rec(r,supportSet);
  bdd_unmark(r);
  bdd_disable_reorder();
  for (n=supportMax; n >= supportMin; --n)   if (supportSet[n] == supportID) {
    int tmp;
    bdd_addref(res);
    tmp=bdd_makenode(n,0,res);
    bdd_delref(res);
    res=tmp;
  }
  bdd_enable_reorder();
  return res;
}

Fixed version (ground truth):
int bdd_support(int r){
  int n;
  int res=1;
  CHECKa(r,bddfalse);
  if (r < 2)   return bddtrue;
  if (supportSet == null || supportSize < bddvarnum) {
    supportSet=new int[bddvarnum];
    supportSize=bddvarnum;
    supportID=0;
  }
  if (supportID == 0x0FFFFFFF) {
    for (int i=0; i < bddvarnum; ++i)     supportSet[i]=0;
    supportID=0;
  }
  ++supportID;
  supportMin=LEVEL(r);
  supportMax=supportMin;
  support_rec(r,supportSet);
  bdd_unmark(r);
  bdd_disable_reorder();
  for (n=supportMax; n >= supportMin; --n)   if (supportSet[n] == supportID) {
    int tmp;
    bdd_addref(res);
    tmp=bdd_makenode(n,0,res);
    bdd_delref(res);
    res=tmp;
  }
  bdd_enable_reorder();
  return res;
}
Program: 42197
Project: 42197
Buggy source:
/** 
 * c and r without caring about equality
 */
public BinaryCharPred(CharPred c,CharPred r,BooleanAlgebra<CharPred,Character> ba){
  checkArgument(c != null && r != null);
  notEqual=new ArrayList<Pair<CharPred,CharPred>>();
  equals=StdCharPred.FALSE;
  equals=ba.MkAnd(c,r);
  notEqual.add(new Pair<CharPred,CharPred>(c,r));
}

Fixed version (ground truth):
/** 
 * c and r without caring about equality
 */
public BinaryCharPred(CharPred c,CharPred r,BooleanAlgebra<CharPred,Character> ba){
  this();
  checkArgument(c != null && r != null);
  notEqual=new ArrayList<Pair<CharPred,CharPred>>();
  equals=StdCharPred.FALSE;
  equals=ba.MkAnd(c,r);
  notEqual.add(new Pair<CharPred,CharPred>(c,r));
}
Program: 42198
Project: 42198
Buggy source:
public static CharPred of(ImmutableList<Character> characters){
  ImmutableList.Builder<ImmutablePair<Character,Character>> intervals=ImmutableList.builder();
  for (  Character c : checkNotNull(characters)) {
    intervals.add(ImmutablePair.of(checkNotNull(c),c));
  }
  return new CharPred(intervals.build());
}

Fixed version (ground truth):
public static CharPred of(ImmutableList<Character> characters,boolean isReturn){
  ImmutableList.Builder<ImmutablePair<Character,Character>> intervals=ImmutableList.builder();
  for (  Character c : checkNotNull(characters)) {
    intervals.add(ImmutablePair.of(checkNotNull(c),c));
  }
  CharPred res=new CharPred(intervals.build(),isReturn);
  if (isReturn)   res.setAsReturn();
  return res;
}
Program: 42199
Project: 42199
Buggy source:
public CharPred(ImmutableList<ImmutablePair<Character,Character>> intervals){
  for (  ImmutablePair<Character,Character> interval : checkNotNull(intervals)) {
    checkArgument(interval.left != null && interval.right != null && interval.left <= interval.right);
  }
  this.intervals=sortIntervals(checkNotNull(intervals));
}

Fixed version (ground truth):
public CharPred(ImmutableList<ImmutablePair<Character,Character>> intervals,boolean isReturn){
  for (  ImmutablePair<Character,Character> interval : checkNotNull(intervals)) {
    checkArgument(interval.left != null && interval.right != null && interval.left <= interval.right);
  }
  this.intervals=sortIntervals(checkNotNull(intervals));
  if (isReturn)   setAsReturn();
}