You should be really careful when doing this. The fact that two
compositions

(T1 @ {#a -> #b} @ {#x -> #y})

and

(T1 @ {#x -> #y} @ {#a -> #b})

are semantically the same does not mean that the way in which
they are expressed in class/trait definition is not important
of some importance for programmer.

That's pretty much like indentation - code which is properly
indented with nice long variable names is could be semantically
equivalent to the code which is total mess in a single line
but to programmers the difference is huge - at least for me.


If you really need semantic/structural equivalence, you'd better
flatten protocols of both compositions and compare these. This would handle correctly even this case:

TX = (T1 + T3)

(T1 + T2 + T3)   <==> (T2 + TX)


Best, Jan






On 22/01/14 09:33, Camille Teruel wrote:

On 22 janv. 2014, at 10:13, Martin Dias <[email protected]
<mailto:[email protected]>> wrote:



On Wed, Jan 22, 2014 at 10:05 AM, Martin Dias <[email protected]
<mailto:[email protected]>> wrote:

    should

    (T1 @ {#a -> #b} @ {#x -> #y}) = (T1 @ {#x -> #y} @ {#a -> #b})

    ?


two more:

(T1 - {#a. #b}) = (T1 - {#b. #a})

(T1 - {#a} - {#b}) = (T1 - {#b} - {#a})



I would say yes for each case.


Reply via email to