A partition refinement algorithm for the pi-calculus