Can you check your computer program for correctness without using complicated mathematics and logic? With this book, you will see that you can check much more than you might have thought.
Correctness for a computer program means that it meets its specification, that it does exactly what its users expect it to do. If the specification itself is complex, for example “plot a course for a spacecraft to reach Mars”, then inevitably the calculations the program carries out will be complex as well. But translating any specification into a corresponding computer program is a hazardous process for most people. Even a single bug introduced while writing the program, whether it’s simple or complex, can cause catastrophic failure: a crash landing rather than a safe descent.
Formal methods is the body of knowledge used to reduce drastically the bugs introduced as programs are written. It is however often taught with prerequisites that seem to insist that mathematical logic needs to be mastered first. But it need not: that is the “Informally” in our book’s title.
This text shows how to apply reliable principles of program design, using ordinary English to write assertions, the preconditions, postconditions and invariants, not only for conventional programs but also for data structures and for concurrency. However it also provides a conceptual basis, a “launch pad”, for those who would like later to pursue more serious study in formal methods and its uses.