Program: 12173
Project: 12173
Buggy source:
/** 
 * <p> episodic_memory.cpp:5063:void inline _epmem_respond_to_cmd_parse( agent my_agent, epmem_wme_list* cmds, bool& good_cue, int& path, epmem_time_id& retrieve, Symbol*& next, Symbol*& previous, Symbol*& query, Symbol*& neg_query, epmem_time_list& prohibit, epmem_time_id& before, epmem_time_id& after, epmem_symbol_set& currents, soar_module::wme_set& cue_wmes )
 * @param cmds
 * @param good_cue
 * @param path
 * @param retrieve
 * @param next
 * @param previous
 * @param query
 * @param neg_query
 * @param prohibit
 * @param before
 * @param after
 * @param currents
 * @param cue_wmes
 */
private void _epmem_respond_to_cmd_parse(List<WmeImpl> cmds,boolean good_cue,int path,long retrieve,SymbolImpl next,SymbolImpl previous,SymbolImpl query,SymbolImpl neg_query,List<Long> prohibit,long before,long after,Set<SymbolImpl> currents,Set<WmeImpl> cue_wmes){
  cue_wmes.clear();
  retrieve=EPMEM_MEMID_NONE;
  next=null;
  previous=null;
  query=null;
  neg_query=null;
  prohibit.clear();
  before=EPMEM_MEMID_NONE;
  after=EPMEM_MEMID_NONE;
  good_cue=true;
  path=0;
  for (  WmeImpl w_p : cmds) {
    cue_wmes.add((w_p));
    if (good_cue) {
      if (w_p.attr == predefinedSyms.epmem_sym_retrieve) {
        if ((w_p.getValue().asInteger() != null) && (path == 0) && (w_p.value.asInteger().getValue() > 0)) {
          retrieve=w_p.value.asInteger().getValue();
          path=1;
        }
 else {
          good_cue=false;
        }
      }
 else       if (w_p.attr == predefinedSyms.epmem_sym_next) {
        if ((w_p.getValue().asIdentifier() != null) && (path == 0)) {
          next=w_p.value;
          path=2;
        }
 else {
          good_cue=false;
        }
      }
 else       if (w_p.attr == predefinedSyms.epmem_sym_prev) {
        if ((w_p.getValue().asIdentifier() != null) && (path == 0)) {
          previous=w_p.value;
          path=2;
        }
 else {
          good_cue=false;
        }
      }
 else       if (w_p.attr == predefinedSyms.epmem_sym_query) {
        if ((w_p.getValue().asIdentifier() != null) && ((path == 0) || (path == 3)) && (query == null)) {
          query=w_p.value;
          path=3;
        }
 else {
          good_cue=false;
        }
      }
 else       if (w_p.attr == predefinedSyms.epmem_sym_negquery) {
        if ((w_p.getValue().asIdentifier() != null) && ((path == 0) || (path == 3)) && (neg_query == null)) {
          neg_query=w_p.value;
          path=3;
        }
 else {
          good_cue=false;
        }
      }
 else       if (w_p.attr == predefinedSyms.epmem_sym_before) {
        if ((w_p.getValue().asInteger() != null) && ((path == 0) || (path == 3))) {
          if ((before == EPMEM_MEMID_NONE) || (w_p.value.asInteger().getValue() < before)) {
            before=w_p.value.asInteger().getValue();
          }
          path=3;
        }
 else {
          good_cue=false;
        }
      }
 else       if (w_p.attr == predefinedSyms.epmem_sym_after) {
        if ((w_p.getValue().asInteger() != null) && ((path == 0) || (path == 3))) {
          if (after < w_p.value.asInteger().getValue()) {
            after=w_p.value.asInteger().getValue();
          }
          path=3;
        }
 else {
          good_cue=false;
        }
      }
 else       if (w_p.attr == predefinedSyms.epmem_sym_prohibit) {
        if ((w_p.getValue().asInteger() != null) && ((path == 0) || (path == 3))) {
          prohibit.add(w_p.value.asInteger().getValue());
          path=3;
        }
 else {
          good_cue=false;
        }
      }
 else       if (w_p.attr == predefinedSyms.epmem_sym_current) {
        if ((w_p.getValue().asIdentifier() != null) && ((path == 0) || (path == 3))) {
          currents.add(w_p.value);
          path=3;
        }
 else {
          good_cue=false;
        }
      }
 else {
        good_cue=false;
      }
    }
  }
  if ((path == 3) && (query == null)) {
    good_cue=false;
  }
  if (path == 0) {
    good_cue=false;
  }
}

