Formal methods and mechanical verification applied to the development of a convergent distributed sorting program