Given some condition, I want to check that a variables next state holds for some proposition. I have not been able to create something that rodin has accepted.
My exact case is the following invariant. I want to make sure that the variable door
never changes when the lock is on. The variable door
is either Open
or Closed
inv4: PrimaryLock = On ⇒ door :∣ door' = door
If the PrimaryLock
is On
this means that the door state will not change, no matter what event is triggered next.
Is this possible using Event-b or do I need to solve my issue by adding additional variables?
Currently, the only place where you can specify properties about state changes is in events themselfes. Thus, you have to add the guard
PrimaryLock /= On
to each event that modifies the variabledoor
.If you work with refinement (you should! :), then this is actually not that bad because you specify the abstract events that might change the door and all the events in refinements must follow their specification.
New events in refinements that do not refine
open_door
orclose_door
implicitly refineskip
are not allowed to change the door status. So ifopen_door
andclose_door
are the only events in the abstract specification that change the variabledoor
,door
can only be modified in refinements if it is not locked.You could specify it even more abstract with
and specify the events that open or close it as refinements.
I admit that it would be a nice feature to express such properties for all events.