Book contents
- Frontmatter
- Contents
- Preface
- List of symbols
- 0 Introduction
- 1 Weakest preconditions
- 2 Annotation, recursion and repetition
- 3 Healthiness laws
- 4 Semantics of recursion
- 5 Ramifications
- 6 Relational semantics
- 7 Determinacy and disjunctivity
- 8 Syntactic criteria
- 9 Operational semantics of recursion
- 10 Procedure substitutions
- 11 Induction and semantic equality
- 12 Induction and refinement
- 13 The strong preorder
- 14 Temporal operators
- 15 Predicative fairness
- 16 Solutions of exercises
- References
- Index of concepts and identifiers
6 - Relational semantics
Published online by Cambridge University Press: 11 March 2010
- Frontmatter
- Contents
- Preface
- List of symbols
- 0 Introduction
- 1 Weakest preconditions
- 2 Annotation, recursion and repetition
- 3 Healthiness laws
- 4 Semantics of recursion
- 5 Ramifications
- 6 Relational semantics
- 7 Determinacy and disjunctivity
- 8 Syntactic criteria
- 9 Operational semantics of recursion
- 10 Procedure substitutions
- 11 Induction and semantic equality
- 12 Induction and refinement
- 13 The strong preorder
- 14 Temporal operators
- 15 Predicative fairness
- 16 Solutions of exercises
- References
- Index of concepts and identifiers
Summary
In this chapter, we start again from scratch. Now the meaning of a command is not defined by means of the functions wp and wlp, but by means of the input–output relation of a command. This point of view is closer to the intuitive ideas of most programmers, but —in our view— it is less adequate for program development.
The relational point of view is useful for the analysis of special properties of commands such as totality, termination and determinacy. It provides easy definitions or characterizations of composition, nondeterminate choice, guards and assertions. All these concepts can therefore be treated in this chapter.
When the relational point of view is used in the analysis of repetitions or recursive procedures, one needs to consider finite and infinite sequences of states, usually accompanied by many case distinctions. Such operational reasoning can be useful or necessary, but it is preferable to avoid it whenever possible. We introduce some of the necessary techniques in Chapter 9. It is used only in Chapters 14 and 15.
Although we use the definitions of Section 1.1 and some other concepts introduced in Chapters 1 and 3, this chapter is largely independent of the previous chapters. In fact, it can be read to support them.
In Section 6.1, we introduce (input–output) relations and their weakest preconditions, and we show that relations when interpreted as commands satisfy the healthiness laws introduced in Section 3.2. In Section 6.2, we give the relational interpretation of guards, sequential composition and nondeterminate choice.
- Type
- Chapter
- Information
- Programs, Recursion and Unbounded Choice , pp. 101 - 108Publisher: Cambridge University PressPrint publication year: 1992