public static Iterator allocateQuerySpecialistIterator(ControlFrame frame) {
    if (((Iterator)(KeyValueList.dynamicSlotValue(frame.dynamicSlots, RDBMS.SYM_STELLA_ITERATOR, null))) == null) {
      { Iterator iterator = null;
        Iterator iterator2 = null;
        Proposition proposition = frame.proposition;
        Surrogate relationref = ((Surrogate)(proposition.operator));

        { Cons triple = null;
          Cons iter000 = RDBMS.getQueryPatternEvaluators(relationref);

          for (;!(iter000 == Stella.NIL); iter000 = iter000.rest) {
            triple = ((Cons)(iter000.value));
            if (iterator == null) {
              iterator = ((Iterator)(edu.isi.stella.javalib.Native.funcall(((FunctionCodeWrapper)(triple.value)).wrapperValue, null, new java.lang.Object [] {proposition, triple.rest.value, triple.rest.rest.value})));
            }
            else {
              iterator2 = ((Iterator)(edu.isi.stella.javalib.Native.funcall(((FunctionCodeWrapper)(triple.value)).wrapperValue, null, new java.lang.Object [] {proposition, triple.rest.value, triple.rest.rest.value})));
              if (iterator2 != null) {
                iterator = iterator.concatenate(iterator2, Stella.NIL);
              }
            }
          }
        }
        KeyValueList.setDynamicSlotValue(frame.dynamicSlots, RDBMS.SYM_STELLA_ITERATOR, iterator, null);
      }
    }
    return (((Iterator)(KeyValueList.dynamicSlotValue(frame.dynamicSlots, RDBMS.SYM_STELLA_ITERATOR, null))));
  }