public static ParallelControlFrame parallelizeControlFrame(ControlFrame frame) {
    if (frame.state == Logic.KWD_PARALLEL_STRATEGIES) {
      return (((ParallelControlFrame)(frame)));
    }
    { ParallelControlFrame parallelparent = ParallelControlFrame.newParallelControlFrame();

      parallelparent.state = Logic.KWD_PARALLEL_STRATEGIES;
      ControlFrame.copyFrameState(frame, parallelparent);
      frame.up.down = parallelparent;
      frame.nextStrategies = Stella.NIL;
      KeyValueList.setDynamicSlotValue(frame.dynamicSlots, Logic.SYM_LOGIC_CACHED_BINDINGS_ITERATOR, null, null);
      KeyValueList.setDynamicSlotValue(frame.dynamicSlots, Logic.SYM_LOGIC_GOAL_CACHE, null, null);
      parallelparent.unboundVariablesP = !Proposition.allArgumentsBoundP(parallelparent.proposition);
      if ((frame.down != null) ||
          (((Iterator)(KeyValueList.dynamicSlotValue(frame.dynamicSlots, Logic.SYM_STELLA_ITERATOR, null))) != null)) {
        { ParallelThread childthread = ParallelThread.newParallelThread();

          frame.up = parallelparent;
          childthread.topControlFrame = frame;
          parallelparent.childThreads.insert(childthread);
          if (parallelparent.unboundVariablesP) {
            { PatternRecord patternrecord = frame.inheritedPatternRecord;

              childthread.variableBindings = patternrecord.variableBindings.copy();
              childthread.unbindingStack = ((IntegerVector)(patternrecord.unbindingStack.copy()));
              childthread.topUnbindingStackOffset = patternrecord.topUnbindingStackOffset;
            }
          }
        }
      }
      if (((QueryIterator)(Logic.$QUERYITERATOR$.get())).currentControlFrame == frame) {
        ((QueryIterator)(Logic.$QUERYITERATOR$.get())).currentControlFrame = parallelparent;
      }
      return (parallelparent);
    }
  }