Program: 2276
Project: 2276
Buggy source:
private WFState buildGlobalModel(GProtocolName fullname,GProtocolDecl gpd,Map<Role,EndpointFSM> egraphs,Map<Integer,WFState> seen) throws ScribbleException {
  Job job=getJob();
  if (!job.fair && !job.noLiveness) {
    for (    Entry<Role,EndpointFSM> e : egraphs.entrySet()) {
      Role r=e.getKey();
      EndpointFSM nonfair=e.getValue().init.unfairClone().toGraph().toFsm();
      egraphs.put(r,nonfair);
      job.debugPrintln("String_Node_Str" + fullname + "String_Node_Str"+ r+ "String_Node_Str"+ nonfair.init.toDot());
    }
  }
  WFBuffers b0=new WFBuffers(egraphs.keySet(),!gpd.modifiers.contains(GProtocolDecl.Modifiers.EXPLICIT));
  WFConfig c0=new WFConfig(egraphs,b0);
  WFState init=new WFState(c0);
  LinkedHashSet<WFState> todo=new LinkedHashSet<>();
  todo.add(init);
  int count=0;
  while (!todo.isEmpty()) {
    Iterator<WFState> i=todo.iterator();
    WFState curr=i.next();
    i.remove();
    seen.put(curr.id,curr);
    if (job.debug) {
      count++;
      if (count % 50 == 0) {
        job.debugPrintln("String_Node_Str" + fullname + "String_Node_Str"+ count);
      }
    }
    Map<Role,List<IOAction>> takeable=curr.getTakeable();
    for (    Role r : takeable.keySet()) {
      List<IOAction> acceptable_r=takeable.get(r);
      EndpointFSM currfsm=curr.config.states.get(r);
      Kind k=currfsm.getStateKind();
      if (k == Kind.OUTPUT) {
        for (        IOAction a : acceptable_r) {
          if (acceptable_r.stream().anyMatch((x) -> !a.equals(x) && a.peer.equals(x.peer) && a.mid.equals(x.mid)&& !a.payload.equals(x.payload))) {
            throw new ScribbleException("String_Node_Str" + acceptable_r);
          }
        }
      }
 else       if (k == Kind.UNARY_INPUT || k == Kind.POLY_INPUT || k == Kind.ACCEPT) {
        for (        IOAction a : acceptable_r) {
          if (currfsm.getAllTakeable().stream().anyMatch((x) -> !a.equals(x) && a.peer.equals(x.peer) && a.mid.equals(x.mid)&& !a.payload.equals(x.payload))) {
            throw new ScribbleException("String_Node_Str" + currfsm.getAllTakeable());
          }
        }
      }
    }
    for (    Role r : takeable.keySet()) {
      List<IOAction> acceptable_r=takeable.get(r);
      for (      IOAction a : acceptable_r) {
        if (a.isSend() || a.isReceive() || a.isDisconnect()) {
          getNextStates(todo,seen,curr,a.toGlobal(r),curr.accept(r,a));
        }
 else         if (a.isAccept() || a.isConnect()) {
          List<IOAction> as=takeable.get(a.peer);
          IOAction d=a.toDual(r);
          if (as != null && as.contains(d)) {
            as.remove(d);
            GIOAction g=(a.isConnect()) ? a.toGlobal(r) : d.toGlobal(a.peer);
            getNextStates(todo,seen,curr,g,curr.sync(r,a,a.peer,d));
          }
        }
 else         if (a.isWrapClient() || a.isWrapServer()) {
          List<IOAction> as=takeable.get(a.peer);
          IOAction w=a.toDual(r);
          if (as != null && as.contains(w)) {
            as.remove(w);
            GIOAction g=(a.isConnect()) ? a.toGlobal(r) : w.toGlobal(a.peer);
            getNextStates(todo,seen,curr,g,curr.sync(r,a,a.peer,w));
          }
        }
 else {
          throw new RuntimeException("String_Node_Str" + a);
        }
      }
    }
  }
  job.debugPrintln(init.toDot() + "String_Node_Str" + fullname+ "String_Node_Str"+ count+ "String_Node_Str");
  return init;
}

