Question: 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

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. Unused blocks 1 34 69 Used blocks 2 5 7 8 10 11 12 Blocks are released to queue when files are deleted Queued for entry into unused blocks 5 8 11 7 Question Number 3.14+4): a) Read the following scenario of BLOCK-HANDLER carefully, and give the answers of questions (1). (11) and (iii): One of the more important parts of a computer's 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. File #1 File #2 File #3 Block queue containing blocks from deleted files Consider the above mentioned BLOCK HANDLER scenario and answers the following questions: 1) Use the Z language notation, Z specification and Schema to model the BLOCK HANDLER ii) Write Z schema that describes the operation that removes an element from the block queue. 111) Write Z schema that describes the operation, which adds a collection of blocks to the end of the queue. b) You have to construct a telephone directory system for an organization to maintain a record of employees and their telephone numbers. Use Z-Specification language to formally specify the following functional requirements of a telephone directory system. 1) System must be able to add new employee and/or new entries ii) System must be able to remove employee and/or existing entries 111) System must be able to query the system for employee or number iv) An employee may have one or more telephone numbers v) Some employee may not have a telephone number yet 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. Unused blocks 1 34 69 Used blocks 2 5 7 8 10 11 12 Blocks are released to queue when files are deleted Queued for entry into unused blocks 5 8 11 7 Question Number 3.14+4): a) Read the following scenario of BLOCK-HANDLER carefully, and give the answers of questions (1). (11) and (iii): One of the more important parts of a computer's 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. File #1 File #2 File #3 Block queue containing blocks from deleted files Consider the above mentioned BLOCK HANDLER scenario and answers the following questions: 1) Use the Z language notation, Z specification and Schema to model the BLOCK HANDLER ii) Write Z schema that describes the operation that removes an element from the block queue. 111) Write Z schema that describes the operation, which adds a collection of blocks to the end of the queue. b) You have to construct a telephone directory system for an organization to maintain a record of employees and their telephone numbers. Use Z-Specification language to formally specify the following functional requirements of a telephone directory system. 1) System must be able to add new employee and/or new entries ii) System must be able to remove employee and/or existing entries 111) System must be able to query the system for employee or number iv) An employee may have one or more telephone numbers v) Some employee may not have a telephone number yet 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
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
