• 中国计算机学会会刊
  • 中国科技核心期刊
  • 中文核心期刊

Computer Engineering & Science ›› 2022, Vol. 44 ›› Issue (06): 1063-1071.

• Computer Network and Znformation Security • Previous Articles     Next Articles

Formal derivation of the sequence dimidiate partition problem

ZUO Zheng-kang1,LIANG Zan-yang1,SU Wei1,HUANG Qing1,WANG Yuan2,WANG Chang-jing1   

  1. (1.School of Computer Information Engineering,Jiangxi Normal University,Nanchang 330022;
    2.School of Software,Jiangxi Normal University,Nanchang 330022,China)
  • Received:2021-08-12 Revised:2021-10-15 Accepted:2022-06-25 Online:2022-06-25 Published:2022-06-17

Abstract: Formal derivation is the program development under the theory of program correctness proof, and finally obtains the completely correct algorithm program. Regarding the problem of sequence dimidiate partition, the existing formal derivation method alternates the derivation and proof in the derivation process. The derivation process is cumbersome and most of them cannot directly obtain the executable program. To solve the above problems, this paper proposes a new formal derivation method for the sequence dimidiate partition problem. This method is based on the core idea of partition and recursion, applies the specification transformation technology to transform the problem specification and strictly guarantee its consistency, so that there is no need to proof in the derivation process. Then, the recurrence relations are derived and a highly reliable Apla program is obtained. Finally, the conversion tool is used to automatically generates executable programs. It realizes the complete process of program refinement from the program specification to the specific executable program. By taking two algorithms as examples, the effectiveness and feasibility of the method are verified. It has guided significance for the formal derivation of related problems.


Key words: dimidiate partition, formal derivation, partition and recursion, program refinement