Program: 73887
Project: 73887
Buggy source:
/** 
 * Return an interface that results from the cascade composition of this interface and the given interface. Note that this is not commutative.  The outputs of this interface must be connected to the inputs of the given interface.
 * @param rhs The interface to compose with.
 * @param connections The connections from this to rhs.
 * @return The comosition's interface.
 */
public RelationalInterface cascadeComposeWith(final RelationalInterface rhs,final Set<Connection> connections){
  final Set<String> newInputs=new HashSet<String>();
  newInputs.addAll(_inputPorts);
  newInputs.addAll(rhs._inputPorts);
  for (  final Connection c : connections) {
    newInputs.remove(c._inputPort);
  }
  final Set<String> newOutputs=new HashSet<String>();
  newOutputs.addAll(_outputPorts);
  newOutputs.addAll(rhs._outputPorts);
  for (  final Connection c : connections) {
    newOutputs.add(c._inputPort);
  }
  final String connectionContracts=Connection.getContract(connections);
  final Set<String> newConstraints=new HashSet<String>();
  newConstraints.add(_contract);
  newConstraints.add(rhs._contract);
  newConstraints.add(connectionContracts);
  final StringBuffer y=new StringBuffer("String_Node_Str");
  for (  final Connection c : connections) {
    y.append(c._inputPort + "String_Node_Str" + c._outputPort+ "String_Node_Str");
  }
  for (  final String firstInterfaceOutputVariable : _outputPorts) {
    y.append(firstInterfaceOutputVariable + "String_Node_Str");
  }
  y.append("String_Node_Str");
  final String phi="String_Node_Str" + _contract + "String_Node_Str"+ connectionContracts+ "String_Node_Str"+ rhs.inContract()+ "String_Node_Str";
  newConstraints.add("String_Node_Str" + y.toString() + "String_Node_Str"+ phi+ "String_Node_Str");
  return new RelationalInterface(newInputs,newOutputs,LispExpression.conjunction(newConstraints));
}

Fixed version (ground truth):
/** 
 * Return an interface that results from the cascade composition of this interface and the given interface. Note that this is not commutative.  The outputs of this interface must be connected to the inputs of the given interface.
 * @param rhs The interface to compose with.
 * @param connections The connections from this to rhs.
 * @return The comosition's interface.
 */
public RelationalInterface cascadeComposeWith(final RelationalInterface rhs,final Set<Connection> connections){
  final Set<String> newInputs=new HashSet<String>();
  newInputs.addAll(_inputPorts);
  newInputs.addAll(rhs._inputPorts);
  for (  final Connection c : connections) {
    newInputs.remove(c._inputPort);
  }
  final Set<String> newOutputs=new HashSet<String>();
  newOutputs.addAll(_outputPorts);
  newOutputs.addAll(rhs._outputPorts);
  for (  final Connection c : connections) {
    newOutputs.add(c._inputPort);
  }
  final String connectionContracts=Connection.getContract(connections);
  final Set<String> newConstraints=new HashSet<String>();
  newConstraints.add(_contract);
  newConstraints.add(rhs._contract);
  newConstraints.add(connectionContracts);
  Set<String> quantifiedOutputs=new HashSet<String>();
  for (  final Connection c : connections) {
    quantifiedOutputs.add(c._inputPort + "String_Node_Str");
    quantifiedOutputs.add(c._outputPort + "String_Node_Str");
  }
  for (  final String firstInterfaceOutputVariable : _outputPorts) {
    quantifiedOutputs.add(firstInterfaceOutputVariable + "String_Node_Str");
  }
  final String y=LispExpression.node("String_Node_Str",quantifiedOutputs);
  final String phi="String_Node_Str" + _contract + "String_Node_Str"+ connectionContracts+ "String_Node_Str"+ rhs.inContract()+ "String_Node_Str";
  newConstraints.add("String_Node_Str" + y.toString() + "String_Node_Str"+ phi+ "String_Node_Str");
  return new RelationalInterface(newInputs,newOutputs,LispExpression.conjunction(newConstraints));
}