Final Exam 431, Spring 2002 • Exam Final Exam 431, Spring 2002 1. 2. 3. Write an LGI law for regulating the interactions between components in the parking-lot system, ignoring (for simplicity) (a) registartion messeges (b) ping and pong messages (c) messages between gates, and (d) messages between the traffic and the gates. The objectives of your law should be: 1. To ensure that the capacity C of the parking lot is never exceeded. 2. To allow the monitor to take from any gate some of its tokens, and to redistribute these tokens to other gates, if it so chooses. 3. To ensure that a gate that does not enter any cars to the parking lot for a specified time interval t, will give all its tokens to the monitor. Notes: 1. You can modify the current API for this project, if necessary. In particular by adding certain messages; specify any such modification 2. Let the role of each component be represented by a term “role (R )” in its control-state, where R is either “gate” or “monitor” or “lot”. 3. Let the number of tokens possessed by a component (gate, or monitor) be represented by a term “tokens(T)” in its control-state, where T represents the number of tokens. 4. Let the address x of a gate named "g" be represented by a term "gate(g,x)" in the control-state of other components; such as other gates, the monitor or the lot. Similarly, the addresses of the monitor and the lot are to be represented by the terms “monitor(x)” and “lot(x)” 5. You can make any assumptions you want about the initial control state of the various components, before they start to operate. (Such assumptions about the initial control-states , are meant to remove the need for set-up, like registration). Requirements: write your law using the LGI notation, and explain clearly how the three objectives specified in point 1 above are met by your law. GOOD LUCK