public static int countBoundArguments(Proposition goal) {
    { int count = 0;

      { Keyword testValue000 = goal.kind;

        if ((testValue000 == Logic.KWD_NOT) ||
            (testValue000 == Logic.KWD_FAIL)) {
          return (Proposition.countBoundArguments(((Proposition)((goal.arguments.theArray)[0]))));
        }
        else if ((testValue000 == Logic.KWD_AND) ||
            (testValue000 == Logic.KWD_OR)) {
          { Stella_Object arg = null;
            Vector vector000 = goal.arguments;
            int index000 = 0;
            int length000 = vector000.length();

            for (;index000 < length000; index000 = index000 + 1) {
              arg = (vector000.theArray)[index000];
              count = count + Proposition.countBoundArguments(((Proposition)(arg)));
            }
          }
        }
        else if ((testValue000 == Logic.KWD_FUNCTION) ||
            ((testValue000 == Logic.KWD_PREDICATE) ||
             ((testValue000 == Logic.KWD_EQUIVALENT) ||
              (testValue000 == Logic.KWD_ISA)))) {
          { Stella_Object arg = null;
            Vector vector001 = goal.arguments;
            int index001 = 0;
            int length001 = vector001.length();
            int i = Stella.NULL_INTEGER;
            int iter000 = 0;

            loop001 : for (;index001 < length001; index001 = index001 + 1, iter000 = iter000 + 1) {
              arg = (vector001.theArray)[index001];
              i = iter000;
              if ((i == 0) &&
                  (goal.operator == Logic.SGT_PL_KERNEL_KB_HOLDS)) {
                continue loop001;
              }
              if (!(Logic.unboundVariableP(arg))) {
                count = count + 1;
              }
            }
          }
        }
        else {
          count = 1;
        }
      }
      return (count);
    }
  }