1 / 66

N-Way Model Merging CSC2125 Project

This project focuses on using model merging to reconcile complementary views of different stakeholders and unite changes made in distinct branches of an SCM system, as well as combine distinct program variants into a single-copy product line representation.

tharbin
Download Presentation

N-Way Model Merging CSC2125 Project

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. N-Way Model MergingCSC2125 Project Julia Rubin December 19, 2012

  2. Model merging is used to: • Reconcile complimentary views of different stakeholders

  3. Model merging is used to: • Reconcile complimentary views of different stakeholders • Unite changes made in distinct branches of an SCM system

  4. Model merging is used to: • Reconcile complimentary views of different stakeholders • Unite changes made in distinct branches of an SCM system • Combine distinct program variants into a single-copy product line representation

  5. Consists ofthree steps: • Compare – a heuristic that calculates the similarity degree for input elements y z x M1 M2 Compare ? ?

  6. Consists ofthree steps: • Compare – a heuristic that calculates the similarity degree for input elements • Match – a heuristic that decides which elements are similar, based on the results of compare y z x M1 M2 Match

  7. Consists ofthree steps: • Compare – a heuristic that calculates the similarity degree for input elements • Match – a heuristic that decides which elements are similar, based on the results of compare • Merge – an algorithm that combines matched elements in a prescribed way Union-merge, agreement-based, annotative, … Merge M1+M2 xy z

  8. Merging is extensively studied • UML class diagram • UML state machines • Matlab/Simulink models • Verilog • … Existing works focus on two input models!

  9. What if we want to composen inputs?

  10. Do it in a pair-wise manner, one by one! What if we want to composen inputs?

  11. Example Circle Square Square Square 0.66 M2 M1 position:point radius:int center:point width:int position:point width:int position:point center:point M3

  12. Example Circle Square Square Square 0.66 M2 M1 position:point radius:int center:point width:int position:point width:int position:point center:point Elements of a pair share one attribute and have one proprietary attribute each M3

  13. Example Circle Square Square Square 0.66 M2 M1 position:point width:int position:point radius:int center:point width:int position:point center:point 0.66 0.66 0.66 0.66 M3

  14. Example Circle Square Square Square 0.66 M2 M1 position:point width:int position:point radius:int center:point width:int position:point center:point Pair-wise similar(no matter how we define compare) 0.66 0.66 0.66 0.66 M3

  15. Example Circle Square Square Square 0.66 M2 M1 position:point width:int center:point width:int position:point radius:int position:point center:point 0.66 0.66 0.66 0.66 M3

  16. Example: the first merge Square/Circle Square Square [M3] M1+M3 M2 position:point [M1, M3] center:point [M1] radius:int [M3] position:point width:int center:point width:int

  17. Example: the first merge Square/Circle Square Square [M3] M1+M3 M2 position:point [M1, M3] center:point [M1] radius:int [M3] position:point width:int center:point width:int 0.62 0.66

  18. Example: the first merge Square/Circle Square Square [M3] M1+M3 M2 position:point [M1, M3] center:point [M1] radius:int [M3] position:point width:int center:point width:int 0.62 0.66

  19. Example: the second merge M1+ M2 +M3 Square/Circle Square position:point [M1, M3] center:point [M1] radius:int [M3] position:point [M2] center:point [M3] width:int [M2,M3]

  20. Example: the second merge M1+ M2 +M3 M1 M2 M3 Square/Circle Square Square Circle Square Square position:point [M1, M3] center:point [M1] radius:int [M3] position:point width:int position:point [M2] center:point [M3] width:int [M2,M3] position:point radius:int center:point width:int position:point center:point

  21. Example: the second merge M1+ M2 +M3 M1 M2 M3 Square/Circle Square Circle Square Square Square position:point [M1, M3] center:point [M1] radius:int [M3] center:point width:int position:point [M2] center:point [M3] width:int [M2,M3] position:point width:int position:point radius:int position:point center:point “Outlier”

  22. Example: the second merge M1+ M2 +M3 Square/Circle Square Circle Square Square Square position:point [M1, M3] center:point [M1] radius:int [M3] position:point radius:int center:point width:int position:point width:int position:point [M2] center:point [M3] width:int [M2,M3] position:point center:point M1 M2 M3

  23. Example: the second merge M1+ M2 +M3 Square/Circle Circle [M3] Square Circle Square Square Square position:point [M1, M3] center:point [M1] radius:int [M3] position:point [M2] center:point [M3] width:int [M2,M3] position:point radius:int position:point radius:int center:point width:int position:point width:int position:point center:point Square position:point [M1,M2] center:point [M1,M3] width:int [M2,M3] M1 M2 M3

  24. Example: the second merge M1+ M2 +M3 Square/Circle Circle [M3] Square position:point [M1, M3] center:point [M1] radius:int [M3] position:point [M2] center:point [M3] width:int [M2,M3] position:point radius:int Square position:point [M1,M2] center:point [M1,M3] width:int [M2,M3] Taking the global view is better

  25. Maybe some “smart” heuristic on the order of merging models? Circle Square Square Square position:point radius:int center:point width:int position:point width:int position:point center:point M1 M2 M3

  26. Maybe some “smart” heuristic on the order of merging models? Circle Square Square Square position:point radius:int center:point width:int position:point width:int position:point center:point Selecting M1 and M1 first would eliminate the problem M1 M2 M3

  27. Maybe some “smart” heuristic on the order of merging models? Circle Square Square Square position:point radius:int center:point width:int position:point width:int position:point center:point Selecting M1 and M1 first would eliminate the problem Does not work in the general case  M1 M2 M3

  28. Earlier Example – an Abstract Form M1 M2 AB A C Circle Square Square Square position:point radius:int center:point width:int position:point width:int position:point center:point B C A D M3

  29. Earlier Example M1 M2 AB A C M3 B C A D

  30. Example 2 A C M2 M1 A B J K I J I M E H E F F G B C A D I K E G M3

  31. Example 2 A C M2 M1 A B J K I J I M E H E F F G B C A D I K E G M3

  32. Example 2 A C M2 M1 A B J K I J I M E H E F F G B C A D I K E G M3

  33. Example 2 A C M2 M1 A B J K I J I M E H E F F G B C A D I K E G M3

  34. Example 2 A C M2 M1 A B J K I J I M E H E F F G B C A D I K E G M3

  35. Example 2 A C M2 M1 A B J K I J I M Models are pair-wise similar E H E F F G Without seeing the “global picture”, it is impossible to know which match is the best B C A D I K E G M3

  36. Example 2 A C M2 M1 A B J K I J I M E H E F F G B C A D I K E G M3

  37. Do it in a pair-wise manner, one by one! What if we want to composen inputs? Look at n models simultaneously –n-way merge!

  38. Outline • Why model merging? • Why n-way merge? • Formal definition of n-way merge (using Alloy) • Data representation • The compare operator • The match operator • The merge operator • Issues with the implementation • Next steps

  39. 1. Data Representation • In general: • a model is a typed graph • In this work: • all elements are of the same type • e.g., UML classes • relevant information about elements is represented by properties A-Z • e.g., UML class attributes and methods

  40. 2. The Compare Operator Each element of the tuple comes from some InputModel

  41. 2. The Compare Operator There are no two elements from the same model

  42. 2. The Compare Operator union is a set of all properties of all tuple elements

  43. 2. The Compare Operator Weight is Alloy does not support floating point numbers. Thus, we limit the precision to one decimal digit and do not normalize by the number of models

  44. Example Circle Square Square Square M2 M1 position:point radius:int center:point width:int position:point width:int position:point center:point M3

  45. Example /3=2 (2+2+2) positioncenterwidth Circle Square Square Square M2 M1 position:point radius:int center:point width:int position:point width:int position:point center:point M3

  46. Example /3=1.33 (2+2) positioncenterwidth Circle Square Square Square M2 M1 position:point radius:int center:point width:int position:point width:int position:point center:point M3

  47. Example /3=1.33 (2+2) positioncenterradius Circle Square Square Square M2 M1 position:point radius:int center:point width:int position:point width:int position:point center:point M3

  48. Example (2+2+2) /4=1.5 positioncenterwidthradius Circle Square Square Square M2 M1 position:point radius:int center:point width:int position:point width:int position:point center:point M3

  49. 3. The Match Operator Disjoint: no element appears in two tuples

More Related