Term transformers: A new approach to state

  • Authors:
  • Joseph M. Morris;Alexander Bunkenburg;Malcolm Tyrrell

  • Affiliations:
  • Dublin City University and Lero - the Irish Engineering Research Centre, Dublin, Ireland;University of Glasgow, Glasgow, UK;Dublin City University and Lero - the Irish Engineering Research Centre, Dublin, Ireland

  • Venue:
  • ACM Transactions on Programming Languages and Systems (TOPLAS)
  • Year:
  • 2009

Quantified Score

Hi-index 0.01

Visualization

Abstract

We present a new approach to adding state and state-changing commands to a term language. As a formal semantics it can be seen as a generalization of predicate transformer semantics, but beyond that it brings additional opportunities for specifying and verifying programs. It is based on a construct called a phrase, which is a term of the form C ▹ t, where C stands for a command and t stands for a term of any type. If R is boolean, C ▹ R is closely related to the weakest precondition wp(C,R). The new theory draws together functional and imperative programming in a simple way. In particular, imperative procedures and functions are seen to be governed by the same laws as classical functions. We get new techniques for reasoning about programs, including the ability to dispense with logical variables and their attendant complexities. The theory covers both programming and specification languages, and supports unbounded demonic and angelic nondeterminacy in both commands and terms.