Unifying Theories of Programming

Unifying Theories of Programming (UTP) in computer science deals with program semantics. It shows how denotational semantics, operational semantics and algebraic semantics can be combined in a unified framework for the formal specification, design and implementation of programs and computer systems.

The book of this title by C.A.R. Hoare and He Jifeng was published in the Prentice Hall International Series in Computer Science in 1998 and is now freely available on the web.[1]

Theories

The semantic foundation of the UTP is the first-order predicate calculus, augmented with fixed point constructs from second-order logic. Following the tradition of Eric Hehner, programs are predicates in the UTP, and there is no distinction between programs and specifications at the semantic level. In the words of Hoare:

A computer program is identified with the strongest predicate describing every relevant observation that can be made of the behaviour of a computer executing that program.[2]

In UTP parlance, a theory is a model of a particular programming paradigm. A UTP theory is composed of three ingredients:

Program refinement is an important concept in the UTP. A program P_1 is refined by P_2 if and only if every observation that can be made of P_2 is also an observation of P_1. The definition of refinement is common across UTP theories:

P_1 \sqsubseteq P_2 \quad\text{if and only if}\quad \left[ P_2 \Rightarrow P_1 \right]

where \left[ X \right] denotes[3] the universal closure of all variables in the alphabet.

Relations

The most basic UTP theory is the alphabetised predicate calculus, which has no alphabet restrictions or healthiness conditions. The theory of relations is slightly more specialised, since a relation's alphabet may consist of only:

Some common language constructs can be defined in the theory of relations as follows:

\mathbf{skip} \equiv v' = v

a := E  \equiv  a' = E \land u' = u

P_1 ; P_2  \equiv  \exists v_0 \bullet P_1 [ v_0 / v' ]  \land  P_2 [ v_0 / v ]

P_1 \sqcap P_2  \equiv  P_1 \lor P_2

P_1 \triangleleft C \triangleright P_2  \equiv  ( C \land P_1 ) \lor ( \lnot C \land P_2 )

\mu X \bullet \mathbf{F}(X)  \equiv  \sqcap \left\{ X  \mid  \mathbf{F}(X) \sqsubseteq X \right\}

References

  1. Hoare, C. A. R.; Jifeng, He (April 1, 1998). Unifying Theories of Programming. Prentice Hall College Division. p. 320. ISBN 978-0-13-458761-5. Retrieved 17 September 2014.
  2. C.A.R. Hoare, Programming: Sorcery or science? IEEE Software, 1(2): 5–16, April 1984. ISSN 0740-7459. doi:10.1109/MS.1984.234042.
  3. Edsger W. Dijkstra and Carel S. Scholten. Predicate calculus and program semantics. Texts and Monographs in Computer Science. Springer-Verlag New York, Inc., New York, NY, USA, 1990. ISBN 0-387-96957-8.

Further reading

External links

This article is issued from Wikipedia - version of the Sunday, February 14, 2016. The text is available under the Creative Commons Attribution/Share Alike but additional terms may apply for the media files.