fbpx
Wikipedia

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:

  • 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 idempotent predicate transformers.

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

 

where   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:

  • undecorated variables ( ), modelling an observation of the program at the start of its execution; and
  • primed variables ( ), 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:

 

  • The assignment of value   to a variable   is modelled as setting   to   and keeping all other variables (denoted by  ) constant:

 

 

  • Non-deterministic choice between programs is their greatest lower bound:

 

 

  • A semantics for recursion is given by the least fixed point   of a monotonic predicate transformer  :

 

References

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

Further reading

  • Woodcock, Jim; Cavalcanti, Ana (2004). "A tutorial introduction to designs in Unifying Theories of Programming" (PDF). Integrated Formal Methods. Lecture Notes in Computer Science, pages. Vol. 2999. Springer. pp. 40–66. doi:10.1007/978-3-540-24756-2_4. ISBN 978-3-540-21377-2.
  • Cavalcanti, Ana; Woodcock, Jim (2006). "A tutorial introduction to CSP in Unifying Theories of Programming" (PDF). Refinement Techniques in Software Engineering. Lecture Notes in Computer Science. Vol. 3167. Springer. pp. 220–268. doi:10.1007/11889229_6. ISBN 978-3-540-46253-8.

External links

unifying, theories, programming, computer, science, deals, with, program, semantics, shows, denotational, semantics, operational, semantics, algebraic, semantics, combined, unified, framework, formal, specification, design, implementation, programs, computer, . 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 Contents 1 Theories 2 Relations 3 References 4 Further reading 5 External linksTheories EditThe 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 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 idempotent predicate transformers Program refinement is an important concept in the UTP A program P 1 displaystyle P 1 is refined by P 2 displaystyle P 2 if and only if every observation that can be made of P 2 displaystyle P 2 is also an observation of P 1 displaystyle P 1 The definition of refinement is common across UTP theories P 1 P 2 if and only if P 2 P 1 displaystyle P 1 sqsubseteq P 2 quad text if and only if quad left P 2 Rightarrow P 1 right where X displaystyle left X right denotes 3 the universal closure of all variables in the alphabet Relations EditThe 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 displaystyle v modelling an observation of the program at the start of its execution and primed variables v displaystyle 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 s k i p v v displaystyle mathbf skip equiv v v The assignment of value E displaystyle E to a variable a displaystyle a is modelled as setting a displaystyle a to E displaystyle E and keeping all other variables denoted by u displaystyle u constant a E a E u u displaystyle 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 v 0 P 1 v 0 v P 2 v 0 v displaystyle P 1 P 2 equiv exists v 0 bullet P 1 v 0 v land P 2 v 0 v Non deterministic choice between programs is their greatest lower bound P 1 P 2 P 1 P 2 displaystyle P 1 sqcap P 2 equiv P 1 lor P 2 Conditional choice between programs is written using infix notation P 1 C P 2 C P 1 C P 2 displaystyle P 1 triangleleft C triangleright P 2 equiv C land P 1 lor lnot C land P 2 A semantics for recursion is given by the least fixed point m F displaystyle mu mathbf F of a monotonic predicate transformer F displaystyle mathbf F m X F X X F X X displaystyle mu X bullet mathbf F X equiv sqcap left X mid mathbf F X sqsubseteq X right References Edit Hoare C A R Jifeng He April 1 1998 Unifying Theories of Programming Prentice Hall p 320 ISBN 978 0 13 458761 5 Retrieved 17 September 2014 Hoare C A R April 1984 Programming Sorcery or science IEEE Software 1 2 5 16 doi 10 1109 MS 1984 234042 S2CID 375578 Dijkstra Edsger W Scholten Carel S 1990 Predicate calculus and program semantics Texts and Monographs in Computer Science Springer ISBN 0 387 96957 8 Further reading EditWoodcock Jim Cavalcanti Ana 2004 A tutorial introduction to designs in Unifying Theories of Programming PDF Integrated Formal Methods Lecture Notes in Computer Science pages Vol 2999 Springer pp 40 66 doi 10 1007 978 3 540 24756 2 4 ISBN 978 3 540 21377 2 Cavalcanti Ana Woodcock Jim 2006 A tutorial introduction to CSP in Unifying Theories of Programming PDF Refinement Techniques in Software Engineering Lecture Notes in Computer Science Vol 3167 Springer pp 220 268 doi 10 1007 11889229 6 ISBN 978 3 540 46253 8 External links EditUTP book website UTP book on Archive org Retrieved from https en wikipedia org w index php title Unifying Theories of Programming amp oldid 1126267834, wikipedia, wiki, book, books, library,

article

, read, download, free, free download, mp3, video, mp4, 3gp, jpg, jpeg, gif, png, picture, music, song, movie, book, game, games.