public class SimpleComputeMergeAlgorithm
extends java.lang.Object
SIMPLE MERGE ALGORITHM:
ComputeMerge() 1. Let Matches = {} 2. Let Conflicts = {} 3. foreach A in
MergeActors 4. foreach output port P of A involved in merge 5.
ComputeMatches(A, P, Matches, Conflicts) 6. ComputeMappings(Matches) 7.
ComputeTargetSemTypes(matches);
ComputeMatches(A, P, Matches, Conflicts) 1. Let Actors = MergeActors - {A} 2.
foreach A' in Actors and !HasConflict(P, A', Conflicts) 3. foreach output
port P' of A' involved in merge 4. if( semType(P) subtypeof semType(P') ) 5.
if( HasMatch(P', A, Matches) ) 6. AddConflict(P, A', Matches, Conflicts) 7.
else 8. AddMatch(P, P', Matches) ... here we can add a condition for
conversion functions ...
ComputeMappings(Matches) 1. Let MergeSets = PartitionMatches(Matches) 2.
foreach S in MergeSets 3. Let P' = CreateNewOutputPort() 4. foreach P in S 5.
AddMapping(P, P') 6. foreach A in MergeActors 7. foreach otuput port P of A
involved in merge 8. if( !InMatch(P, Matches) ) 9. Let P' =
CreateNewOutputPort() 10. AddMapping(P, P')