Pictures as invariants

The development, specification, and use of a loop invariant are useful and underutilized tools in writing code to solve a problem or implement an algorithm. Invariants are especially useful in introductory courses (CS1 and CS2) but are usually avoided because of the mathematical notation associated with them and because most textbooks have brief, if any, coverage of them. Our intent in this paper is provide several motivating examples of the use of pictures as loop invariants and to provide pointers to literature that more fully explores and develops the ideas of using loop invariants in specifying and developing programs.

[1]  Brian Li,et al.  Algorthmic pradigms: examples in computational geometry II , 1990, SIGCSE '90.

[2]  Alfred V. Aho,et al.  The Design and Analysis of Computer Algorithms , 1974 .

[3]  N. Adlai A. De Pano Algorithmic paradigms: examples in computational geometry , 1988, SIGCSE '88.

[4]  I. G. BONNER CLAPPISON Editor , 1960, The Electric Power Engineering Handbook - Five Volume Set.

[5]  Edsger W. Dijkstra,et al.  Formal Development of Programs and Proofs , 1990 .

[6]  Donald T. Piele How to Solve It with the Computer. , 1980 .

[7]  Peter J. Denning A debate on teaching computing science , 1989, CACM.

[8]  C. D. Walter Algorithmics–The spirit of computing , 1988 .

[9]  Moshe J. Augenstein,et al.  Data Structures Using Pascal , 1981 .

[10]  Jon Louis Bentley Programming pearls: Document design , 1986, CACM.

[11]  Edsger W. Dijkstra,et al.  A method of programming , 1988 .

[12]  Yishai A. Feldman,et al.  Algorithmics: The Spirit of Computing , 1987 .

[13]  Susan C. Lilly,et al.  Pascal Plus data structures, algorithms, and advanced programming , 1985 .

[14]  Robert L. Kruse DATA STRUCTURES PROGRAM DESIGN , 1987 .

[15]  Jon Louis Bentley,et al.  Programming pearls , 1987, CACM.

[16]  Elliot B. Koffman Turbo Pascal , 1986 .

[17]  Michael Ian Shamos,et al.  Computational geometry: an introduction , 1985 .

[18]  Udi Manber,et al.  Introduction to algorithms - a creative approach , 1989 .

[19]  Donald Ervin Knuth,et al.  The Art of Computer Programming , 1968 .

[20]  P. Gács,et al.  Algorithms , 1992 .

[21]  David Gries,et al.  The Science of Programming , 1981, Text and Monographs in Computer Science.

[22]  R. G. Dromey,et al.  How to Solve it by Computer , 1982 .