thesis

Linking programs and specifications in Z

Abstract

This thesis uses the Z specification language notation to discuss the relationship between programs and specifications. We give a brief introduction to formal semantics, and the Z specification language. We provide an adaptation of the Z schema calculus which is based on predicates rather than propositions: this is constructed from the standard calculus and is thus intended as an enhancement rather than a replacement. We discuss the process of refining a specification towards a program as an exposition of the relationship between the Z language (in particular) and standard programming languages. We formulate the standard refinement proof obligations in our calculus, and briefly examine some applications. The focal point of the thesis is the provision of the semantics for a small language in Z. We believe our approach to be unique, in that we have not only described the semantic mapping functions using Z, but we are also taking Z to be our semantic domain; that is, our semantics will map a program into a corresponding Z specification. We assert the usefulness of such a specification as a basis for the analysis of the program. The semantics are analyzed in detail, and further work is done towards the unification of various aspects of program analysis under the Z notation, and in particular, under our predicate version of the schema calculus; the use of this notation and calculus to explore the link between programs and specifications is a dominant theme throughout the thesis. Using the same structures to describe programs and specifications is becoming increasingly common; in the light of this we claim that constructing a link between one and the other should not be considered solely in directional terms; the techniques in moving from the former to the latter are likely to be just as useful when moving in the opposite "direction". We present a number of small examples to illustrate the above concepts

    Similar works