Assignment 4 - FM
Assignment 4 - FM
jT \MA
•
x
Discovering Knowledge
4
-
V
ASSIGNMENT 4 [CLO 3]
TOPICS:
Z Specification
INSTRUCTIONS:
Max Number of Students in a Group: 2
Deadline: 30 December,2019
Marks will be deducted for late submission
QUESTION # 1
Design a simple document control system in Z. People who work together need to
share their work, but there are many opportunities for misunderstandings and
confusion.
Errors can be introduced when two people working on the same thing a file of
program code, for example make changes that conflict with each other. We can enlist
the computer to help prevent such errors: this is the purpose of a document control
system.
If a user wants to check out a document in order to change the document and
the user has the permission to change it, and nobody else is changing it at the
moment, then that user may check the document out.
As soon as a user has checked out a document for editing everyone else is
disallowed from checking it out (of course people with read permission can
read it).
When the user is done editing the document, it should be checked in, allowing
another user to check it out.
Introduce two basic sets that hold everything of interest in this universe, namely
people and documents: [PERSON, DOCUMENT]
QUESTION # 2
Design a library system in Z. Consider a small library database with the following
transactions:
Staff Users
Ordinary Borrower
Transactions 1, 2, 4 & 5 are restricted to staff users, except that ordinary borrowers
can perform transaction 4 to find out the list of books currently borrowed by
themselves. The database must also satisfy the following constraints:
1. All copies in the library must be available for check-out or be checked out.
2. No copy of a book may be both available & checked out at the same time.
3. A borrower may not have more than a predefined number of books checked
out at one time.
Subject: Subject is the type of all conceivable subjects, that is to say, the things
that books can be about.
IMPORTANT:
The type Author & Person are distinguished because some books are considered to
have been written by institutions. Some manuals & standards fall in this category.
MESSAGES
We also need a set of all necessary messages. It is defined by the enumeration like this
(few examples are included as sample):
Report::=’Okay’
| ‘Unauthorized requestor’
| ‘Not registered’