# The Z Notation Manual Reference

Topics: Table of mathematical symbols, Ion, Mathematical notation Pages: 161 (38159 words) Published: April 9, 2011
The Z Notation:
A Reference Manual
Second Edition

J. M. Spivey
Programming Research Group University of Oxford

Based on the work of J. R. Abrial, I. J. Hayes, C. A. R. Hoare, He Jifeng, C. C. Morgan, J. W. Sanders, I. H. Sørensen, J. M. Spivey, B. A. Sufrin

This edition ﬁrst published 1992 by Prentice Hall International (UK) Ltd Published 1998 by J. M. Spivey Oriel College, Oxford, OX1 4EW, England c J. M. Spivey, 1989, 1992 All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form. or by any means, electronic, mechanical, photocopying, recording or otherwise, without prior permission, in writing, from the publisher. For permission in all countries contact the author.

Contents

Preface 1 Tutorial Introduction What is a formal speciﬁcation? 1.1 1.2 The birthday book 1.3 Strengthening the speciﬁcation 1.4 From speciﬁcations to designs Implementing the birthday book 1.5 1.6 A simple checkpointing scheme Background 2.1 Objects and types 2.1.1 Sets and set types 2.1.2 Tuples and Cartesian product types 2.1.3 Bindings and schema types 2.1.4 Relations and functions 2.2 Properties and schemas 2.2.1 Combining properties 2.2.2 Decorations and renaming 2.2.3 Combining schemas 2.3 Variables and scope 2.3.1 Nested scopes 2.3.2 Schemas with global variables 2.4 Generic constructions 2.5 Partially-deﬁned expressions The Z Language 3.1 Syntactic conventions 3.1.1 Words, decorations and identiﬁers 3.1.2 Operator symbols 3.1.3 Layout 3.2 Speciﬁcations 3.2.1 Basic type deﬁnitions

vii 1 1 3 7 10 11 17 24 24 25 25 26 27 28 29 30 31 34 35 36 38 40 42 42 43 43 46 47 47

2

3

v

vi

Contents
3.2.2 Axiomatic descriptions 3.2.3 Constraints 3.2.4 Schema deﬁnitions 3.2.5 Abbreviation deﬁnitions Schema references Declarations 3.4.1 Characteristic tuples Schema texts Expressions Predicates Schema expressions Generics 3.9.1 Generic schemas 3.9.2 Generic constants Free types 3.10.1 Example: binary trees 3.10.2 Consistency 48 48 49 50 50 51 52 53 54 67 74 79 79 80 82 83 84 86 89 95 105 108 115 124 128 128 131 133 134 135 137 140 142 147 149 153 154

3.3 3.4 3.5 3.6 3.7 3.8 3.9

3.10

4

The Mathematical Tool-kit 4.1 Sets 4.2 Relations 4.3 Functions 4.4 Numbers and ﬁniteness 4.5 Sequences 4.6 Bags Sequential Systems 5.1 States and operations 5.2 The ∆ and Ξ conventions 5.3 Loose speciﬁcations 5.4 Sequential composition and piping 5.5 Operation reﬁnement 5.6 Data reﬁnement 5.7 Functional data reﬁnement Syntax Summary Changes from the ﬁrst edition Glossary Index of symbols General index

5

6

Preface

Jack: You’re quite perfect, Miss Fairfax. Gwendolen: Oh! I hope I am not that. It would leave no room for developments, and I intend to develop in many directions. Oscar Wilde, The Importance of Being Earnest

The Z notation for specifying and designing software has evolved over the best part of a decade, and it is now possible to identify a standard set of notations which, although simple, capture the essential features of the method. This is the aim of the reference manual in front of you, and it is written with the everyday needs of readers and writers of Z speciﬁcations in mind. It is not a tutorial, for a concise statement of general rules is often given rather than a presentation of illustrative examples; nor is it a formal deﬁnition of the notation, for an informal but rigorous style of presentation will be more accessible to Z users, who may not be familiar with the special techniques of formal language deﬁnition. It is perhaps worth recording here the causes which led to even this modest step towards standardization of Z. The ﬁrst of these is the growing trend towards computer assistance in the writing and manipulation of Z speciﬁcations. While the speciﬁer’s tools amounted to little more than word-processing facilities, they had enough inherent ﬂexibility to make small diﬀerences in notation unimportant. But tools are now being...

Please join StudyMode to read the full document