Fixed version (ground truth):
/** 
 * <p> episodic_memory.cpp:5063: void inline _epmem_respond_to_cmd_parse(  agent my_agent,  epmem_wme_list* cmds,  bool& good_cue,  int& path,  epmem_time_id& retrieve,  Symbol*& next,  Symbol*& previous,  Symbol*& query,  Symbol*& neg_query,  epmem_time_list& prohibit,  epmem_time_id& before,  epmem_time_id& after,  epmem_symbol_set& currents,  soar_module::wme_set& cue_wmes  )
 * @param cmds
 * @param good_cue
 * @param path
 * @param retrieve
 * @param next
 * @param previous
 * @param query
 * @param neg_query
 * @param prohibit
 * @param before
 * @param after
 * @param currents
 * @param cue_wmes
 */
private void _epmem_respond_to_cmd_parse(List<WmeImpl> cmds,final ByRef<Boolean> good_cue,final ByRef<Integer> path,final ByRef<Long> retrieve,SymbolImpl next,SymbolImpl previous,SymbolImpl query,SymbolImpl neg_query,List<Long> prohibit,final ByRef<Long> before,final ByRef<Long> after,Set<SymbolImpl> currents,Set<WmeImpl> cue_wmes){
  cue_wmes.clear();
  retrieve.value=EPMEM_MEMID_NONE;
  next=null;
  previous=null;
  query=null;
  neg_query=null;
  prohibit.clear();
  before.value=EPMEM_MEMID_NONE;
  after.value=EPMEM_MEMID_NONE;
  good_cue.value=true;
  path.value=0;
  for (  WmeImpl w_p : cmds) {
    cue_wmes.add((w_p));
    if (good_cue.value) {
      if (w_p.attr == predefinedSyms.epmem_sym_retrieve) {
        if ((w_p.getValue().asInteger() != null) && (path.value == 0) && (w_p.value.asInteger().getValue() > 0)) {
          retrieve.value=w_p.value.asInteger().getValue();
          path.value=1;
        }
 else {
          good_cue.value=false;
        }
      }
 else       if (w_p.attr == predefinedSyms.epmem_sym_next) {
        if ((w_p.getValue().asIdentifier() != null) && (path.value == 0)) {
          next=w_p.value;
          path.value=2;
        }
 else {
          good_cue.value=false;
        }
      }
 else       if (w_p.attr == predefinedSyms.epmem_sym_prev) {
        if ((w_p.getValue().asIdentifier() != null) && (path.value == 0)) {
          previous=w_p.value;
          path.value=2;
        }
 else {
          good_cue.value=false;
        }
      }
 else       if (w_p.attr == predefinedSyms.epmem_sym_query) {
        if ((w_p.getValue().asIdentifier() != null) && ((path.value == 0) || (path.value == 3)) && (query == null)) {
          query=w_p.value;
          path.value=3;
        }
 else {
          good_cue.value=false;
        }
      }
 else       if (w_p.attr == predefinedSyms.epmem_sym_negquery) {
        if ((w_p.getValue().asIdentifier() != null) && ((path.value == 0) || (path.value == 3)) && (neg_query == null)) {
          neg_query=w_p.value;
          path.value=3;
        }
 else {
          good_cue.value=false;
        }
      }
 else       if (w_p.attr == predefinedSyms.epmem_sym_before) {
        if ((w_p.getValue().asInteger() != null) && ((path.value == 0) || (path.value == 3))) {
          if ((before.value == EPMEM_MEMID_NONE) || (w_p.value.asInteger().getValue() < before.value)) {
            before.value=w_p.value.asInteger().getValue();
          }
          path.value=3;
        }
 else {
          good_cue.value=false;
        }
      }
 else       if (w_p.attr == predefinedSyms.epmem_sym_after) {
        if ((w_p.getValue().asInteger() != null) && ((path.value == 0) || (path.value == 3))) {
          if (after.value < w_p.value.asInteger().getValue()) {
            after.value=w_p.value.asInteger().getValue();
          }
          path.value=3;
        }
 else {
          good_cue.value=false;
        }
      }
 else       if (w_p.attr == predefinedSyms.epmem_sym_prohibit) {
        if ((w_p.getValue().asInteger() != null) && ((path.value == 0) || (path.value == 3))) {
          prohibit.add(w_p.value.asInteger().getValue());
          path.value=3;
        }
 else {
          good_cue.value=false;
        }
      }
 else       if (w_p.attr == predefinedSyms.epmem_sym_current) {
        if ((w_p.getValue().asIdentifier() != null) && ((path.value == 0) || (path.value == 3))) {
          currents.add(w_p.value);
          path.value=3;
        }
 else {
          good_cue.value=false;
        }
      }
 else {
        good_cue.value=false;
      }
    }
  }
  if ((path.value == 3) && (query == null)) {
    good_cue.value=false;
  }
  if (path.value == 0) {
    good_cue.value=false;
  }
}