Program: 12159
Project: 12159
Buggy source:
/** 
 * soar_module:81: instantiation* make_fake_instantiation( agent* my_agent, Symbol* state, wme_set* conditions, symbol_triple_list* actions )
 * @param state
 * @param conditions
 * @param actions
 * @return
 */
public static Instantiation make_fake_instantiation(SymbolImpl state,Set<WmeImpl> conditions,List<SymbolTriple> actions){
  Instantiation inst=new Instantiation(null,null,null);
  inst.nextInProdList=inst.prevInProdList=null;
  inst.match_goal=state.asIdentifier();
  inst.match_goal_level=state.asIdentifier().level;
  inst.backtrace_number=0;
  inst.in_ms=false;
  inst.GDS_evaluated_already=false;
  inst.preferences_generated=null;
{
    Preference pref;
    for (    SymbolTriple a_it : actions) {
      pref=new Preference(PreferenceType.ACCEPTABLE,a_it.id.asIdentifier(),a_it.attr,a_it.value,null);
      pref.o_supported=true;
      pref.inst=inst;
      pref.inst_next=pref.inst_prev=null;
      pref.inst_next=inst.preferences_generated;
      pref.inst_prev=null;
      if (inst.preferences_generated != null) {
        inst.preferences_generated.inst_prev=pref;
      }
      inst.preferences_generated=pref;
    }
  }
{
    PositiveCondition cond=null;
    Condition prev_cond=null;
    for (    WmeImpl c_it : conditions) {
      cond=new PositiveCondition();
      cond.prev=prev_cond;
      cond.next=null;
      if (prev_cond != null) {
        prev_cond.next=cond;
      }
 else {
        inst.top_of_instantiated_conditions=cond;
        inst.bottom_of_instantiated_conditions=cond;
        inst.nots=null;
      }
      cond.id_test=c_it.id;
      cond.attr_test=c_it.attr;
      cond.value_test=c_it.value;
      cond.test_for_acceptable_preference=c_it.acceptable;
      final BackTraceInfo conditionBacktraceInfo=cond.bt();
      conditionBacktraceInfo.wme_=c_it;
      conditionBacktraceInfo.level=c_it.id.level;
      conditionBacktraceInfo.trace=c_it.preference;
      prev_cond=cond;
    }
  }
  return inst;
}

Fixed version (ground truth):
/** 
 * soar_module:81: instantiation* make_fake_instantiation( agent* my_agent, Symbol* state, wme_set* conditions, symbol_triple_list* actions )
 * @param state
 * @param conditions
 * @param actions
 * @return
 */
public static Instantiation make_fake_instantiation(SymbolImpl state,Set<WmeImpl> conditions,List<SymbolTriple> actions){
  Instantiation inst=new Instantiation(null,null,null);
  inst.nextInProdList=inst.prevInProdList=null;
  inst.match_goal=state.asIdentifier();
  inst.match_goal_level=state.asIdentifier().level;
  inst.backtrace_number=0;
  inst.in_ms=false;
  inst.GDS_evaluated_already=false;
  inst.preferences_generated=null;
{
    Preference pref;
    for (    SymbolTriple a_it : actions) {
      pref=new Preference(PreferenceType.ACCEPTABLE,a_it.id.asIdentifier(),a_it.attr,a_it.value,null);
      pref.o_supported=true;
      pref.inst=inst;
      pref.inst_next=pref.inst_prev=null;
      pref.inst_next=inst.preferences_generated;
      pref.inst_prev=null;
      if (inst.preferences_generated != null) {
        inst.preferences_generated.inst_prev=pref;
      }
      inst.preferences_generated=pref;
    }
  }
{
    PositiveCondition cond=null;
    Condition prev_cond=null;
    for (    WmeImpl c_it : conditions) {
      cond=new PositiveCondition();
      cond.prev=prev_cond;
      cond.next=null;
      if (prev_cond != null) {
        prev_cond.next=cond;
      }
 else {
        inst.top_of_instantiated_conditions=cond;
        inst.bottom_of_instantiated_conditions=cond;
        inst.nots=null;
      }
      cond.id_test=c_it.id;
      cond.attr_test=c_it.attr;
      cond.value_test=c_it.value;
      cond.test_for_acceptable_preference=c_it.acceptable;
      final BackTraceInfo conditionBacktraceInfo=cond.bt();
      conditionBacktraceInfo.wme_=c_it;
      conditionBacktraceInfo.level=c_it.id.level;
      conditionBacktraceInfo.trace=c_it.preference;
      if (cond.bt().trace != null) {
        if (!SoarConstants.DO_TOP_LEVEL_REF_CTS || inst.match_goal_level > SoarConstants.TOP_GOAL_LEVEL) {
          cond.bt().trace.preference_add_ref();
        }
      }
      prev_cond=cond;
    }
  }
  return inst;
}