optimized queue length calculations for promela transformation