You are on page 1of 1

SOEN 6481 Software Systems Requirements Specification (Winter 2015/16)

Worksheet #5: Z
Z is a well-known and (relatively) easy to learn formal specification language. In this exercise, you will
develop some simple Z schemas to formally specify a birthday book application (i.e., a database holding
names together with their birthdays). For reference, here are the schemas already developed during the lecture:

[NAME , DATE ] AddBirthday


BirthdayBook
BirthdayBook name? : NAME
known : PNAME date? : DATE
birthday : NAME
7 DATE
name? 6 known
known = dom birthday birthday 0 = birthday {name? 7 date?}

Exercise 1: Writing an Operation Schema. Write the Z specification for RemoveBirthday; the input
variable is the name to be removed:
RemoveBirthday

Exercise 2: Schema Combination. To add error handling, you have to combine some existing schemas to
a new robust schema: RFindBirthday = (FindBirthday Success) NotKnown:

Success
result! : REPORT

FindBirthday result! = ok
BirthdayBook
name? : NAME
date! : DATE NotKnown
BirthdayBook
name? known name? : NAME
date! = birthday(name?) result! : REPORT
name? 6 known
result! = not known

RFindBirthday

You might also like