Abstract
The loop invariants take a very important role in the design, proof and derivation of the algorithmic program. We point out the limitations of the traditional standard strategy for developing loop invariants, and propose two new strategies for proving the existing algorithmic program and developing new ones. The strategies use recurrence as vehicle and integrate some effective methods of designing algorithms, e. g. Dynamic Programming, Greedy and Divide- Conquer, into the recurrence relation of problem solving sequence. This lets us get straightforward an approach for solving a variety of complicated problems, and makes the standard proof and formal derivation of their algorithmic programs possible. We show the method and advantages of applying the strategies with several typical nontrivial examples.
Similar content being viewed by others
Explore related subjects
Discover the latest articles, news and stories from top researchers in related subjects.References
Dijkstra, E. W., A Discipline of Programming. Prentice Hall, Englewood Cliffs, 1976.
Dijkstra, E. W. and van Gasteren, A. J. M. A simple fixpoint argument without the restriction to continuity.Acta Informatica, 1986, 23, 1–7.
Gries, D., The Science of Programming. Springer Verlag, New York, 1981.
Gries, D., A note on a standard strategy for developing loop invariants and loops.Science of Computer Programming, 1982, 2, 207–214.
Gries, D. and Xue, Jinyun, Generating a Random Cyclic Permutation.BIT, 1988, 28, 569–572.
Gries, D. and Wadkins, J., An Introduction to Proofs of Program Correctness for Teacher of College-level Introduction, Programming Courses. TR90-1102, Dept. of CS, Cornell Univ., 1990.
Harel, D., Algorithmics: The Spirit of Computing. Addison-Wesley, 108–109, 1987.
Denning, P., A debate on teaching computing science.CACM., 1989, 32, 1397–1414.
Linger, R. C., Mills, H. D. and Witt, B. I., Structured Programming: Theory and Practice. Reading, Mass, Addison-Wesley, 1979.
Manna, Z. and Waldinger, R., Synthesizer: Dream⇒ Program.IEEE Transaction on Software Engineering, 1979, 5, 294–328.
Remmers, J., A technique for developing loop invariants.Information Processing Letters, 1984, 18, 137–139.
Xue, Jinyun and Gries, D., Developing a linear algorithm for cubing a cycle permutation.Science of Computer Programming, 1988, 11, 161–165.
Li Zhaoren, A formal method of programming and the experimental system.Chinese Journal of Computers, 1985, 8(1), 8–18.
Xue, Jinyun, On Loop Invariant and Its Developing Techniques. Proceedings of China 4th Conference On Software Engneering, 1991. (in Chinese).
Aho, A., Hopcroft, J. and Ullman, J., Data Structures and Algorithms. Addison-Wesley Publishing Company, 1983.
Author information
Authors and Affiliations
Additional information
Research supported by the National Natural Science Foundation of China.
Research supported by the National Natural Science Foundation of China.
Rights and permissions
About this article
Cite this article
Jinyun, X. Two new strategies for developing loop invariants and their applications. J. of Compt. Sci. & Technol. 8, 147–154 (1993). https://doi.org/10.1007/BF02939477
Received:
Revised:
Issue Date:
DOI: https://doi.org/10.1007/BF02939477