Question
Read the following scenario of BLOCK-HANDLER carefully, and give the answers of questions (i), (ii) and (iii): One of the more important parts of a
Read the following scenario of BLOCK-HANDLER carefully, and give the answers of questions (i), (ii) and (iii): One of the more important parts of a computers operating system are the subsystem that maintains files created by users. Part of the filing subsystem is the block handler. Files in the file store are composed of blocks of storage that are held on a file storage device. During the operation of the computer, files will be created and deleted, requiring the acquisition and release of blocks of storage. In order to cope with this, the filing subsystem will maintain a reservoir of unused (free) blocks and keep track of blocks that are currently in use. When blocks are released from a deleted file they are normally added to a queue of blocks waiting to be added to the reservoir of unused blocks. This is shown in Figure-1. In this figure, a number of components are shown: the reservoir of unused blocks, the blocks that currently make up the files administered by the operating system, and those blocks that are waiting to be added to the reservoir. The waiting blocks are held in a queue, with each element of the queue containing a set of blocks from a deleted file. For this subsystem the state is the collection of free blocks, the collection of used blocks, and the queue of returned blocks. The data invariant, expressed in natural language, is
- No block will be marked as both unused and used.
- All the blocks held in the queue will be subsets of the collection of currently used blocks.
- No elements of the queue will contain the same block numbers.
- The collection of used blocks and blocks that are unused will be the total collection of blocks that make up files.
- The collection of unused blocks will have no duplicate block numbers.
- The collection of used blocks will have no duplicate block numbers.
Some of the operations associated with these data are
- An operation that adds a collection of blocks to the end of the queue.
- An operation that removes a collection of used blocks from the front of the queue and places them in the collection of unused blocks.
- An operation that checks whether the queue of blocks is empty.
The precondition of the second operation is that the queue must have at least one item in it. The postcondition is that the blocks must be added to the collection of unused blocks. The final operation checking whether the queue of returned blocks is empty has no precondition. This means that the operation is always defined, regardless of what value the state has. The postcondition delivers the value true if the queue is empty and false otherwise.
Consider the above mentioned BLOCK HANDLER scenario and answers the following questions:
- Use the Z language notation, Z specification and Schema to model the BLOCK HANDLER.
- Write Z schema that describes the operation that removes an element from the block queue.
- Write Z schema that describes the operation, which adds a collection of blocks to the end of the queue.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started