1 [ 2 −−move c a r n1 WEST−> 4 ,
2 4 −−move c a r n2 WEST−> 7 ,
3 7 −−move c a r n3 WEST−> 11 ,
4 11 −−move c a r n4 WEST−> 15 ,
5 15 −−move c a r n5 WEST−> 19 ,
6 19 −−move c a r n6 WEST−> 23 ,
7 23 −−move c a r n7 WEST−> 2 ]
Listing 4: Car traveling east waits at red light, forever.
query language. Listing 1 lines 11 to 12 show how
EMFeR CTL operators may be nested to form more
complex queries. Lines 11 to 12 search for an un-
fair situation, e.g. the east car waits at red light
forever. Unfortunately, lines 11 to 12 detect that
transformation swapSignals from Listing 3 is un-
fair. Thus, the ExistGlobally operator of line 12
succeeds in finding a circle in our reachability graph
where only the car traveling west moves and the other
car waits for ever. On success, the exist operators gen-
erate an example path. (The always operators pro-
duce counterExample paths, on failure.) Listing 1,
Line 14 prints the unfair example path. Listing 4
shows the output for our unfair example. In state 2,
the car traveling east is waiting at its red light. The
other car has not yet moved. From then on, only the
car traveling west moves until it has done a full circle
reaching state 2, again. When the circle is closed, the
car traveling west may just do new circles for ever. In
this case the car traveling east will starve to death at
the red light.
The fairness problem of our current example sys-
tem is easily solved, if the swapSignals transforma-
tion gets executed once the car traveling west leaves
the road work area. Like Groove (grooveWebSite,
2018), EMFeR allows to force a set of transforma-
tions to be executed, if possible, by assigning priori-
ties to them. Doing so, our example system becomes
fair for two cars. If we add a second car on the upper
lane, these two cars might take turns in blocking the
road work area and thus they may block the signals
from swapping, forever. To address this, we need to
enable our signals to show red on both sides, in order
to drain the road work area and then to give yield to
the opposite direction.
Reachability graphs may also be used for con-
troller synthesis. The basic idea for controller syn-
thesis with EMFeR is to provide EMFeR with all the
basic operations. For our Road Map example we may
simply add an operation that switches each signal in-
dependently and without any respect to car move-
ments. Then, we generate all possible situations. The
resulting reachability graph will contain many unde-
sired or forbidden states. Thus, we now use an anal-
ysis function that visits the reachability graph and
marks undesired states and or adds a metric value for
the goodness of states. Now a smart controller for
our signals may just analyze the current traffic situa-
tion, identify the corresponding state within the reach-
ability graph of our system and identify the successor
state we would like to reach and issue the correspond-
ing switch signal operation.
5 CONCLUSION
EMFeR provides reachability graph computation for
(EMF) models based on model transformations pro-
vided as simple Java lambdas. Thus, you can do com-
plete testing and model checking and controller syn-
thesis on your normal EMF model using your favorite
model transformations. Ideally, you may test your
productive code, exhaustively. There is no need to
recode your problem e.g. in Promela or in any other
proprietary language used by current model checkers
or within a graph transformation system as e.g. Hen-
shin.
To cover all possible traffic situations for our traf-
fic light example, we use additional transformations
that create new cars entering the road work area at
both sides and that remove cars that have passed the
crossing. This more dynamic traffic scenario results
4064 different states for our reachability graph. This
results from all possible situations with or without a
car at each track computing to 2
11
possible car distri-
butions. And there are 2
1
different signal states giving
an upper bound of 4096 states.
We have run cases with some ten million states,
i.e. about 2
23
states. If we add more tracks to our
road, each additional track would add a factor of two
to the upper bound of states, thus we could go to
a street with about 20 tracks or a crossing with 10
incoming lanes, roughly double the size of our cur-
rent example. There is hope that EMFeR perfor-
mance can be further enhanced by techniques devel-
oped e.g. in the context of the Spin model checker.
Still the size of manageable object models is quite
limited. For larger problems model abstractions are
necessary. Systematic approaches to model abstrac-
tion like the counter example guided abstraction re-
finement method (Clarke et al., 2000) are future work.
However, EMFeR allows to do full testing and
model checking on dynamic object models using the
actual implementation of your model transformation
that will run in your productive system. This means,
you can guarantee that your actual system is fully
tested and works correct in all possible cases. EM-
FeR enables sharing of common sub-models between
multiple states thus providing a memory efficient en-
coding of large reachability graphs where each state
EMFeR: Model Checking for Object Oriented (EMF) Models
517