Special Topics in Software Engineering:

Formal Specification of Software

339.344 2KV Lightfoot Block

Formal methods of software engineering are the application of mathematical concepts to the specification and development of software systems. The concepts used are those of discrete mathematics: set theory, logic and whole numbers.

Formally specifying an existing system can be valuable in uncovering inconsistencies and errors, while formally specifying a new system helps avoid such problems, since mathematical proof can be used to ensure that essential properties are maintained.

Formal development is the "refinement" of an abstract specification into a concrete implementation (program), hand in hand with proving that the implementation matches its specification.


David Lightfoot, Oxford Brookes University


Date Time Room
Mo, 28.5.2018 14:30 - 18:00 MZ 005A
Tu, 29.5.2018 14:30 - 18:00 S2 054
We, 30.5.2018 14:30 - 18:00 HS 14
Exam, Tu 21.6.2018
16:15 - 17:45 S2 054


  1. Introduction
  2. Example of a formal specification in Z
  3. Set theory
  4. Z schemas
  5. Cartesian products and relations
  6. Functions and sequences
  7. Example of specification
  8. Refinement
  9. Formal development introduction
  10. Specifying at program level: pre- and post-conditions
  11. Selections
  12. Repetitions and invariants
  13. Proving termination: bound functions
  14. Examples of formally developed programs
  15. Summary


In order to pass this course students have to do both a written exam and a project.


The project description can be found on KUSSS. The deadline for the project will be announced later. Hand it in by e-mail to (DLightfoot@Brookes.ac.uk); make sure to include "Linz" in the subject line.


The slides and other material can be downloaded from here.


  • Jim Woodcock, Jim Davies: Using Z. Prentice Hall International, 1996
  • David Gries: The Science of Programming. Springer, 1981
  • David Lightfoot: Formal Specification Using Z (2nd ed.), Palgrave, 2001