Rodin HandbookThis work is sponsored by the Deploy Project This work is licensed under a Creative Commons Attribution 3.0 Unported License |
2.10.2 First RefinementNow we are going to explain the main complexity of our model: the deadlock freeness proof for the first refinement. The difference between the first refinement and the initial model is that a new constant com been added in order to describe which rooms are connected. Additionally, we have a constant exit, which will be explained later. The event INITIALISATION does not change, but the event PASS is refined as a consequence. We assume that a person can move to another location l if they have the authorization to be in l (already defined in the abstraction) and also if the location l is connected to the location p where the person is at this precise moment (represented by sit(p)). We need to add a new guard that is more exact that that of the machine it refines:
We are faced with a difficulty here; it is not possible to prove that the refined event PASS does not happen less often than the abstract event PASS of its predecessor. To prove this we would have to prove that the guard of the abstract event implies that of the concrete event. The issue is that this condition cannot be verified in general. Moreover, the failure to prove the above condition indicates that there are possibilities that certain people could stay permanently blocked in locations. People are also more limited in the ways that they may move because they can only move between rooms that are connected. Now we know that this model contains a problem ignored in the document requirements. We must now find a sufficient solution.
At the beginning of this section we need to come back to the Event-B Perspective. As described in Section 2.10.1, open door_1 machine and add a derived invariant (theorem) called DLF as follows:
Save the file. Once again, the prover fails to prove the deadlock freeness automatically. Actually all we want to prove is that “any person authorized to be in a location must also be authorized to go in another location which communicates with the first one”. This can be illustrated as demonstrated in Figure 2.28.
Figure 2.28: The floor plan of the location to be controlled. To begin with, switch over to the proving perspective and double click on DLF/THM to begin proving. At the beginning of the proof, there aren’t any selected hypothesis, so we need to select a few. The old deadlock freeness invariant will be useful, and axm7 of doors_ctx2 as well.
We will try to avoid using exit since we want to keep things as simple as possible. Because sit and aut are inside the invariant, we also are likely to need
Once again, the prover automatically rewrites the existential quantifiers in the hypotheses. We now look at the proof. There is an easy case if For the other case, we will need the notion of exit. This function exit connects locations to locations and defines at every location except outside. We can look at the axioms about exit:
The axioms state that:
In our proof, we still need to show that anyone who is not outside can walk through a door. For this, axm5 is useless, so we add all hypotheses containing exit except for axm5. Now we have to instantiate q and m correctly and to conclude that the proof should not be too hard. Once again, for q, the choice p is obvious. But it is not quite as easy for m. Expressed in language, m must be the room behind the exit door of the room that p is currently in.
This concludes the tutorial. Please note that this tutorial gave you only an introduction to proving. |