Special Topics in Software Engineering:

Formal Specification of Software

339.344 2KV Lightfoot 15.5.2023

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, 15.5.2023 14:30 - 18:00 S4 025
Tu, 16.5.2023 14:30 - 18:00 S4 025
We, 17.5.2023 14:30 - 18:00 S2 059
Exam, 15.6.2023
15:30 - 17:00 HS 2


  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.

Project 2023

Schrift ZED


  • 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