Unformatted text preview: Homework 1 of CS 3211, 2010, Total 5 marks Please submit in the IVLE workbin by Wed 17 Feb 2010 before 11:59 PM. Kindly note that there will be no extensions. If you are not finished by the deadline, please submit whatever partial answer you may have ‐ this is better than not submitting at all. Only submissions in the IVLE Workbin will be graded. Submissions sent by e‐mail, unfortunately, cannot be considered. Upload one single Word or pdf file containing both the answers. If your tutor is Seth, upload your file to the folder HW1‐Seth If your tutor is Dawei, upload your file to the folder HW1‐Dawei If your tutor is Abhik, upload your file to the folder HW1‐Abhik Question 1. A sensor measures the water level of a tank. The level is measured as a value in the range 0…9 (the initial level is 5). If the level is less than 2, the sensor outputs a low signal. If the level is greater than 8, the sensor outputs a high signal. In all other situations, the sensor outputs a normal signal. Model the sensor as a single process in Promela. Conceptually, you could think of the sensor to be communicating with the physical environment regarding the water level information. However, in this question, you do not need to model the physical environment itself – modeling the sensor process is sufficient for answering this question. [2 marks] Question 2. A drinks machine charges 15 cents for a can of Ribena. The machine accepts coins of denomination 5 cents, 10 cents, 20 cents and gives changes. While purchasing a drink, a user gives the least possible value greater than or equal to 15 cents based on the coins available. You can assume that the machine only gives out one Ribena can at a time, after the user makes payment. Also, if the user’s payment is not sufficient, the machine keeps on waiting for the remaining payment. Model the machine as a process called MACHINE in Promela. In addition, model a separate process called USER which captures all possible behaviors a human user of the drinks machine can demonstrate. The overall system description should be a concurrent composition of the MACHINE process and the USER process. [3 marks] ...
View Full Document
- Spring '11
- water level, IVLE Workbin, Dawei, PM. Kindly note, drinks machine charges