Let's say that there are there models, original, left, and right models.

In the original model, there is a containment reference 'X' that contains elements a, b, and c. In the left model, the order of these elements has changed to b, a, c. While, in the right model, the order is a, c, b.

I already tried this using EMF Compare, and the result was there was no conflict, just differences. How come?

Cheers]]>

This is not a conflict because of the way EMF Compare determines the differences. We go for the "minimal" number of differences in the model, and this means that what we use to determine ordering is the Longest Common Subsequence (LCS) between the elements.

In order to go from origin to left:

origin A B C

left B A C

There are two subsequences of the same length : AC and BC. In such cases, the arbitrary choice from EMF Compare is to use the first LCS from the second list, which is "BC", we thus determine that the change in the left model is "A has been moved".

In order to go from origin to right:

origin A B C

right A C B

There are again two subsequences of the same length : AC and AB. Once again, we use the first from the second list, which is "AC". The difference between the two models is then "B has been moved".

"A has been moved" is not in conflict with "B has been moved", so you get two differences with no conflict.

If you instead change your models so that they are:

origin A B C D

left A C B D

right A C D B

then you will see a conflict, since in both cases the element determined to be moved is "B".

Laurent Goubet

Obeo]]>

I see, now. So, EMF compare' makes its decision based on the LCS algorithm.

I was just wondering because B is implicitly moved from index 1 to 0 when we move A from index 0 to 1 in the first origin-left example, which also similarly applies to the first origin-right example.

But, it's all based on its LCS algorithm.

Thanks for the enlightenment :)

]]>