public static QueryIterator makeQuery(Stella_Object iovariables, Stella_Object querytree, Cons externalbindings, Stella_Object options) {
    Logic.finalizeObjects();
    Logic.processCheckTypesAgenda();
    { Cons prefixquerytree = Logic.standardizeQueryTree(iovariables, querytree, Stella.NIL);
      Vector externalvector = ((!(externalbindings == Stella.NIL)) ? Logic.copyListToArgumentsVector(externalbindings.listify()) : ((Vector)(null)));
      Description description = null;
      QueryIterator query = Logic.allocateQueryIterator();

      if ((!Stella_Object.consP(iovariables)) ||
          Stella_Object.surrogateP(((Cons)(iovariables)).rest.value)) {
        KeyValueList.setDynamicSlotValue(query.dynamicSlots, Logic.SYM_LOGIC_ATOMIC_SINGLETONSp, Stella.TRUE_WRAPPER, Stella.FALSE_WRAPPER);
      }
      { Object old$Evaluationmode$000 = Logic.$EVALUATIONMODE$.get();
        Object old$Logicvariabletable$000 = Logic.$LOGICVARIABLETABLE$.get();
        Object old$Termunderconstruction$000 = Logic.$TERMUNDERCONSTRUCTION$.get();
        Object old$Queryiterator$000 = Logic.$QUERYITERATOR$.get();

        try {
          Native.setSpecial(Logic.$EVALUATIONMODE$, Logic.KWD_DESCRIPTION);
          Native.setSpecial(Logic.$LOGICVARIABLETABLE$, Stella.NIL);
          Native.setSpecial(Logic.$TERMUNDERCONSTRUCTION$, prefixquerytree);
          Native.setSpecial(Logic.$QUERYITERATOR$, null);
          { Object old$Module$000 = Stella.$MODULE$.get();
            Object old$Context$000 = Stella.$CONTEXT$.get();

            try {
              Native.setSpecial(Stella.$MODULE$, ((Module)(Stella.$MODULE$.get())));
              Native.setSpecial(Stella.$CONTEXT$, ((Module)(Stella.$MODULE$.get())));
              description = Logic.evaluateDescriptionTerm(prefixquerytree, false);

            } finally {
              Stella.$CONTEXT$.set(old$Context$000);
              Stella.$MODULE$.set(old$Module$000);
            }
          }

        } finally {
          Logic.$QUERYITERATOR$.set(old$Queryiterator$000);
          Logic.$TERMUNDERCONSTRUCTION$.set(old$Termunderconstruction$000);
          Logic.$LOGICVARIABLETABLE$.set(old$Logicvariabletable$000);
          Logic.$EVALUATIONMODE$.set(old$Evaluationmode$000);
        }
      }
      Logic.processCheckTypesAgenda();
      if (options != null) {
        QueryIterator.processQueryOptions(query, options);
      }
      return (QueryIterator.initializeQueryIterator(query, description, externalvector));
    }
  }