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

Derivation and Formal Proof of NonRecursive Postorder BinaryTree Traversal Algorithm

  • ZUO Zheng-Kang ,
  • LIU Zhen ,
  • XUE Jin-Yun
Expand
  • (Key Laboratory for HighPerformance Computing Technology,Jiangxi Normal University,Nanchang 330022)

Received date: 2008-03-24

  Revised date: 2009-07-06

  Online published: 2010-03-10

Abstract

Developing loop invariants of algorithms containing nonlinear data structure is generally regarded as a difficult problem. In this paper, new strategies for developing loop invariant are introduced, and an exact and simple loop invariant of the nonrecursive postorder binarytree traversal algorithm is worked out by adopting the recursive definition technique of loop invariants and ideas of partitionandrecur. The approach considerably simplifies the process of derivation and proof of the nonrecursive algorithm and avoids the blindness of developing the loop invariant. Using datatype abstraction of Apla language, which is a part of PAR, the result algorithmic program is pretty concise and easy to be proved. Finally, the core algorithm (just 4 lines in Apla) is successfully proved by DijkstraGries standard proving technique, and the abstract program is transformed into C++ program by PAR platform. It is demonstrated that the recursive definition technique of loop invariant is feasible and effective for deriving and proving nonlinear data structure algorithms.

Cite this article

ZUO Zheng-Kang , LIU Zhen , XUE Jin-Yun . Derivation and Formal Proof of NonRecursive Postorder BinaryTree Traversal Algorithm[J]. Computer Engineering & Science, 2010 , 32(3) : 119 -123 . DOI: 10.3969/j.issn.1007130X.2010.

Outlines

/