private void CheckUniqueParticleAttribution(BitSet curpos) {
// particles will be attributed uniquely if the same symbol never poins to two different ones
object[] particles = new object[symbols.Count];
for (int pos = curpos.NextSet(-1); pos != -1; pos = curpos.NextSet(pos)) {
// if position can follow
int symbol = positions[pos].symbol;
if (particles[symbol] == null) {
// set particle for the symbol
particles[symbol] = positions[pos].particle;
}
else if (particles[symbol] != positions[pos].particle) {
throw new UpaException(particles[symbol], positions[pos].particle);
}
// two different position point to the same symbol and particle - that's OK
}
}