Issue |
Wuhan Univ. J. Nat. Sci.
Volume 27, Number 5, October 2022
|
|
---|---|---|
Page(s) | 415 - 423 | |
DOI | https://doi.org/10.1051/wujns/2022275415 | |
Published online | 11 November 2022 |
Computer Science
CLC number: TP 311
A Unified Strategy for Formal Derivation and Proof of Binary Tree Nonrecursive Algorithms
1
College of Computer Information Engineering, Jiangxi Normal University, Nanchang 330022, Jiangxi, China
2
College of Software, Jiangxi Normal University, Nanchang 330022, Jiangxi, China
† To whom correspondence should be addressed. E-mail: wcj771006@163.com
Received:
12
October
2021
In the formal derivation and proof of binary tree algorithms, Dijkstra's weakest predicate method is commonly used. However, the method has some drawbacks, including a time-consuming derivation process, complicated loop invariants, and the inability to generate executable programs from the specification. This paper proposes a unified strategy for the formal derivation and proof of binary tree non-recursive algorithms to address these issues. First, binary tree problem solving sequences are decomposed into two types of recursive relations based on queue and stack, and two corresponding loop invariant templates are constructed. Second, high-reliability Apla (abstract programming language) programs are derived using recursive relations and loop invariants. Finally, Apla programs are converted automatically into C++ executable programs. Two types of problems with binary tree queue and stack recursive relations are used as examples, and their formal derivation and proof are performed to validate the proposed strategy's effectiveness. This strategy improves the efficiency and correctness of binary tree algorithm derivation.
Key words: queue and stack recursive relations / loop invariants / Dijkstra-Gries standard proving technique / nonlinear data structure
Biography: ZUO Zhengkang, male, Ph.D., Professor, research direction: software formal methods and generic programming. E-mail: zhengkang2005@iscas.ac.cn
Fundation item: National Natural Science Foundation of China (61862033, 61902162) and Key Project of Science and TechnologyResearch of Department of Education of Jiangxi Province (GJJ210307)
© Wuhan University 2022
This is an Open Access article distributed under the terms of the Creative Commons Attribution License (https://creativecommons.org/licenses/by/4.0), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.
Current usage metrics show cumulative count of Article Views (full-text article views including HTML views, PDF and ePub downloads, according to the available data) and Abstracts Views on Vision4Press platform.
Data correspond to usage on the plateform after 2015. The current usage metrics is available 48-96 hours after online publication and is updated daily on week days.
Initial download of the metrics may take a while.