A self-contained tutorial on Z for working programmers discussing practical ways to apply formal methods in real projects, first published in 1997.This self-contained tutorial on Z, a formal notation for modeling, specifying and designing computer systems and software, presents realistic case studies emphasizing safety-critical systems. It includes exercises with solutions, reference materials and a guide to further reading.This self-contained tutorial on Z, a formal notation for modeling, specifying and designing computer systems and software, presents realistic case studies emphasizing safety-critical systems. It includes exercises with solutions, reference materials and a guide to further reading.This self-contained tutorial on Z presents realistic case studies emphasizing safety-critical systems, with examples drawn from embedded controls, real-time and concurrent programming, computer graphics, games, text processing, databases, artificial intelligence, and object-oriented programming. It motivates the use of formal methods and discusses practical issues concerning how to apply them in real projects. It also teaches how to apply formal program derivation and verification to implement Z specifications in real programming languages with examples in C. The book includes exercises with solutions, reference materials, and a guide to further reading.Part I. Why Z?: 1. Formal methods; 2. Why use formal methods?; 3. Formal methods and project management; Part II. Introducing Z: 4. What is Z?; 5. A first example in Z; 6. From prose to Z: control console; 7. Introducing schemas: text editor; Part III. Elements of Z: 8. Elements; 9. Structure; 10. Logic; 11. Synthesis; 12. Schemas and schema calculus; 13. Schema types and bindings; 14. Generic definitions and free types; 15. Formal reasoning; Part IV. Studies in Z: 16. Document control system; 17. Text processing; 18. Eight queens; 19. Computer graphics and computational geometry; 20. Rule-based programming; 21. Grapl³2