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

计算机工程与科学 ›› 2022, Vol. 44 ›› Issue (06): 1063-1071.

• 计算机网络与信息安全 • 上一篇    下一篇

序列折半划分问题的形式化推导

左正康1,梁赞杨1,苏崴1,黄箐1,王渊2,王昌晶1   

  1. (1.江西师范大学计算机信息工程学院,江西 南昌330022;2.江西师范大学软件学院,江西 南昌330022)
  • 收稿日期:2021-08-12 修回日期:2021-10-15 接受日期:2022-06-25 出版日期:2022-06-25 发布日期:2022-06-17
  • 基金资助:
    国家自然科学基金(61862033,61902162);江西省自然科学基金(20202BABL202026,20202BABL202025,20202BAB202015);江西省教育厅科学技术重点研究项目(GJJ210307)

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

摘要: 形式化推导是在程序正确性证明理论下所进行的程序开发,最终得到完全正确的算法程序。针对序列折半划分问题,现有的形式化推导方法将推导与证明交替进行,推导过程繁琐且大多无法直接获得可执行程序。为解决上述问题,提出了一种新的序列折半划分问题的形式化推导方法。该方法基于分划递推的核心思想,应用规约变换技术对问题规约进行变换并严格保证一致性,使得在推导过程中无需交替证明,进而导出递推关系式并得到高可靠性抽象算法程序Apla,最终通过转换工具自动生成可执行程序。实现了从程序规约到具体可执行程序的完整程序求精过程。以2个序列算法为例,验证了该方法的有效性和可行性,对相关问题的形式化推导具有指导意义。

关键词: 折半划分, 形式化推导, 分划递推, 程序求精

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