












Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
This lecture was delivered by Sharman Munjha Jadeja at Birla Institute of Technology and Science for Formal Specification Methods in Software Development course. It includes: Definitions, Introduction, Z, Notation, Declaration, Guest, Room, Abbreviations, English, Scots
Typology: Slides
1 / 20
This page cannot be seen from the preview
Don't miss anything!













significant amount of prose
objects to features of the design: system states, data structures, properties, and operations.
mathematics are to be meaningful, then we must ensure that the objects concerned are properly defined.
x : A introduces a new variable x, from the set A. If this set is not Z, the type of integers, then it must be defined elsewhere
Example 6.1 : A hotel switchboard uses a software package to maintain a record of call charges to current guests. A formal specification of this system may be [Guest, Room] introduces two basic types to represent set of all guests and set of all rooms.
Example 6.2 The abbreviation definition
Additive == { red, green, blue} introduces a set Additive, as another name for the set described in enumeration above
defined elsewhere,
Additive is a constant of type ๏ Colours.
Example 6.4 :
Let Person, represents the set of all people, we introduce abbreviations for the set of all people who take sugar in tea:
English == {p : Person | p drinks tea ๏ p takes sugar}
And those who put salt on their porridge:
Scots == {q : Person | q eats porridge ๏ q adds salt}
๏[S] == { x : S | false } == { x : S | false ๏ท x}
Example 6.5 : For any set T, we may define the set of all non-empty subsets of T as: ๏ 1 T == { a : ๏ T | a ๏น ๏}
declaration x : S predicate p
where the predicate expresses the constraints upon the object or objects introduced in the declaration.
Example 6.8 We may use an axiomatic definition to define set of natural numbers
๏ : ๏ ๏
๏ข z : ๏ ๏ท z ๏ ๏ ๏ z ๏ณ 0
Example 6.9 We may define constant maxsize as follows:
maxsize : ๏
maxsize ๏พ o
Example 6.12 : The generic non-empty power set constructor defined using an abbreviation in Example 6.5 may also be defined using a generic definition:
[X] ๏ 1 : ๏(๏ X) ๏ 1 = { s : ๏ X | s ๏น ๏ }
Brackets around generic parameter are optional: the forms ๏ 1 [s] and ๏ 1 s are equally acceptable.
Example 6.13: We can use a generic
definition to define the subset symbol:
[X] _ ๏ _ : ๏ X ๏ซ ๏ X
๏ข s, t : ๏ X ๏ท s ๏ t ๏ ๏ข x : X ๏ท x ๏ s ๏ x ๏ t
Example 6.15 We wish to formalize the predicate โis a crowdโ upon sets of people. Where crowd is defined as the number of people more than 3. To do this, we introduce a set of sets
Formalization:
Example 6.16 For a number of reasons, it is not a good idea to have Alice and Bill in the room at the same time. Thus, a set of people is safe if it contains Alice, or Bill, or neither, but not both. We may define safe as a property of sets of people
Formalization:
safe _ : ๏ (๏ Person)
๏ข s : ๏ Person ๏ท safe s ๏ ๏ก ({Alice, Bill} ๏ s)