1 / 30

Exploring Clear Clones Based on Splitting Iteration Structure and Selection Structure

Exploring Clear Clones Based on Splitting Iteration Structure and Selection Structure. Chung Yung and Yen-Chang Lai. Reporter: Qin- Xin Tu. Outline:. Abstract Definitions Splitting Iteration Structure Splitting Selection Structure Conclusion. Abstract(1):.

bruce-wade
Download Presentation

Exploring Clear Clones Based on Splitting Iteration Structure and Selection Structure

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. Exploring Clear Clones Based on Splitting Iteration Structure and Selection Structure Chung Yung and Yen-Chang Lai Reporter: Qin-XinTu

  2. Outline: • Abstract • Definitions • Splitting Iteration Structure • Splitting Selection Structure • Conclusion

  3. Abstract(1): • This paper focuses on finding clear clones. • If a fragment do not have any non-duplicate statements, we can extract it into a new procedure more easy.

  4. Abstract(2): • For this reason, this paper present a new framework for finding clear clones : • Splitting iteration structure. • Splitting selection structure.

  5. Definitions(1): • They present some definitions of symbols to finding clear clones: • :Ex a b

  6. Definitions(3): • Use-Def : Ex (a) Use-Def (b)

  7. Definitions(4): • Def-Def :Ex (a) Def-Def (b)

  8. Definitions(5): • Splitting: • They use three buckets to place the statements: before bucket, after bucket, and marked bucket. • First, they place the clone into the market bucket. Then, they move the non-duplicate statements out the market. • Finally, they hope the statements in the market bucket can extract into a clear clone.

  9. Definitions(2): • Def-Use: Ex (a) Def-Use (b)

  10. Splitting Iteration Structure(1): • There have five steps show as following: Step1 Determining ordering constrains. Step2 Preserving the initial value of loop condition. Step3 Preserving the times of loop execution. Step4 Moving statements. Step5 Promoting remainder statement.

  11. Splitting Iteration Structure(2): • I use the following fragment as my example:

  12. Splitting Iteration Structure(3): • Step 1: In the step, they determine the ordering constrain as following. • : ex (7) (9). • Def-Use: ex (2) Def-Use (9). • Use-Def: ex (1) Use-Def (8). • Def-Def: ex (5) Def-Def (9).

  13. Splitting Iteration Structure(4): • Step 2: In the step, they preserve the initial value of loop condition show as following:

  14. Splitting Iteration Structure(5): • Step 3: In the step, they hope the result after splitting can be the same as before splitting. They preserve the statements by the following four rules: • If x is a conditional statement of loop, y Def-Use x and x Use-Def y , the y is marked with ‘‘**’’. • If x is a statement marked with ‘‘’**’, y Def-Use x and x Use-Def y , the y marks with ‘‘**’’.

  15. Splitting Iteration Structure(6): • Step 3: (3) If x and y are two marked statements, x Def-Use y and x Use-Def y , the variables of x and y must be preserved. (4) If x is marked with ‘‘**’’, x is copied to other bucket, its conditional statement must be copied to the same bucket. ex Statement (8) must be marked because rule (1). Statement (3) and (6) must be marked because rule (2). Because rule (3), the variables of statement (6) must be preserved.

  16. Splitting Iteration Structure(7): • Step 4: In the step, they move the unmarked statements to other buckets by following rules: • If x is a clone statement, x Def-Use y, the y can be moved to after bucket. • If y is a clone statement, x Def-Use y, the x can be moved to before bucket. • If x is a clone statement and marked with ‘‘**’’, x Def-Use y, the y can be moved to after or before buckets.

  17. Splitting Iteration Structure(8): • Step 4: (4) If x is a clone statement, x Use-Def y, the y can not be moved to after bucket. (5) If y is a clone statement, x Use-Def y, the x can not be moved to before bucket. (6) If y is a clone statement and marked with ‘‘**’’, x Use-Def y, the x can be moved to after or before buckets. (7) If x is a clone statement, x Def-Def y, the y can be moved to after bucket.

  18. Splitting Iteration Structure(9): • Step 4: (8) If y is a clone statement, x Def-Def y, the x can be moved to before bucket. (9) If x is a clone statement and marked with ‘‘**’’, x Def-Def y, the y can be moved to after or before buckets. (10) If y is marked with ‘‘**’’, x Def-Def y, the x can be moved to after or before bucket. (11) If a statement is not clone, it do not change and do not use by other statements. The statement can be moved to after or before buckets.

  19. Splitting Iteration Structure(10): • Step 4: ex: • Because rule (2), statement (2) Def-Use (4). We can move statement (2) to before bucket. • Because rule (3), statement (3) Def-Use (5). We can move statement (5) to after or before buckets.

  20. Splitting Iteration Structure(11): • Step 5: In the step, they let those statements which are non-duplicate and can not be moved out become duplicate. They use the following holds to finding the statement (n) which needs be promoted: • The statement (n) is marked with ‘‘**’’, or • The statement (a) and (b) are clone, (a) (n) and (a) (b)

  21. Splitting Iteration Structure(12): • The result after splitting iteration structure is show as following:

  22. Splitting Selection Structure(1): • There have four steps show as following: Step1 Determining ordering constrains. Step2 Preserving the times of loop execution. Step3 Moving the unmarked statements. Step4 Promoting remainder statement.

  23. Splitting Selection Structure(2): • I use the following fragment as my example:

  24. Splitting Selection Structure(3): • Step 1: In the step, they determine the ordering constrains as following. • : ex (1) (2),(3),(4),(5)and(6). • Def-Use: ex (2) Def-Use (5), (3) Def-Use (4). • Use-Def: ex (2) Use-Def (3), (5) Use-Def (6). • Def-Def: ex (4) Def-Def (6).

  25. Splitting Selection Structure(4): • Step 2: In the step, they preserve the initial value of loop condition show as following:

  26. Splitting Selection Structure(5): • Step 3: In the step, they move the non-duplicate statements out the market bucket by the ordering constrains in step 1. ex: From the figure in step 2, we find statements (4), (6), and (8) are non-duplicate. The statement (4) can be moved to before bucket, because (4) Use-Def (5) and (4) Def-Use (7). The statement (8) can be moved to after bucket, because (7) Use-Def (8).

  27. Splitting Selection Structure(6): • Step 3: The result shows as following:

  28. Splitting Selection Structure(7): • Step 4: After step 3, the market bucket may still have non-duplicate statement. They use the following holds to finding the statement (n) which needs be promoted: • (a) (n) and (n) (b) ex: From the figure in step 3, statement (7) is non-duplicate, and (6) (7), (7) (8). The statement (7) needs be promoted.

  29. Splitting Selection Structure(8): • Step 4: The result shows as following:

  30. Conclusion(1): • We can get the clear clone by splitting iteration structure or splitting selection structure. • By the approach in the paper, we can the get clear clone from the clone which is in iteration structure or selection structure. Komondoor and Horwitz’s approach can not do it.

More Related