Abstract. This is a tutorial introduction to the two most basic theories in Hoare & He's Unifying Theories of Programming and their mechanisation in the Isabelle interactive theorem prover. We describe the theories of relations and of designs (pre-postcondition pairs), interspersed with their formalisation in Isabelle and example mechanised proofs.Keywords: Unifying Theories of Programming (UTP), Denotational Semantics, Laws of Programming, Isabelle, Interactive Theorem Proving.Dedication: To Professor He Jifeng on the occasion of his 70th birthday.
PreliminariesUnifying Theories of Programming, originally the work of Hoare & He [15], is a long-term research agenda that can be summarised as follows. Researchers have proposed many different programming theories and practitioners have proposed many different pragmatic programming paradigms; how do we understand the relationship between them?UTP can trace its origins back to the work on predicative programming, which was started by Hehner; see [12] for a summary. It gives three principal ways to study such relationships: (i) by computational paradigm; (ii) by level of abstraction; and (iii) by method of presentation.In Section 2, we introduce the basic concepts of UTP: alphabets, signatures, and healthiness conditions, and in Section 3 we outline the idea of theory mechanisation in Isabelle/HOL. In Section 4, we go on to describe the alphabetised relational calculus, the formalism used to describe predicates in UTP theories. In Section 5, we introduce a basic nondeterministic programming language and its laws of programming. In Section 6, we complete the initial presentation of UTP by describing the organisaiton of UTP theories into complete lattices. Sections 7 and 8 show how Hoare logic and the weakest precondition calculus can be defined in UTP. Section 9 introduces the UTP theory of designs that capture the notion of total correctness using assumptions and commitments. The paper ends with a discussion of related work (Section 11) and some conclusions including directions for future work (Section 12). Computational Paradigms. UTP groups programming languages according to a classification by computational model; for example, structured, object-oriented, functional, or logical. The technique is to identify common concepts and deal separately with additions and variations. It uses two fundamental scientific principles: (i) simplicity of presentation and (ii) separation of concerns.Abstraction. Orthogonal to this organisation by computational paradigm, languages could be categorised by their level of abstraction within a particular paradigm. For example, the lowest level of abstraction may be the platformspecific technology of an implementation. At the other end of the spectrum, there might be a very high-level description of overall requirements and how they are captured and analysed. In between, there will be descriptions of components and descriptions of how they will be organised into architectures. Each of these levels will have interfaces specified by contract...