HOME

TheInfoList



OR:

Unifying Theories of Programming (UTP) in
computer science Computer science is the study of computation, automation, and information. Computer science spans theoretical disciplines (such as algorithms, theory of computation, information theory, and automation) to practical disciplines (includin ...
deals with
program semantics In programming language theory, semantics is the rigorous mathematical study of the meaning of programming languages. Semantics assigns computational meaning to valid strings in a programming language syntax. Semantics describes the processes ...
. It shows how denotational semantics,
operational semantics Operational semantics is a category of formal programming language semantics in which certain desired properties of a program, such as correctness, safety or security, are verified by constructing proofs from logical statements about its execut ...
and algebraic semantics can be combined in a unified framework for the
formal specification In computer science, formal specifications are mathematically based techniques whose purpose are to help with the implementation of systems and software. They are used to describe a system, to analyze its behavior, and to aid in its design by veri ...
, design and implementation of programs and
computer system A computer is a machine that can be programmed to carry out sequences of arithmetic or logical operations ( computation) automatically. Modern digital electronic computers can perform generic sets of operations known as programs. These prog ...
s. The book of this title by
C.A.R. Hoare Sir Charles Antony Richard Hoare (Tony Hoare or C. A. R. Hoare) (born 11 January 1934) is a British computer scientist who has made foundational contributions to programming languages, algorithms, operating systems, formal verification, and c ...
and He Jifeng was published in the
Prentice Hall International Series in Computer Science Prentice Hall International Series in Computer Science was a series of books on computer science published by Prentice Hall. The series' founding editor was Tony Hoare. Richard Bird subsequently took over editing the series. Many of the books in t ...
in 1998 and is now freely available on the web.


Theories

The semantic foundation of the UTP is the
first-order predicate calculus First-order logic—also known as predicate logic, quantificational logic, and first-order predicate calculus—is a collection of formal systems used in mathematics, philosophy, linguistics, and computer science. First-order logic uses quantif ...
, 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.
In UTP parlance, a ''theory'' is a model of a particular programming paradigm. A UTP theory is composed of three ingredients: * an ''alphabet'', which is a set of variable names denoting the attributes of the paradigm that can be observed by an external entity; * a ''signature'', which is the set of programming language constructs intrinsic to the paradigm; and * a collection of ''healthiness conditions'', which define the space of programs that fit within the paradigm. These healthiness conditions are typically expressed as
monotonic In mathematics, a monotonic function (or monotone function) is a function between ordered sets that preserves or reverses the given order. This concept first arose in calculus, and was later generalized to the more abstract setting of ord ...
idempotent Idempotence (, ) is the property of certain operations in mathematics and computer science whereby they can be applied multiple times without changing the result beyond the initial application. The concept of idempotence arises in a number of pl ...
predicate transformers.
Program refinement Refinement is a generic term of computer science that encompasses various approaches for producing correct computer programs and simplifying existing programs to enable their formal verification. Program refinement In formal methods, program re ...
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\quad \left P_2 \Rightarrow P_1 \right/math> where \left X \right/math> denotes 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: * undecorated variables (v), modelling an observation of the program at the start of its execution; and * primed variables (v'), modelling an observation of the program at a later stage of its execution. Some common language constructs can be defined in the theory of relations as follows: * The skip statement, which does not alter the program state in any way, is modelled as the relational identity: \mathbf \equiv v' = v * The assignment of value E to a variable a is modelled as setting a' to E and keeping all other variables (denoted by u) constant: a := E \equiv a' = E \land u' = u * The sequential composition of two programs is just relational composition of intermediate state: P_1 ; P_2 \equiv \exists v_0 \bullet P_1 v_0 / v' \land P_2 v_0 / v /math> * Non-deterministic choice between programs is their greatest lower bound: P_1 \sqcap P_2 \equiv P_1 \lor P_2 * Conditional choice between programs is written using infix notation: P_1 \triangleleft C \triangleright P_2 \equiv ( C \land P_1 ) \lor ( \lnot C \land P_2 ) * A semantics for
recursion Recursion (adjective: ''recursive'') occurs when a thing is defined in terms of itself or of its type. Recursion is used in a variety of disciplines ranging from linguistics to logic. The most common application of recursion is in mathematic ...
is given by the
least fixed point In order theory, a branch of mathematics, the least fixed point (lfp or LFP, sometimes also smallest fixed point) of a function from a partially ordered set to itself is the fixed point which is less than each other fixed point, according to the ...
\mu \mathbf of a monotonic predicate transformer \mathbf: \mu X \bullet \mathbf(X) \equiv \sqcap \left\


References


Further reading

* *{{cite book , first1=Ana , last1=Cavalcanti , first2=Jim , last2=Woodcock , volume=3167 , series=Lecture Notes in Computer Science , chapter=A tutorial introduction to CSP in Unifying Theories of Programming , chapter-url=https://www.cs.york.ac.uk/ftpdir/pub/leo/utp/tutorials/utp-tutorial-CSP.pdf , title=Refinement Techniques in Software Engineering , publisher=Springer , date=2006 , isbn= 978-3-540-46253-8, pages=220–268 , doi=10.1007/11889229_6


External links


UTP book website

UTP book
on
Archive.org The Internet Archive is an American digital library with the stated mission of "universal access to all knowledge". It provides free public access to collections of digitized materials, including websites, software applications/games, music ...
1998 non-fiction books Computer science books Formal methods publications Programming language semantics Prentice Hall books