Term Transformers: A New Approach to State
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 (sic) t, where C stands for a command and t stands for a term of any type. If R is boolean, C (sic) 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.
state predicate transformers theory procedures nondeterminacy design verification nondeterminism refinement calculus