symbol_set: add a method to compute the index of a symbol in the set.