|
|
|
|
|
|
| David Carrington |
|
|
|
|
| Roger Duke |
|
|
|
|
| Ian Hayes |
|
|
|
|
| Paul Strooper |
|
|
|
|
Because this subject concentrates on formal methods for software development, a reasonable level of mathematical maturity, especially with discrete mathematics, and a reasonable maturity in software engineering is assumed. The prerequisite knowledge required includes:
- programming experience including control structures and recursive procedures,
- familiarity with common data structures and representations used to implement them,
- familiarity with proofs by mathematical induction, and
- understanding of program assertions (preconditions, postconditions, invariants), loop variants, and how to reason that a program is correct using these.
Lectures: Wednesday 2-4 pm, Room 78-621 (General Purpose South)Tutorial: Wednesday 4-5 pm, Room 78-621 (General Purpose South) - tutorials begin in the second week of semester.
The material in the first semester focuses on refinement of executable
programs (code) from specifications. The correctness of programs has been
of interest since the early days of computing, but it was only in the late
1960s that it became a research topic [2, 3].
Initially the emphasis was on proving that a given program met its
specification, given in terms of a precondition and a postcondition, but
it was soon recognised that a better approach is to develop the program
and the proof on correctness hand-in-hand [4].
In the late 1970s, Ralph-Johan Back developed the first refinement calculus. The main innovation was the introduction of a specification command as part of a programming language. The specification command is not executable. However, it allows a specification to be considered as a program. The development of an executable program begins with a single specification command, and step-by-step refines, via intermediate programs that are combinations of specification commands and executable code, to a final program that is code. In semester 1, CS424/CS824 introduces the concept of refining abstract specifications into implementation code. It demonstrates the refinement calculus approach for both procedural and data refinement and provides students with experience using the refinement calculus and an appreciation of its capabilities.
The following summary is intended as a guide to the material covered in semester 1 and its relationship to the first semester text book [1].
Procedures, parameters and recursion [Chapters 11-15] Procedures define named building blocks for programs. Every procedure has a specification, which programmers using the procedure make use of to determine the behaviour of the procedure, and an implementation, which is usually considerably more complex (and deterministic) than the specification. Of course, provided the implementation of the procedure satisfies (refines) the specification of the procedure the clients of the procedure will be satisfied.
Refinement methodologies and tools An overview of the currently available refinement methods and tools for supporting those methods.
The material in the second semester focuses on formal object-oriented specification and processes, and specification-based testing. The specification section reviews the logic and set theoretic bases used throughout specification and refinement. The object-oriented specification language Object-Z, an extension of the Z specification language, is covered in detail including several medium-scale case studies. This specification style is model oriented, focusing on states and transitions (operations) and includes a calculus for operation composition. Z provides a rich set of notations and constructs, is being progressively used in industry, and is currently undergoing international standardisation. The specification-based testing section uses formal specifications as a starting point for deriving test cases and oracles. Testing is a verification and validation activity that can be enhanced by using systematic approaches based on formal specifications.
Details of the Semester 2 program will be provided at the beginning of Semester 2.
| [1] | Carroll Morgan. Programming from Specifications. Prentice Hall, second edition, 1994. |
| This is an excellent introduction to this material and we will be following the book reasonably closely. Since it is already out of print, we have permission to supply students with a photocopy. |
Reference material (Semester 1)
The papers by Floyd [2] and Hoare [3] are important historically, as is the the book by Dijkstra [4]. The basic ideas behind refinement were first developed by Ralph-Johan Back [5]. The version of the refinement calculus that we deal with was developed by Carroll Morgan and Ken Robinson [1, 6].
An early paper on data refinement is that by Hoare [7]. The Vienna Development
Method (VDM) makes extensive use of data refinement [8]. A more recent
development is the B method [9], due to Jean-Raymond Abrial, who was also
primarily responsible for Z. B is a close relative of the refinement calculus.
The text [10] for the subject CS362 will also be of some use.
| [2] | R. W. Floyd, Assigning meaning to programs, Mathematical Aspects of Computer Science, pp.19-32, 19, 1967 |
| This paper is the starting point of research on reasoning about software. It is based on showing the correctness of programs represented as flowcharts. The paper is difficult to follow for the uninitiated. |
| [3] | C. A. R. Hoare, An axiomatic approach to computer programming, Communications of the ACM, pp.576-580, 583, 12, 1969. PSE Per. QA76.A715. |
| This paper first introduced the axiomatic style of reasoning about programs written using structured programming constructs. It follows on from the pioneering work of R.W. Floyd [2] but is more readable and in a style closer to that used these days. |
| [4] | E. W. Dijkstra, A Discipline of Programming, Prentice Hall, Englewood Cliffs, 1976 PSE QA76.6.D56. |
| This is a classic in the area by a pioneer in the field, it introduced the guarded command language and weakest preconditions, and the style of developing programs along side their proof of correctness. |
| [5] | R.-J. Back and J. von Wright, Refinement calculus : A systematic introduction Springer, 1998. PSE QA76.6 .B28 |
| [6] | Carroll Morgan and Trevor Vickers, On the Refinement Calculus, Springer-Verlag, 1994. PSE QA76.6.O49. |
| This book contains a collection of research papers on the refinement calculus. |
| [7] | C.A.R. Hoare, Proof of correctness of data representations, Acta Informatica, 1:271-281, 1972. |
| [8] | C. B. Jones, Systematic Software Development using VDM, Second edition, Prentice Hall, 1990. PSE QA76.76.D47J66 |
| This book deals with the Vienna Development Method (VDM). It is in a different style to that used in this subject but has an excellent treatment of specification and data refinement. |
| [9] | Jean-Raymond Abrial, The B-Book: Assigning programs to meanings, Cambridge University Press, 1996. |
| [10] | Anne Kaldewaij, Programming: The Derivation of Algorithms, Prentice Hall, 1990. PSE QA76.6.K3417. |
| The textbook used in the prerequisite subject CS362. |
| [11] | D. Gries, The Science of Programming, Springer Verlag, 1981. PSE QA76.6.G747. |
| The first good introductory text in the area in a style similar to that used by Dijkstra [4]. |
| [12] | E. W. Dijkstra and W. H. J. Feijen, A Method of Programming, Addison Wesley, 1988. PSE QA76.6.D5513. |
| A good introductory text in a style similar to that used in Dijkstra [4]. |
| [13] | Eric C. R. Hehner, A practical theory of programming, Springer-Verlag, 1993 PSE QA76.6.H428. |
| Another good introductory text in a different style. |
Reference material (Semester 2)
The following material is recommended reading for Semester 2.
Detailed class notes, printed solutions to tutorials, and all assignments will be distributed in the lectures and tutorials.
Computer/Laboratory facilities
Access to computer terminals is available for preparation of assignment solutions.
Consultation availability
The lecturers will be available for consultation at prescribed times and locations.
Collection/distribution of submitted material
Assignments will be collected and returned during the lectures.
Details of assessment in Semester 2 will be provided at the beginning of Semester 2.
A grade of 6 will be awarded to students who demonstrate excellence in at least one of the two areas (understanding of lecture material and practical work) and perform soundly in the other.
A grade of 5 will be awarded to students who perform at least soundly in both areas.
A grade of 4 will be awarded to students who perform at least soundly in one area and perform at a basic level in the other.
Otherwise a failing grade will be awarded.
The meanings of the terms "excellence", "soundly", and "basic level" will be discussed for each assessment item, including the final examination.