Book contents
- Frontmatter
- Contents
- Preface
- 1 A modern approach to computing
- 2 Specifications I
- 3 Diagrams
- 4 Specifications II
- 5 PDL
- 6 Code generation
- 7 Verification
- 8 Examination of templates and target code
- 9 Abstract data types
- 10 The mathematical basis of abstract data types
- 11 Utilisation of existing programs
- 12 A small scale study – topological sorting
- Appendices
- References
- Index
10 - The mathematical basis of abstract data types
Published online by Cambridge University Press: 05 June 2012
- Frontmatter
- Contents
- Preface
- 1 A modern approach to computing
- 2 Specifications I
- 3 Diagrams
- 4 Specifications II
- 5 PDL
- 6 Code generation
- 7 Verification
- 8 Examination of templates and target code
- 9 Abstract data types
- 10 The mathematical basis of abstract data types
- 11 Utilisation of existing programs
- 12 A small scale study – topological sorting
- Appendices
- References
- Index
Summary
In Chapter 7 we discussed the desired logical relationships between segments of program and their specifications. In that discussion it was sufficient to take for granted all the common properties of integers, etc., and to concentrate on the more important (deductive) issues. However, in order to make our arguments mathematically sound we must explain how these ‘facts’ are introduced into a programming system. The method, outlined below, not only gives a foundation for the mathematical manipulations that are central to our methodology, but also provides a set of requirements against which implementations can be checked, and can also be applied to (abstract) data types which may not be native to the target computer system.
We begin, in Section 10.1, with a look at probably the most fundamental data type, Boolean. Objects and expressions of type Boolean are required in one form or another in all programming languages to control the flow of a computation. They are also used to manipulate tests associated with other, more explicitly data-related, types and since the type has only two data values we can defer consideration of problems associated with large, potentially infinite, sets of data values.
Next, in Section 10.2, we look at lists. Constructing a list-of-something is one of the more familiar ways of building a new type from an existing one. Although a set of lists may be infinite, lists provide a vehicle for the introduction of more facilities of our definition system before going on to discussing problems associated with numeric types in Section 10.3.
- Type
- Chapter
- Information
- Program Construction , pp. 262 - 288Publisher: Cambridge University PressPrint publication year: 1987