Refinement and Demonic Semantics

In Chapter 8, it was shown how functional programs can be regarded as elements of a relation algebra. In this chapter, we consider imperative programs, which we view as computing an input-output relation on a set of states. We are interested here in programs that are meant to terminate, not in reactive programs. Our programming language is Dijkstra’s language of guarded commands [Dijkstra 1976], which allows the expression of nondeterminism, thus making a relational approach very natural.