public static Stella_Object getQueryPatternMemoizationKey(Proposition proposition) {
    { Surrogate relationref = ((Surrogate)(proposition.operator));
      Vector iovars = Logic.getDescription(relationref).ioVariables;
      List unboundvars = List.list(Stella.NIL);
      OutputStringStream key = OutputStringStream.newOutputStringStream();

      Logic.printLogicalForm(relationref, key);
      { Stella_Object arg = null;
        Vector vector000 = proposition.arguments;
        int index000 = 0;
        int length000 = vector000.length();

        for (;index000 < length000; index000 = index000 + 1) {
          arg = (vector000.theArray)[index000];
          key.nativeStream.print(" ");
          if (Logic.variableP(arg) &&
              (Logic.safeArgumentBoundTo(arg) == null)) {
            if (!(unboundvars.memberP(arg))) {
              unboundvars.insertLast(arg);
            }
            Logic.printLogicalForm(((PatternVariable)((iovars.theArray)[(unboundvars.position(arg, 0))])), key);
          }
          else {
            Logic.printLogicalForm(Logic.safeArgumentBoundTo(arg), key);
          }
        }
      }
      return (StringWrapper.wrapString(key.theStringReader()));
    }
  }