Homework IV

 

 

1. [35 points]

For this problem the telephone database specification in chapter 4 of Diller is to be revised. The telephone database is to be modified to contain two categories of phones -- cell phones and land lines. This should be reflected in the following changes to the operations:

·  the DoAddEntry (and AddEntry) operation is to be replaced by two operations -- DoAddCell and DoAddLand whose behaviors are analogous to that of the original operation, but additionally determine the type of the added phone.

·  the DoFindPhone operation should be modified to return two sets of phones, one containing the cell numbers and the other containing the land numbers

Finally, there should be an additional schema to count the Phones in current operation (i.e., listed in the directory). This schema, let’s call it CountPhones, should have two output variables, say cellCount! and landCount!, whose exit values provide the number of different Phone values appearing in their respective categories in the telephones relation.

 

Provide suitable Z schema definitions (state and operation) for these operations and their exceptional outcomes, including changes (if any) needed in other of Diller’s schemas.

 

 

2. [35 points]

For this problem you should modify the Miranda animation of the telephone database in the class directory to reflect the specification changes you develop in problem 1. Your submission for this problem should include:

·  description and discussion of your code changes and their relation to your specification

·  a printout of a script (see 'man script' in Linux) illustrating the correct behavior of the new operations, plus convincing evidence of the absence of damage to the other operations

·  electronic submission of a copy of your Miranda source code to the directory Hwk4 (for course c181)