code: private static void add(IntegerVector semantics, TernaryVector index) {
          // Lock on the semantic vector to avoid a race condition with another
          // thread updating its semantics.  Use the vector to avoid a class-level
          // lock, which would limit the concurrency.
          synchronized(semantics) {
              for (int p : index.positiveDimensions())
                  semantics.add(p, 1);
              for (int n : index.negativeDimensions())
                  semantics.add(n, -1);
          }
      }
docs: Atomically adds the values of the index vector to the semantic vector.
  This is a special case addition operation that only iterates over the
  non-zero values of the index vector.