Rodin HandbookThis work is sponsored by the Deploy Project This work is licensed under a Creative Commons Attribution 3.0 Unported License |
2.9.1 The Celebrity ProblemIn this section, we will work on the model of the so-called celebrity problem. We use a new model instead of the traffic light because it provides us with some proofs where manual interaction is necessary. In the setting for this problem, we have a “knows” relation between persons. This relation is defined so that
The problem’s goal is to find the celebrity. We want to model an algorithm fulfills this task.
Import the archive file Celebrity.zip to you Event-B Explorer. To do this, select File Rodin takes a few seconds to extract and load all the files. Once it is done, it shows that there are a few problems with this project as you can see in the Rodin Problems View (compare with figure 2.16).
Figure 2.16: Warnings in the Rodin Problems View We will describe how the model is organized below in 2.9.3. In the first part of this section, our goal is to fix these problems. Let’s take a look at the warning stating that the event label “celebrity” is misused (“Inconsistent use of event label celebrity”). Double-click on the warning to open the Celebrity_1 machine. Select the event celebrity. The problem is that the event is not declared as a refinement. To solve the problem, expand the event and add a new entry in the REFINES section (Click on the
The three remaining warnings state that witnesses (3.2.3.4.4) are missing. Double click on the warning to open the concrete model (here Celebrity_2). Then expand the celebrity event and add a witness in the WITH section (Click on the
A default witness wit1 has been created, with a default value
Edit the content and save the file. One warning will disappear, and only two will remain.
The following Section 2.9.2 shows the final Celebrity_2 machine. |