Book contents
- Frontmatter
- Contents
- Preface
- I Why Z?
- 1 Formal methods
- 2 Why Use Formal Methods?
- 3 Formal methods and project management
- Further reading
- II Introducing Z
- III Elements of Z
- IV Studies in Z
- V Programming with Z
- Further reading
- A Glossary of Z notation
- B Omitted features
- C Operator precedence
- D The Z mathematical tool-kit
- E Selected Laws
- F Solutions to selected exercises
- G Other formal notations
- Bibliography
- Index
1 - Formal methods
Published online by Cambridge University Press: 06 July 2010
- Frontmatter
- Contents
- Preface
- I Why Z?
- 1 Formal methods
- 2 Why Use Formal Methods?
- 3 Formal methods and project management
- Further reading
- II Introducing Z
- III Elements of Z
- IV Studies in Z
- V Programming with Z
- Further reading
- A Glossary of Z notation
- B Omitted features
- C Operator precedence
- D The Z mathematical tool-kit
- E Selected Laws
- F Solutions to selected exercises
- G Other formal notations
- Bibliography
- Index
Summary
Formal methods apply logic and simple mathematics to programming. They work best where traditional programming methods don't work very well: problems that are too difficult to solve by intuition or too novel to solve by modifying some existing program or design. They can help you create new programs, or analyze and document programs that are already written. Using formal methods requires creativity and judgment, but once you have created or analyzed a program formally, you can document your work as a sequence of steps that you or anyone else can check. You must be able to do this if you need to convince yourself or others that a program meets requirements for safety, accuracy, security, or any other critical property. It is also worth doing if you simply want to understand how the program works.
What are formal methods?
Formal methods are methods that use formulas.
A formula is a text or diagram constructed from predefined symbols combined according to explicit rules. A good working definition of formula is anything whose appearance or syntax can be checked by a computer. According to this definition, every computer program is a formula.
It's a little odd for programmers to speak of formal methods as if they were something special – as if formality were an option. If you want to program a computer, you really don't have any choice. Computation is formula evaluation.
- Type
- Chapter
- Information
- The Way of ZPractical Programming with Formal Methods, pp. 3 - 13Publisher: Cambridge University PressPrint publication year: 1996
- 1
- Cited by