public static void collectExternalVariables(Proposition proposition) {
    { 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];
        { Surrogate testValue000 = Stella_Object.safePrimaryType(arg);

          if (Surrogate.subtypeOfP(testValue000, Logic.SGT_LOGIC_PATTERN_VARIABLE)) {
            { PatternVariable arg000 = ((PatternVariable)(arg));

              if (((Cons)(Logic.$LOGICVARIABLETABLE$.get())).memberP(arg000) &&
                  (!((Cons)(Logic.$EXTERNALVARIABLES$.get())).memberP(arg000))) {
                Native.setSpecial(Logic.$EXTERNALVARIABLES$, Cons.cons(arg000, ((Cons)(Logic.$EXTERNALVARIABLES$.get()))));
              }
            }
          }
          else if (Surrogate.subtypeOfP(testValue000, Logic.SGT_LOGIC_PROPOSITION)) {
            { Proposition arg000 = ((Proposition)(arg));

              Proposition.collectExternalVariables(arg000);
            }
          }
          else {
          }
        }
      }
    }
  }