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

J4 ›› 2012, Vol. 34 ›› Issue (4): 108-113.

• 论文 • Previous Articles     Next Articles

A Proving the Termination of Loops Based on the Generation of Invariants

XING Jianying,LI Mengjun,LI Zhoujun   

  1. (School of Computer Science,National University of Defense Technology,Changsha 410073,China)
  • Received:2011-11-05 Revised:2012-02-10 Online:2012-04-26 Published:2012-04-25

Abstract:

Proving the termination of loops is a difficult part of program verification. Program invariants can describe the relations of program variables. Linear invariants can describe the linear relations of variables, and the relations of variables in the loops can be presented by loop invariants. By generating linear invariants and polynomial loop invariants, we transform proving the termination of loops to solving an optimization problem, then we present a practical framework of proving termination. Using the framework, the termination of loops can be proved automatically, and the complexity bounds of loops can be computed. The experimental results show the practicality of the method.

Key words: invariant;proving termination;optimization problem;complexity bound