FMM8&10S
Second Exam (continued)
January 2020
OTT SSS)Cw (0) 9 it en
[17 points]
Consider a complex system with a multitude of processes. Inside the system there is a closed
group where processes which have joined the group can share messages from the outside
world. All processes part of the system form the procs set. Processes which have joined the
group are part of the joined set, while processes which have not joined yet or have left are
part of the left set.
(a) Assuming a type Process for processes, define the CompS schema representing the com-
[2]
plex system.
(b) Define the schema of the initSys operation that initialises the complex system.
[2]
(c) Define the schema of the join operation that adds a process p to the group.
[3]
(d) Define the schema of the leave operation that removes a process p from the group.
[3]
(e) Define the schema of the create operation that adds a process p to the complex system.
[2]
(f) Define the schema of the query operation that checks if a process p is part of the group.
[5]
In case the process has not been created yet, the query operation has to indicate so.
QUESTION 2 Lo ccc ceo e cece eee bee een een ee ee been eteeaneenes [25 points]
We introduce Danz an abstract data store with a finite number of values (of type V). The state
of a Danz object includes:
contents: a sequence of values;
size: the number of values currently in the sequence;
max_size: the contents capacity.
We introduce three (03) operations to manipulate Danz:
initialise to initialise the data store;
insert to insert new values into the contents of the data store;
fetch to retrieve data from the contents of the data store.
Note that after instantiation the capacity of the data store cannot change.
(a) Using the schema notation of the Z specification formalism, propose a specification for
[3]
Danz
(b) Specify all three operations defined for Danz
[8]
(c) In order to provide the user with a proper notification, we introduce a free type, Out-
[3]
Come, which has three values: op_ok, contents_full and contents_empty. Using the
new type we can return op_ok when an operation is successful. We can also notify the
user with one of the other values in case an insert or a fetch operation fails. Define the
free type and using a schema specify the successful notification.
(d) Define the error handling versions of insert and fetch
[8]
(e) Define the preconditions for initialise, insert and fetch
[3]
Page 1 of 2
Please turn over to the next page...