Synopses & Reviews
This is the very first book to discuss the theory and principles of computer programming on the basis of the idea that a proof of correctness and a program should be developed hand in hand. It is built around the method first proposed by Dijkstra in his monograph The Discipline of Programming (1976), involving a "calculus for the derivation of programs." Directing his materials to the computer programmer with at least one year of experience, Gries presents explicit principles behind program development, and then leads the reader through example programs using those principles. Propositions and predicate calculus are presented as a took for the programmer, rather than simply an object of study. The reader should come away with a fresh outlook on programming theory and practice, and the assurance to develop correct programs effectively.
Describes basic programming principles and their step-by- step applications.Numerous examples are included.
Table of Contents
Part 0. Why Use Logic? Why Prove Programs Correct?; Part 1. 1. Propositions; 2. Reasoning Using Equivalence Transformations; 3. A Natural Deduction System; 4. Predicates; 5. Notations and Conventions for Arrays; 6. Using Assertions to Document Programs; Part2. The Semantics of a Small Language; 7. The Predicate Transformer wp; 8. The Commands Skip, Abort and Composition; 9. The Assignment Command; 10. The Alternative Command; 12. Procedure Call; 11. The Iterative Command; 12. Procedure Call; Part 3. The Development of Programs; 13. Introduction; 14. Programming as a Goal-Oriented Activity; 15. Developing Loops From Invariants and Bounds; 16. Developing Invariants; 17. Notes on Bound Functions; 18. Using Iteration Instead of Recursion; 19. Efficiency Considerations; 20. Two Larger Examples of Program Development; 21. Inverting Programs; 22. Notes on Documentation; 23. Historical Notes; Appendix 1-4; Answers to Exercises; References; Index