13.07.2015 Views

Software Design 2e - DIM

Software Design 2e - DIM

Software Design 2e - DIM

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

426A formal approach to design18.2.1 The Z languageMost users would probably classify the Z FDT as being more of a ‘language’ than amethod. Indeed, the process elements are probably less developed than in some comparableformalisms such as VDM. Z was created by J-R Abrial in the ProgrammingResearch Group at the University of Oxford, underwent major development throughthe 1980s, and became established through the 1990s. The text by Spivey (1992) iswidely regarded as being the authoritative definition, but there are now many texts onZ, assuming various levels of mathematical sophistication on the part of the reader.For example, the introductory text by Currie (1999) provides a fairly gentle introduction,without getting into some of the deeper waters of Z.Formalisms rarely constrain design strategy, and Z is no exception. Specificationscan be developed on a top-down (decompositional) or bottom-up (compositional)basis, although the former is probably the easier to employ if the choice is available.The development process begins with the creation of a model of a system using discretemathematical structures (primarily sets), together with predicate logic that is used tospecify the relationships between the structures. Logic is then used to describe preciselyhow the model will be changed for each operation that the system can perform,expressed in terms of what changes should occur, rather than how they should comeabout. This process is repeated to gradually refine the specification until it reachesa level that is suitable for being interpreted through the medium of a programminglanguage.Such a process is fairly typical of the formal methods in general. Iteration of refinementtends to be the dominant strategy, and there is little of the interplay betweenviewpoints that we observed for many of the systematic design methods. Each step hasthe form of an elaboration step; there are no transformations in this type of method.18.2.2 The Z formalismPerhaps one of the greatest inconveniences of using Z is its enthusiastic use of a verywide range of (mathematical) symbols. While presenting no problem when using awhiteboard, it does tend to become something of a strain for the word processor! Weshould note too that while proof is an important element of Z, it is not an essential one,and in this section we will only discuss the role of Z for specification.It is therefore useful to begin by reviewing the basic vocabulary of Z. There arethree elements of this: sets, set operations and logic, each with their own notationalfeatures.SetsA set is a collection of elements (or set members), in which no sense of ordering of elementsis involved. In Z there are some pre-defined set types such as:– the set of all integers; and– the set of all natural numbers (positive integers and zero).In addition, the user may specify their own set types (and, for many problems, is likelyto want to do so of course). The convention is to employ all upper case italic letters for

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!