Event-B Decomposition Analysis for Systems Behavior Modeling
Kenza Kraibi
1
, Rahma Ben Ayed
1
, Joris Rehm
2
, Simon Collart-Dutilleul
1,3
, Philippe Bon
1,3
and Dorian Petit
1,4
1
Institut de Recherche Technologique Railenium, F-59300, Famars, France
2
CLEARSY, Strasbourg, France
3
Univ. Lille Nord de France, IFSTTAR, COSYS, ESTAS, F-59650 Villeneuve d’Ascq, France
4
Universit
´
e Polytechnique Hauts-de-France, LAMIH UMR CNRS 8201, F-59313 Valenciennes, France
dorian.petit@uphf.fr
Keywords:
Formal Methods, Event-B, Refinement, Decomposition, Systems Behavior, Railway Systems.
Abstract:
Applications of formal methods to critical systems such as railway systems have been studied by several
research works. Their ultimate goal is to increase confidence and to ensure the behavior correctness of these
systems. In this paper, we propose to use the Event-B formal method. As a central concept in Event-B,
refinement is used to progressively introduce the details of systems requirements, but in most cases, it leads to
voluminous and complex models. For this purpose, this paper focuses on decomposition techniques in order
to manage the complexity issue in Event-B modeling. It presents a state of the art and an analysis of existing
decomposition techniques. Then, an approach will be proposed following this analysis.
1 INTRODUCTION
The analysis and modeling activities of railway dy-
namic behaviors are major tasks requiring rigorous
mechanisms. Based on mathematical foundations,
formal methods can help to rigorously carry out these
activities and reduce the ambiguity of the specificities
of critical systems such as railway signaling systems.
The use of formal methods is recommended by the
CENELEC 50128 standard (CENELEC, 2011) ded-
icated to the railway sector. In this paper, we pro-
pose to use the Event-B formal method (Abrial et al.,
2010; Abrial, 2010) providing appropriate techniques
for system modeling based on the B method (Abrial,
1996). B/Event-B methods have been widely used
in the railway field in research such as the PER-
FECT
1
and NExTRegio projects (Ben Ayed et al.,
2016; Ben Ayed et al., 2014) and in industry sectors
as in the METEOR project (Behm et al., 1999). In
the same context, CLEARSY
2
has also driven railway
projects using formal proofs (Sabatier, 2016).
Modeling of critical systems such as railway sig-
naling systems can lead to complex and voluminous
1
PERFECT: http://www.agence-nationale-
recherche.fr/Projet-ANR-12-VPTT-0010
2
CLEARSY: https://www.clearsy.com/
models. One of the Event-B techniques for this is-
sue is refinement. Refinement consists in detailing
the design to reach a concrete level by progressive
steps. However, the final level of modeling is still
difficult to manage. In order to reduce this complex-
ity, refinement can be completed by another technique
called decomposition of atomicity (Butler, 2009a).
Model decomposition is another technique that can
reduce the complexity of large models and increase
their modularity. This technique consists in divid-
ing a model into sub-models that can be refined sepa-
rately and more easily than the original one. Several
model’s decomposition approaches have been pro-
posed. Some of them are supported by Rodin
3
(Butler
and Hallerstede, 2007) plugins
4
(Silva et al., 2011).
In this paper, we present in sections 2 and 3, a sur-
vey of the existing decomposition techniques. Sec-
tion 4 describes a railway case study for the existing
approaches analysis presented in section 5. Then, this
last one illustrates the semantics need of modularity
and gives a presentation of the proposed approach and
its application to the case study.
3
Rodin: http://www.event-b.org/
4
Modularization:
http://wiki.event-b.org/index.php/Modularisation Plug-in
278
Kraibi, K., Ben Ayed, R., Rehm, J., Collart-Dutilleul, S., Bon, P. and Petit, D.
Event-B Decomposition Analysis for Systems Behavior Modeling.
DOI: 10.5220/0007929602780286
In Proceedings of the 14th International Conference on Software Technologies (ICSOFT 2019), pages 278-286
ISBN: 978-989-758-379-7
Copyright
c
2019 by SCITEPRESS Science and Technology Publications, Lda. All rights reserved
2 REFINEMENT AND EVENT
ATOMICITY DECOMPOSITION
Nowadays, refinement is used to solve complex mod-
eling problems (Badeau and Amelot, 2005). In Event-
B, we find two principal types of refinement: data re-
finement (Back, 1989) and events refinement. Data
refinement consists in refining the system state by
introducing new variables. It allows the definition
of gluing invariants and the invariance properties of
the new variables. These invariants allow the correc-
tion proof of the refinement (Abrial, 2010). Events
refinement consists in introducing new events refin-
ing the skip in order to observe the concrete behavior
that does not appear in the abstraction (Abrial, 2010).
Events refinement allows refining existing events by
strengthening their guards and refining their actions.
A proposition in (Butler, 2009a) is called de-
composition of event atomicity. This approach is
a structuring mechanism for refinement in Event-B.
This mechanism is based on decomposing an ab-
stract atomic event to many sub-events, where one
event refines this abstract event. Decomposing atomic
events is inspired from Jackson System Develop-
ment (JSD) approach (Butler, 2009b) and it is repre-
sented by the ERS approach (Event Refinement Struc-
tures) (Dghaym et al., 2016; Dghaym et al., 2017).
The idea of the ERS approach is to enrich the Event-
B refinement with a graphical tree notation able to
represent explicitly the events decomposition in the
refinement and the behavior sequencing (Fathabadi
et al., 2011). Figure 1 presents a sub-tree. The child
nodes of each node are transformed into events in the
refinement.
event
0
event
1b
event
1a
event
1c
AND
event
2a
event
2b
XOR
event
2d
event
2c
event
2e
skip
skip
refines
Figure 1: Example of Event Refinement Structures (ERS)
diagram.
The nodes order describes the order of events ob-
servation (from left to right). XOR specifies the ob-
servation of one and only one event. In case of XOR,
an event can be refined by many events or any event.
AND allows the interlaced execution of events. De-
spite these refinement virtues, they do not tackle vo-
luminous models issues.
3 MODEL DECOMPOSITION
An Event-B machine can have so many events and
state variables that an additional refinement can be-
come difficult to manage. Model decomposition tack-
les this difficulty by providing a mechanism to divide
a large model into several sub-models. For different
decomposition techniques (Hoang et al., 2011), de-
scending steps are defined by: modeling the system in
an abstract machine, refining the abstract model to fit
the structure expected by a given decomposition tech-
nique, applying the decomposition, then refining the
resulting sub-models independently. Following this
guideline, global properties are captured early in the
model and guaranteed in the final models by combin-
ing refinement and decomposition.
3.1 Shared Event Decomposition
The shared event decomposition is an evolution of de-
composition of event atomicity. The author in (Butler,
2009a) proposes this method which makes it possi-
ble to separate the variables of a system in two dif-
ferent sub-machines by decomposing a shared event.
To decompose a machine using this method, vari-
ables to partition in each sub-component are cho-
sen then the decomposition is applied. Generated
machines contain the selected variables, and shared
events are defined in two different signatures for each
sub-machine. These events describe the variables
changes.
As illustration, let M
0
be the machine as in fig-
ure 2. Variables v1 and v2 of this machine are parti-
tioned respectively in two sub-machines M
1a
and M
1b
.
event2 is decomposed in the two sub-components as
two events event2’ and event2”, each event describes
the change of state applied to v1 and v2 respectively.
M
0
event1
event2
event3
v1
v2
M
1a
event1
event2’
v1
M1b
event2”
event3
v2
v1
v2
Figure 2: Decomposition by shared event.
Event-B Decomposition Analysis for Systems Behavior Modeling
279
3.2 Shared Variable Decomposition
Abrial proposes in (Abrial and Hallerstede, 2007) the
shared variable decomposition which consists in dis-
tributing events of a machine between several sub-
machines. This approach proposes to manage shared
variables between several events. It is used also for
decomposing parallel programs (Hoang and Abrial,
2010). During the machine decomposition, events
to be separated are selected in each sub-machine and
considered as internal events. A variable that occurs
only in the internal events is a private variable. If a
variable is involved in internal events of different sub-
machines, it is defined in each of them as a shared
variable that cannot be refined. External events of a
sub-machine are events that simulate the change of
state of the external variables in the abstract machine.
Figure 3 illustrates the decomposition by shared
variable. The machine M
0
is defined by four events
and it is decomposed into two sub-machines M
1a
and
M
1b
by partitioning its events. Events event1 and
event2 (resp. event3 and event4) are internal events
to the sub-machine M
1a
(resp. M
1b
). The variable v1
(resp. v2) is private to M
1a
(resp. M
1b
). As for v2, it
is a shared variable. Consequently, the machine M
1a
(resp. M
1b
) contains the external event event3’ (resp.
event2’) which simulates the state changes made by
event3 (resp. event2) on v2 in M
0
.
M
0
event1 event2 event3 event4
v1 v2 v3
M1a
event1 event2 event3’
v1 v2
M1b
event2’ event3 event4
v2 v3
event1, event2 event3, event4
Figure 3: Decomposition by shared variable.
3.3 Other Decomposition Methods and
Summary
In addition to refinement and decomposition by
shared variable, generic instantiation is another
proposition of Abrial in (Abrial and Hallerstede,
2007). It is based on the reuse of the abstract model
with slight modifications by instantiating sets and
constants of this model. In (Hoang et al., 2011), the
modularization is another proposition based on defin-
ing interfaces in B method. This approach promotes
the use of USES clause in order to call operations.
Fragmentation and distribution approach in (Siala
et al., 2016) defines a specification using DSL (Do-
main Specific Language) (Van Deursen et al., 2000)
to decompose a model. In the same context, (Hoang
et al., 2017) propose also a technique based on the
use of a classical-B clause. This approach proposes
the use of a composition mechanism based on the use
of INCLUDES clause. So, the including machine can
use variables and invariants of the included machine.
Our target is to use specific systems behavior tech-
niques for modeling. In opposition, the previous cited
approaches rely on the implication of some classical-
B method semantics or the use of another language as
DSL.
Currently, the railway industry models its systems
on the basis of a linear modeling. However, the ob-
tained models are voluminous and difficult to man-
age. The aim of our work is, on the one hand, mod-
eling the behavior of railway signaling systems and
the management of the resulting models complexity
on the other hand. For this point, we choose to pro-
ceed with model decomposition through shared vari-
able decomposition and shared event decomposition.
4 RAILWAY CASE STUDY
In order to analyze the existing approaches and illus-
trate our contribution, we have modeled and formally
proved a case study of railway signaling systems on
Atelier B
5
and Rodin tools. The aim is to model a sys-
tem which allows the trains control, in other words
ensure a safe train circulation in a certain railway net-
work containing signals, points, crossings... The main
goal of this case study is to avoid trains rear-end col-
lisions as in figure 4.
This case study is a simple example that focuses
on a particular requirement of a railway network and it
contains relevant elements to the decomposition anal-
ysis. This example is representative of what is done in
the industrial railway field and in sub-systems traffic
management such as the European Rail Traffic Man-
agement System
6
(ERTMS).
Figure 4: Example of a train rear-end collision.
In a one-way traffic split into blocks B
i
as shown
in figure 5, let consider two trains Train A and Train
5
Atelier B tool: https://www.atelierb.eu/
6
European Rail Traffic Management System:
http://www.ertms.net
ICSOFT 2019 - 14th International Conference on Software Technologies
280
B. Train A follows Train B. The trains are moving
by a certain number of steps. The trains movements
are based on the position of the front train and of the
end train of each train. Each block has a front block
and an end block. Two block states are possible: oc-
cupied (red block) or free (green block).
Figure 5: Case study description.
Abstract Machine. In an abstract machine M
0
(cf.
Figure 6), we define trains movements. M
0
de-
fines the variables describing the trains front and the
trains end positions (line 2 in figure 6): front trainA,
front trainB, end trainA and end trainB, and the
events that describe the trains movements:
move front trainA: as shown in figure 6, change
the position of the Train A front (line 9) without
catching up the next train.
move end trainA: change the Train A end position
taking into consideration the position of its front.
move front trainB: change the Train B front posi-
tion.
move end trainB: change the position of the Train
B end taking into consideration its front position.
1. MACHINE M
0
2. VARIABLES front trainA, front trainB, end trainA,
end trainB
3. INVARIANTS front trainA < end trainB & ...
4. EVENTS
5. move
front trainA =
6. ANY step
7. WHERE step : NATURAL1
8. & front trainA + step < end trainB
9. THEN front trainA := front train1 + step
10. END;
11. ....
12. END
Figure 6: Abstract machine excerpt of the case study.
To avoid a rear-end collision, the position of the
Train B end must always be in front of the position of
the Train A front. This is specified by the invariant:
f ront trainA < end trainB
Refinement. In a second phase, we define a more
concrete machine introducing the blocks notation and
the trains movements on blocks. M
1
refining M
0
and
seeing a context C (cf. figure 7).
The context C, as in figure 8, specifies the blocks,
their beginnings and ends positions and some track
MACHINE M
0
REFINEMENT M
1
REFINES M
0
CONTEXT C
1
REFINES
SEES
Figure 7: Structure of the case study model.
properties (axioms) such as the blocks do not inter-
sect, etc. A block can be Free or Occupied.
1. CONTEXT C
2. DEFINITIONS Block == NATURAL
3. SETS BlockState = {Free,Occupied};
4. SUBSYS = {TRAIN, TRACK}
5. CONSTANTS front block, end block, next block
6. AXIOMS front block : Block NATURAL
7. & end block : Block NATURAL
8. & next block = %bk.(bk : Block | bk+1)
9. & ...
10. END
Figure 8: The context defining blocks.
In machine M
1
(cf. Figure 9), the variables that
describe the change of the blocks states by block state
and the intermediate variables are defined.
1. REFINEMENT M
1
REFINES M
0
2. VARIABLES front trainA, front trainB, end trainA,
3. end trainB, block state,next turn,
4. f st tAblock, lst tAblock, f st tBblock,lst tBblock
5. INVARIANTS f st tAblock < lst tBblock
6. & end train(lst tBblock) end trainB
7. & bk.(bk : Block & next turn = T RAIN&
8. block state(bk) = Free bk 6= lst tBblock)
9. & ...
10. EVENTS
11. enter tAblock ref move front trainA =
12. ANY step
13. WHERE step : NATURAL1
14. & block state(next block(fst tAblock)) = Free
15. & front block(fst tAblock) front trainA+step
16. & front trainA + step <
22. front block(next block(fst tAblock))
17. & next turn = TRAIN
18. THEN
19. next turn := TRACK
20. || front trainA := front trainA + step
21. || fst tAblock := next block(fst tAblock)
22. END;
23. ...
24. END
Figure 9: The case study refinement machine.
These intermediate variables allow the communi-
cation between the train and the track such as the oc-
cupied block by a train (lines 4 in figure 9). Train
A can occupy more than one block, so variables
fst tAblock and lst tAblock respectively describe the
occupied block by the Train A front and the block oc-
cupied by the Train A end. In the same way are de-
Event-B Decomposition Analysis for Systems Behavior Modeling
281
fined fst tBblock an lst tBblock for Train B. The vari-
able next turn allows the transition from a Track be-
havior to a Train behavior and vice versa.
The events of this machine are those defined in M
0
refining themselves and other new refining events:
enter tAblock (resp. enter tBblock): occupies
a block by Train A (resp. Train B) refining
move front trainA (resp. move front trainB).
free tAblock (resp. free tBblock): frees a
block by Train A (resp. Train B) refining
move end trainA (resp. move end trainB);
TRACKevent: a new event changing the block
state.
A block can be occupied at most by one train,
in other words the occupied block by the end of
Train B named lst tBblock should always be in
front of the occupied block by the front of Train
A named fst tAblock as defined in the invariant:
f st tAblock < lst tBblock. Another useful invari-
ant is also defined in order to ensure the distance
between Train A and Train B: bk.( bk:Block &
next turn = TRAIN & block state(bk) = Free bk
6= lst tBblock)
Figure 10 shows an example of a possible sce-
nario of trains movements. Using ProB
7
(Leuschel
and Butler, 2003), an animation is elaborated on the
model.
Figure 10: An example of trains movement scenario.
In a first step, each of Train A and Train B occupy
distinct blocks. Then, in step 2 Train B moves to the
next block and occupies it. The blue train shadow
presents the previous train position. As a third step,
while Train A is moving inside the associated block,
Train B releases the previous block. Hence, in step 4
Train A enters the next free block. Note that not all
the model elements are presented in the paper
8
.
7
ProB: www3.hhu.de/stups/prob/index.php/Main Page
8
The case study model and proof in Atelier B and Rodin,
animation in ProB and different Rodin plugins application
can be provided on demand.
5 PROPOSED APPROACH
5.1 Analysis
As mentioned in subsection 3.3, this paper focuses
on the shared variable decomposition and the shared
event decomposition. Both approaches are start-
ing from a machine and decomposing it into two
other new machines, then refining the resulting sub-
machines separately. Let apply the decomposition by
the shared event and by the shared variable plugins.
The machine to decompose is M
1
and the resulting
sub-machines are M
2a
and M
2b
.
During the shared event decomposition, not all
actions are accepted to be decomposed and variables
partitioning is not always possible. Table 1 shows
different types of actions that make variables states
evolve. v1 and v2 are an example of the case study
variables.
Table 1: Application of the shared event decomposition.
Actions types of M
1
M
2a
(v1) M
2b
(v2)
act1 v1 :| (v1=1) k
v2 :| (v2=2)
v1 :| (v1=1) v2 :| (v2=2)
act2 v1,v2 :| (v1=2
v2=v1+2)
act3 v1,v2 := 1,2 v1 := 1 v2 := 2
act4 v1 := v2+1
act5 v1 :: {v2,1,2}
An error message is displayed asking to sim-
plify the actions: the assignment is too complex be-
cause it refers to elements belonging to different sub-
components. The obtained errors are shown by this
symbol ’–’. For the shared event decomposition,
predicates (invariants and guards) and actions should
not refer to variables that must be partitioned into dif-
ferent sub-components. As an example, the substitu-
tion becomes such that in act2 cannot be decomposed:
v1,v2 :| (v1 = 2 v2 = v1 + 2)
For the shared variable decomposition, the event
partition is always possible and can generate sub-
components. However, this decomposition may be
less relevant because the model to be decomposed
contains a large number of shared variables, espe-
cially in case of decomposing complex refinements
rich with shared variables (Silva et al., 2011) which
is the case in the case study. Furthermore, there ex-
ists a restriction of this method: shared variables and
external events must be present in the resulting sub-
components and cannot be refined when refining these
sub-components (Abrial, 2009).
For these reasons, it may be necessary to proceed
with an intermediate preparation step to resolve com-
plex predicates such as invariants, guards and axioms,
ICSOFT 2019 - 14th International Conference on Software Technologies
282
as well as substitutions (actions) by separating the
variables assigned to different sub-components. This
separation is done by applying an additional man-
ual refinement step before the decomposition (Abrial,
2009). The user must explicitly separate the variables
in this refinement by introducing an auxiliary parame-
ter p. For example, the predicate v1 = v2 becomes p =
v2 & v1 = p. If this manual refinement step is not per-
formed, the complex predicates and substitutions are
automatically marked by the tool via a message frame
and then the user’s intervention is required to perform
the separation explicitly. After this plugins experi-
mentation, we had identified some limitation and is-
sues in the generated machine:
States changes of several variables in the same ac-
tion, such as becomes such that substitution, can-
not be decomposed and should be dealt with the
user’s intervention by an intermediate step of re-
finement and replacing the variables in the predi-
cate with parameters;
Loss of information when decomposing guards;
Loss of shared invariant involving shared vari-
ables. As long as the resulting sub-machines are
not refining the initial machine, the shared invari-
ant is not preserved;
Generation of empty events in the sub-
component;
Need of an intermediate step of a manual refine-
ment before applying the decomposition.
5.2 Discussion
The choice of a decomposition method depends on
the work finality:
Shared variable decomposition can decompose
models by functionality, for instance in the rail-
way field, an initial railway signaling model can
be decomposed into three sub-components: train
integrity, block release and train communication;
Shared event decomposition is based on partition-
ing the behavior of a system, e.g. partitioning ac-
cording to different types of trains movement such
as movement under the national Automatic Train
Protection (ATP) system or under ERTMS levels.
Nonetheless, the industrial need is to reason on
sub-systems, in other words, to take into account both
the behavior and the functionality. The use of shared
variable decomposition or the shared event decompo-
sition does not address this need. Hence, after this
analysis of the existing approaches and according to
our industrial needs, some limitations to these tech-
niques are identified, among others, the loss of shared
invariants preserving a major safety property. Also,
after the generation of the sub-machines by the plu-
gin, the link between the original machine and the
sub-machine is not explicit.
5.3 Proposed Approach
The analysis above leads us to build a new decom-
position approach that corresponds to the industrial
need. This technique is based on the decomposi-
tion by refinement. By refining the abstract machine
while the decomposition, the resulting sub-machines
keep the preservation of shared invariants, especially,
safety invariants. In addition, this approach defines a
new semantic link between sub-machines: REFSSES.
This link allows variables, invariants, constants, sets
and properties visibility of a sub-machine by the other
sub-machines.
The REFSSES is a similar notion to the SEES of
the classical-B with a particular characteristics, The
name of the REFSEES clause is a combination of RE-
FINEMENT and SEES which means it allows a re-
finement machine to see another refinement machine.
So we add a clause REFSEES to the machine M
1a
(resp. M
1b
), which would make reference to the vari-
ables of the machine seen M
1b
(resp. M
1a
). So there,
we have a circular dependency with this notion of
REFSEES. In classical-B there is normally no circu-
lar dependency and machines cannot see a refinement
machine. Contrary to SEES clause, REFSEES can
have a refinement machine as identifier and can be
used in a cyclic way.
Figure 11 illustrates the decomposition by refine-
ment of a machine M
0
into two sub-machines M
1a
and
M
1b
:
M
0
defines variables x, y and z, invari-
ants to be preserved I(x,y,z) and abstract event.
An abstract event contains guards G(x,y,z) and
before/after predicates R(x,y,z,x’,y’,z’).
The resulting sub-machine M
1a
(resp. M
1b
) de-
fines the private variable x
1a
(resp. y
1b
) refining
x (resp. y). z is considered as a shared variable
which can be refined by z
1a
(resp. z
1b
) in M
1a
(resp. M
1b
). Each machine defines gluing invari-
ants J
1a
and J
1b
. abstract event is refined by re
a
in M
1a
and by re
b
in M
1b
. The variable x
1a
(resp.
y
1b
) is visible by re
b
(resp. re
1a
) in M
1b
(resp.
M
1a
).
Table 2 is a visibility table of REFSEES. Sets
and constants of M
1a
are visible by axioms, invariants
and events of M
1b
. Private variables of M
1a
are only
visible by M
1b
events. As for shared variables, they
are visible and able to be modified by both the sub-
machines.
Event-B Decomposition Analysis for Systems Behavior Modeling
283
MACHINE M
0
VARIABLES x, y, z
INVARIANTS I(x,y,z)
EVENTS
abstract event
when G(x,y,z)
then x, y,z : |R(x,y, z,x
0
,y
0
,z
0
)
end
REFINEMENT M
1a
REFINES M
0
REFSEES M
1b
VARIABLES x
1a
,z
1a
INVARIANTS J
1a
(x,z,x
1a
,z
1a
)
EVENTS
re
a
ref abstract
event
WHEN G
1a
(x
1a
,y
1b
,z
1a
)
THEN x
1a
,z
1a
: |R
a
(x
1a
,z
1a
,x
0
1a
,y
0
1b
,z
0
1a
)
END
REFINEMENT M
1b
REFINES M
0
REFSEES M
1a
VARIABLES y
1b
,z
1b
INVARIANTS J
1b
(y,z,y
1b
,z
1b
)
EVENTS
re
b
ref abstract
event
WHEN G
1b
(x
1a
,y
1b
,z
1b
)
THEN y
1b
,z
1b
: |R
b
(y
1b
,z
1b
,x
0
1a
,y
0
1b
,z
0
1b
)
END
REFINES REFINES
REFSEES
REFSEES
Figure 11: Decomposition by refinement on two sub-machines.
Table 2: REFSEES visibility of M
1a
by M
1b
.
M
1a
M
1b
AXIOMS INV
INIT /
EVENTS
Sets visible visible visible
Constants visible visible visible
Private
variables
visible
Shared
variables
visible
Events
Figure 12 shows the general structure of the pro-
posed approach. The decomposition can be applied
on a certain level of refinement and done by multi-
ple horizontal refinements. As shown in the figure a
machine M
n1
can be refined by m machines. These
resulting sub-machines keep the refinement link with
the root.
5.4 Application of the Approach to the
Case Study
The goal is to decompose the machine M
1
by separat-
ing track and train behaviors and functionalities using
the decomposition by refinement as presented in fig-
ure 13.
The Track machine, in figure 14, refines M
1
and
refsees the Train machine through the REFSEES
link. Track contains the variables associated to the
track like the blocks states variable: block
state. It
contains also events that make these variables evolve
such as TRACKevent.
As for the Train machine, in figure 15, it re-
fines M
1
and refsees the Track machine through
the REFSEES link. It describes the train variables
like front trainA and the trains movement events e.g.
enter tAblock. The variable next turn is a shared vari-
able of Track and Train. Partitioned events keep
their guards in the sub-machines. Events that are not
needed in a sub-machine are refined such that they
cannot be observed anymore such as enter tAblock in
the Track machine. In Rodin, this is done automati-
cally since the event is not displayed in the refining
machine.
6 CONCLUSION
Modeling railway signaling systems in Event-B pro-
duces complex models rich with variables and events.
Various techniques have been proposed to cope with
this voluminosity issue such as the decomposition
technique. Although decomposition approaches pro-
mote the modularization of critical systems, some of
them do not totally cope with this issue. The analysis
of these approaches, on the base of the defined case
study, leads to the identification of certain restrictions.
As a consequence, we propose in this paper a new ap-
proach based on the decomposition by refinement us-
ing a new link between sub-machines that addresses
the definition of a new semantic. This approach will
guarantee the preservation of invariants through the
refinement and the visibility of private variables of
other sub-machines through the REFSEES link. Our
aim is that this approach will be used by both Rodin
and Atelier B tools. In a future work, we will define
ICSOFT 2019 - 14th International Conference on Software Technologies
284
M
0
M
1
Multiple levels
of refinement
M
n1
M
na
M
(n+1)a
M
nb
M
nc
M
(n+1)c1
M
(n+1)c2
Multiple
sub-machines
M
nm
REFINES
REFINES
REFINES
REFINES
REFINES
REFINES REFINES
REFINES
REFSEES
REFSEES
REFSEES
REFSEES
REFSEES
REFSEES
REFSEES
REFSEES
REFSEES
REFSEES
Figure 12: Structure of the proposed approach.
MACHINE M
0
MACHINE M
1
REFINEMENT
Track
REFINES M
1
REFSEES Train
VARIABLES
block state,
next turn
INVARIANTS J
a
EVENTS
re
a
ref
abstract event
REFINEMENT Train
REFINES M
1
REFSEES Track
VARIABLES front trainA,
front trainB, end trainA,
end trainB , fst tAblock,
lst tAblock, fst tBblock,
lst tBblock, next turn
INVARIANTS J
b
EVENTS
re
b
ref abstract event
REFINES
REFINES REFINES
REFSEES
REFSEES
Figure 13: Application of the decomposition by refinement
on the case study.
10. INVARIANTS
11. block state : Block BlockState
12. & next turn : SUBSYS & ...
13. EVENTS
14. TRACKevent =
15. SELECT next turn = TRACK
16. THEN
17. next turn:=TRAIN || block state:=(Block*Free)
< + ((lst tAblock..fst tAblock U lst tAblock ..
fst tAblock) *Occupied)
18. END;
19. enter tAblock=SELECT 0=1 THEN skip END;
20. ...
21. END
Figure 14: Resulting sub-machine Track.
proof obligations formulas for these new notations.
As consequence, for each sub-machine proof obliga-
tions are generated taking into account the link to the
other sub-machines.
10. INVARIANTS next turn : SUBSYS
11. & fst tAblock : Block & lst tAblock : Block
12. & fst tBblock : Block & lst tBblock : Block
13. EVENTS
14. enter tAblock
15. ANY step
16. WHERE step : NATURAL1
17. & block state(next block(fst tAblock)) = Free
18. & front block(fst tAblock) front trainA+step
19. & front trainA+step<
front block(next block(fst tAblock))
20. & next turn = TRAIN
21. THEN next turn := TRACK
22. || front trainA := front trainA + step
23. || fst tAblock := next block(fst tAblock)
24. END; ...
25. TRACKevent = SELECT 0=1 THEN skip END
26. END
Figure 15: Resulting sub-machine Train.
ACKNOWLEDGMENT
This work is supported by PRESCOM (Global
Safety Proofs for Modular Design/PREuves de
S
´
ecurit
´
e globale pour la COnception Modulaire) as a
part of IRT Railenium
9
projects in collaboration with
CLEARSY.
REFERENCES
Abrial, J.-R. (1996). The B-Book: Assigning Programs to
Meanings. Cambridge University Press, New York,
NY, USA.
9
Railenium: https://railenium.eu/
Event-B Decomposition Analysis for Systems Behavior Modeling
285
Abrial, J.-R. (2009). Event Model Decomposition. Tech-
nical report/[ETH, Department of Computer Science,
626.
Abrial, J.-R. (2010). Modeling in Event-B: System and Soft-
ware Engineering. Cambridge University Press, New
York, NY, USA.
Abrial, J.-R., Butler, M., Hallerstede, S., Hoang, T. S.,
Mehta, F., and Voisin, L. (2010). Rodin: an open
toolset for modelling and reasoning in Event-B. In-
ternational journal on software tools for technology
transfer, 12(6):447–466.
Abrial, J.-R. and Hallerstede, S. (2007). Refinement, De-
composition, and Instantiation of Discrete Models:
Application to Event-B. Fundamenta Informaticae,
77(1-2):1–28.
Back, R.-J. (1989). Refinement Calculus, Part II: Parallel
and Reactive Programs. In Workshop/School/Sympo-
sium of the REX Project (Research and Education in
Concurrent Systems), pages 67–93. Springer.
Badeau, F. and Amelot, A. (2005). Using B as a high
level programming language in an industrial project:
Roissy VAL. In International Conference of B and Z
Users, pages 334–354. Springer.
Behm, P., Benoit, P., Faivre, A., and Meynadier, J. M.
(1999). M
´
et
´
eor: A Successful Application of B in a
Large Project. In Wing, J., Woodcock, J., and Davies,
J., editors, FM’99 - Formal Methods, volume 1708 of
Lecture Notes in Computer Science, pages 369–387.
Springer Berlin Heidelberg.
Ben Ayed, R., Collart-Dutilleul, S., Bon, P., Idani, A., and
Ledru, Y. (2014). B Formal Validation of ERTM-
S/ETCS Railway Operating Rules. In International
Conference on Abstract State Machines, Alloy, B,
TLA, VDM, and Z, pages 124–129. Springer.
Ben Ayed, R., Collart-Dutilleul, S., and Prun, E. (2016).
“Formal Methods To Tailored Solution For Single
Track Low Traffic French Lines”. In International
Railway Safety Council (IRSC), Paris, France.
Butler, M. (2009a). Decomposition Structures for Event-
B. In International Conference on Integrated Formal
Methods, pages 20–38. Springer.
Butler, M. (2009b). Incremental Design of Distributed Sys-
tems with Event-B. Engineering Methods and Tools
for Software Safety and Security, 22(131).
Butler, M. and Hallerstede, S. (2007). The Rodin for-
mal modelling tool. In BCS-FACS Christmas 2007
Meeting-Formal Methods In Industry, London.
CENELEC, E. (2011). 50128. Railway applications-
Communication, Signaling and Processing Systems-
Software for Railway Control and Protection Systems.
Dghaym, D., Butler, M., and Fathabadi, A. S. (2017). Ex-
tending ERS for Modelling Dynamic Workflows in
Event-B. In Engineering of Complex Computer Sys-
tems (ICECCS), 2017 22nd International Conference
on, pages 20–29. IEEE.
Dghaym, D., Trindade, M. G., Butler, M., and Fathabadi,
A. S. (2016). A Graphical Tool for Event Refinement
Structures in Event-B. In International Conference on
Abstract State Machines, Alloy, B, TLA, VDM, and Z,
pages 269–274. Springer.
Fathabadi, A. S., Rezazadeh, A., and Butler, M. (2011).
Applying Atomicity and Model Decomposition to a
Space Craft System in Event-B. In NASA Formal
Methods Symposium, pages 328–342. Springer.
Hoang, T. S. and Abrial, J.-R. (2010). Event-b decompo-
sition for parallel programs. In International Con-
ference on Abstract State Machines, Alloy, B and Z,
pages 319–333. Springer.
Hoang, T. S., Dghaym, D., Snook, C., and Butler, M.
(2017). A composition mechanism for refinement-
based methods. In 2017 22nd International Confer-
ence on Engineering of Complex Computer Systems
(ICECCS), pages 100–109. IEEE.
Hoang, T. S., Iliasov, A., Silva, R. A., and Wei, W. (2011).
A Survey on Event-B Decomposition. Electronic
Communications of the EASST, 46.
Leuschel, M. and Butler, M. (2003). ProB: A Model
Checker for B. In FME, volume 2805, pages 855–
874. Springer.
Sabatier, D. (2016). Using formal proof and B method at
system level for industrial projects. In International
Conference on Reliability, Safety and Security of Rail-
way Systems, pages 20–31. Springer.
Siala, B., Tahar Bhiri, M., Bodeveix, J.-P., and Filali,
M. (2016). Un processus de D
´
eveloppement Event-
B pour des Applications Distribu
´
ees. Universit
´
e de
Franche-Comt
´
e.
Silva, R., Pascal, C., Hoang, T. S., and Butler, M. (2011).
Decomposition tool for Event-B. Software: Practice
and Experience, 41(2):199–208.
Van Deursen, A., Klint, P., and Visser, J. (2000). Domain-
specific languages: An annotated bibliography. ACM
Sigplan Notices, 35(6):26–36.
ICSOFT 2019 - 14th International Conference on Software Technologies
286