public static void initializeOptimizerMemory(int stacksize) {
    if ((stacksize <= 0) &&
        (((ExtensibleVector)(KeyValueList.dynamicSlotValue(((QueryIterator)(Logic.$QUERYITERATOR$.get())).dynamicSlots, Logic.SYM_LOGIC_OPTIMIZER_GOAL_RECORDS, null))) != null)) {
      stacksize = ((ExtensibleVector)(KeyValueList.dynamicSlotValue(((QueryIterator)(Logic.$QUERYITERATOR$.get())).dynamicSlots, Logic.SYM_LOGIC_OPTIMIZER_GOAL_RECORDS, null))).length();
    }
    Logic.initializeOptimizerGoalRecords(stacksize);
    KeyValueList.setDynamicSlotValue(((QueryIterator)(Logic.$QUERYITERATOR$.get())).dynamicSlots, Logic.SYM_LOGIC_RESIDUE_GOALS, List.list(Stella.NIL), null);
    KeyValueList.setDynamicSlotValue(((QueryIterator)(Logic.$QUERYITERATOR$.get())).dynamicSlots, Logic.SYM_LOGIC_BEST_GOAL_SEQUENCE, List.list(Stella.NIL), null);
    KeyValueList.setDynamicSlotValue(((QueryIterator)(Logic.$QUERYITERATOR$.get())).dynamicSlots, Logic.SYM_LOGIC_BEST_COST, FloatWrapper.wrapFloat(Stella.NULL_FLOAT), Stella.NULL_FLOAT_WRAPPER);
  }