public static void printKifQuantifiedVariables(Vector variables, boolean includetypesP) {
    if (variables == null) {
      return;
    }
    { OutputStream stream = ((OutputStream)(Logic.$PRINTLOGICALFORMSTREAM$.get()));

      stream.nativeStream.print("(");
      { Skolem vbl = null;
        Vector vector000 = variables;
        int index000 = 0;
        int length000 = vector000.length();
        int i = Stella.NULL_INTEGER;
        int iter000 = 1;

        for (;index000 < length000; index000 = index000 + 1, iter000 = iter000 + 1) {
          vbl = ((Skolem)((vector000.theArray)[index000]));
          i = iter000;
          { boolean printtypeP = includetypesP &&
                (!(Logic.logicalType(vbl) == Logic.SGT_STELLA_THING));

            if (printtypeP) {
              stream.nativeStream.print("(");
            }
            { Surrogate testValue000 = Stella_Object.safePrimaryType(vbl);

              if (Surrogate.subtypeOfP(testValue000, Logic.SGT_LOGIC_PATTERN_VARIABLE)) {
                { PatternVariable vbl000 = ((PatternVariable)(vbl));

                  PatternVariable.printQuantifiedVariable(vbl000, stream);
                }
              }
              else if (Surrogate.subtypeOfP(testValue000, Logic.SGT_LOGIC_SKOLEM)) {
                { Skolem vbl000 = ((Skolem)(vbl));

                  Skolem.printValueOfChain(vbl000, stream, vbl000);
                }
              }
              else {
                { OutputStringStream stream000 = OutputStringStream.newOutputStringStream();

                  stream000.nativeStream.print("`" + testValue000 + "' is not a valid case option");
                  throw ((StellaException)(StellaException.newStellaException(stream000.theStringReader()).fillInStackTrace()));
                }
              }
            }
            if (printtypeP) {
              stream.nativeStream.print(" " + Logic.logicalType(vbl).symbolName + ")");
            }
            if (i < variables.length()) {
              stream.nativeStream.print(" ");
            }
          }
        }
      }
      stream.nativeStream.print(")");
    }
  }