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
2 - Specifications I
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
The nature of a specification
The task of solving a problem using a computer can be reduced to the outline
given THIS,
produce THAT
or expanding, a little,
given some DATA,
produce some RESULTS
which are the proper results for that data.
The results are either the ‘proper’ results for that data, or they are not. A specification can be viewed as a test that has been devised to check for ‘proper’ results. It does not need to show HOW the results are to be obtained although it may. Thus the task of solving a problem using a computer may be regarded in general as
given d,
produce r
such that S(d,r) is True
where S(d,r) is a test (or predicate) which, given the data d and the results r produced from it, delivers the answer True or False, i.e. the results are acceptable (or not) for that data.
Example
Let d be 169,
let r be 13
and suppose Sl(d,r) IS_DEFINED_TO_BEd=r⋆r.
(As is conventional in computing we are using ‘⋆’ to mean multiply. IS_DEFINED_TO_BE is an example of our use of a word or a phrase where a mathematical symbol would have been more concise. However we do not want unfamiliarity with symbols to prevent easy reading at this stage so we obtain clarity at the expense of brevity. The words in the phrases are always joined by underline and should be regarded as a single unit. In later chapters we will introduce the more concise notation.)
- Type
- Chapter
- Information
- Program Construction , pp. 11 - 38Publisher: Cambridge University PressPrint publication year: 1987