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
9 - Operational semantics of recursion
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 reconcile the definition of the semantics of recursive procedures, cf. Chapter 4, with the relational semantics of Chapter 6. The idea is that the two semantical paradigms meet halfway. Therefore, the chapter consists of two parts.
The first part is based on predicate-transformation semantics, cf. Chapter 4. In Section 9.1, we describe the stack implementation of recursive procedures. This implementation can be regarded as an interpreter: the whole recursive declaration is interpreted by means of a tail-recursive procedure with a stack of continuations as a value parameter. The correctness of the interpreter is proved in Section 9.2.
In the second part of the chapter we treat the relational semantics of recursive procedures. This is done in two steps. In Section 9.3, we define the relational semantics of a tail-recursive declaration by means of a transitive closure in a graph of configurations. By Chapter 6, these relational semantics induce predicate transformers. We then show that the predicate transformers correspond to wp and wlp as defined for such a declaration in Chapter 4. In Section 9.4, the ideas and results of the preceding sections are combined. The stack implementation of 9.1 is combined with the relational semantics of tail recursion (cf. Section 9.3) to define the relational semantics of an arbitrary recursive declaration. The results of 9.2 and 9.3 imply that these relational semantics correspond to the predicate-transformation semantics of Chapter 4.
- Type
- Chapter
- Information
- Programs, Recursion and Unbounded Choice , pp. 130 - 142Publisher: Cambridge University PressPrint publication year: 1992