Formal Derivation and Implementation for the Stone-Merger Algorithm

Begun with the formal functional specification of stone-merger problem, formal derivation method of formal PAR was used. Recurrence formula and loop invariant of the problem naturally was gained. And then an efficient and correct algorithm was derived. Finally, according to the algorithm, the executable program of this problem has been solved.