Fixed version (ground truth):
private WFState buildGlobalModel(GProtocolName fullname,GProtocolDecl gpd,Map<Role,EndpointFSM> egraphs,Map<Integer,WFState> seen) throws ScribbleException {
  Job job=getJob();
  if (!job.fair && !job.noLiveness) {
    for (    Entry<Role,EndpointFSM> e : egraphs.entrySet()) {
      Role r=e.getKey();
      EndpointFSM nonfair=e.getValue().init.unfairClone().toGraph().toFsm();
      egraphs.put(r,nonfair);
      job.debugPrintln("String_Node_Str" + fullname + "String_Node_Str"+ r+ "String_Node_Str"+ nonfair.init.toDot());
    }
  }
  WFBuffers b0=new WFBuffers(egraphs.keySet(),!gpd.modifiers.contains(GProtocolDecl.Modifiers.EXPLICIT));
  WFConfig c0=new WFConfig(egraphs,b0);
  WFState init=new WFState(c0);
  LinkedHashSet<WFState> todo=new LinkedHashSet<>();
  todo.add(init);
  int count=0;
  while (!todo.isEmpty()) {
    Iterator<WFState> i=todo.iterator();
    WFState curr=i.next();
    i.remove();
    seen.put(curr.id,curr);
    if (job.debug) {
      count++;
      if (count % 50 == 0) {
        job.debugPrintln("String_Node_Str" + fullname + "String_Node_Str"+ count);
      }
    }
    Map<Role,List<IOAction>> takeable=curr.getTakeable();
    for (    Role r : takeable.keySet()) {
      List<IOAction> acceptable_r=takeable.get(r);
      EndpointFSM currfsm=curr.config.states.get(r);
      Kind k=currfsm.getStateKind();
      if (k == Kind.OUTPUT) {
        for (        IOAction a : acceptable_r) {
          if (acceptable_r.stream().anyMatch((x) -> !a.equals(x) && a.peer.equals(x.peer) && a.mid.equals(x.mid)&& !a.payload.equals(x.payload))) {
            throw new ScribbleException("String_Node_Str" + acceptable_r);
          }
        }
      }
 else       if (k == Kind.UNARY_INPUT || k == Kind.POLY_INPUT || k == Kind.ACCEPT) {
        for (        IOAction a : acceptable_r) {
          if (currfsm.getAllTakeable().stream().anyMatch((x) -> !a.equals(x) && a.peer.equals(x.peer) && a.mid.equals(x.mid)&& !a.payload.equals(x.payload))) {
            throw new ScribbleException("String_Node_Str" + currfsm.getAllTakeable());
          }
        }
      }
    }
    for (    Role r : takeable.keySet()) {
      List<IOAction> acceptable_r=takeable.get(r);
      for (      IOAction a : acceptable_r) {
        if (a.isSend() || a.isReceive() || a.isDisconnect()) {
          getNextStates(todo,seen,curr,a.toGlobal(r),curr.take(r,a));
        }
 else         if (a.isAccept() || a.isConnect()) {
          List<IOAction> as=takeable.get(a.peer);
          IOAction d=a.toDual(r);
          if (as != null && as.contains(d)) {
            as.remove(d);
            GIOAction g=(a.isConnect()) ? a.toGlobal(r) : d.toGlobal(a.peer);
            getNextStates(todo,seen,curr,g,curr.sync(r,a,a.peer,d));
          }
        }
 else         if (a.isWrapClient() || a.isWrapServer()) {
          List<IOAction> as=takeable.get(a.peer);
          IOAction w=a.toDual(r);
          if (as != null && as.contains(w)) {
            as.remove(w);
            GIOAction g=(a.isConnect()) ? a.toGlobal(r) : w.toGlobal(a.peer);
            getNextStates(todo,seen,curr,g,curr.sync(r,a,a.peer,w));
          }
        }
 else {
          throw new RuntimeException("String_Node_Str" + a);
        }
      }
    }
  }
  job.debugPrintln("String_Node_Str" + fullname + "String_Node_Str"+ init.toDot()+ "String_Node_Str"+ fullname+ "String_Node_Str"+ count+ "String_Node_Str");
  return init;
}