generalising control dependence
play

Generalising Control Dependence 10th CREST Open Workshop Program - PowerPoint PPT Presentation

Generalising Control Dependence 10th CREST Open Workshop Program Analysis and Slicing Sebastian Danicic Goldsmiths, University of London 25th January 2011 1 / 163 Co-Authors Richard W. Barraclough @UK PLC, Mark Harman Crest, University


  1. Slicing Reactive Systems In reactive systems we have intentionally non-terminating programs. 42 / 163

  2. Slicing Reactive Systems In reactive systems we have intentionally non-terminating programs. Here we have a ‘deliberate’ infinite loop. 43 / 163

  3. Slicing Reactive Systems In reactive systems we have intentionally non-terminating programs. Here we have a ‘deliberate’ infinite loop. This is a problem. 44 / 163

  4. Slicing Reactive Systems The red set is closed under traditional control dependence and also under Podgurski and Clarke’s control dependence. 45 / 163

  5. Slicing Reactive Systems The red set is closed under traditional control dependence and also under Podgurski and Clarke’s control dependence. But ... 46 / 163

  6. Slicing Reactive Systems The induced graph isn’t even a legal CFG. v 2 is a non-predicate of out degree greater than one. 47 / 163

  7. Slicing Reactive Systems Ranganath et al. (2007) noticed that we need new forms of control dependence to solve this problem. 48 / 163

  8. Slicing Reactive Systems They introduced NTSCD → and DOD − − − − − − − − → which produced strong slices for reactive systems. (A generalisation of Podgurski and Clarke’s definition). 49 / 163

  9. Slicing Reactive Systems Later Amtoft (2008) produced WOD − − − → which gives rise to weak slices of reactive systems. (A generalisation of Ferrante et al.’s definition). 50 / 163

  10. Contributions of our Work W-controls − − − − − − → (Weiser 1979) F-controls − − − − − − → (Ferrante and Ottenstein 1987) PC-weak − − − − − → (Podgurski and Clarke 1990) NTSCD → and DOD − − − − − − − − → (Ranganath et al 2006) WOD − − − → (Amtoft 2007) 51 / 163

  11. Contributions of our Work W-controls − − − − − − → (Weiser 1979) F-controls − − − − − − → (Ferrante and Ottenstein 1987) PC-weak − − − − − → (Podgurski and Clarke 1990) NTSCD → and DOD − − − − − − − − → (Ranganath et al 2006) WOD − − − → (Amtoft 2007) Can they be generalised in a nice high-level way? 52 / 163

  12. Contributions of our Work W-controls − − − − − − → (Weiser 1979) F-controls − − − − − − → (Ferrante and Ottenstein 1987) PC-weak − − − − − → (Podgurski and Clarke 1990) NTSCD → and DOD − − − − − − − − → (Ranganath et al 2006) WOD − − − → (Amtoft 2007) Can they be generalised in a nice high-level way? yes! 53 / 163

  13. Contributions of our Work W-controls − − − − − − → (Weiser 1979) F-controls − − − − − − → (Ferrante and Ottenstein 1987) PC-weak − − − − − → (Podgurski and Clarke 1990) NTSCD → and DOD − − − − − − − − → (Ranganath et al 2006) WOD − − − → (Amtoft 2007) Can they be generalised in a nice high-level way? yes! Are there underlying semantic properties captured by all these different forms of control dependence? 54 / 163

  14. Contributions of our Work W-controls − − − − − − → (Weiser 1979) F-controls − − − − − − → (Ferrante and Ottenstein 1987) PC-weak − − − − − → (Podgurski and Clarke 1990) NTSCD → and DOD − − − − − − − − → (Ranganath et al 2006) WOD − − − → (Amtoft 2007) Can they be generalised in a nice high-level way? yes! Are there underlying semantic properties captured by all these different forms of control dependence? yes! 55 / 163

  15. Categorisation of the Different Forms of Control Dependence Weak (Non-termination sensitive): W-controls − − − − − − → (Weiser 1979) F-controls − − − − − − → (Ferrante and Ottenstein 1987) WOD − − − → (Amtoft 2007) 56 / 163

  16. Categorisation of the Different Forms of Control Dependence Weak (Non-termination sensitive): W-controls − − − − − − → (Weiser 1979) F-controls − − − − − − → (Ferrante and Ottenstein 1987) WOD − − − → (Amtoft 2007) Strong (Non-termination sensitive): PC-weak − − − − − → (Podgurski and Clarke 1990) NTSCD → and DOD − − − − − − − − → (Ranganath et al 2006) 57 / 163

  17. Weak Commitment-Closedness We do not give yet another definition of control dependence. 58 / 163

  18. Weak Commitment-Closedness We do not give yet another definition of control dependence. Instead we give a property of sets closed under non-termination insensitive control dependence. 59 / 163

  19. Weak Commitment-Closedness We do not give yet another definition of control dependence. Instead we give a property of sets closed under non-termination insensitive control dependence. The sets are Weak commitment-closed 60 / 163

  20. Weak Commitment-Closedness We do not give yet another definition of control dependence. Instead we give a property of sets closed under non-termination insensitive control dependence. The sets are Weak commitment-closed This definition works for all directed graphs and is hence more general. 61 / 163

  21. Definition: S -Weakly Committing Nodes A node is S -weakly committing if on every path from it we reach the same element of S first. 62 / 163

  22. Definition: S -Weakly Committing Nodes A node is S -weakly committing if on every path from it we reach the same element of S first. Trivially, all elements of S are S -weakly committing. 63 / 163

  23. Definition: S -Weakly Committing Nodes A node is S -weakly committing if on every path from it we reach the same element of S first. Trivially, all elements of S are S -weakly committing. v 1 is S -weakly committing, since we always reach v 2 first. 64 / 163

  24. Definition: S -Weakly Committing Nodes A node is S -weakly committing if on every path from it we reach the same element of S first. Trivially, all elements of S are S -weakly committing. v 1 is S -weakly committing, since we always reach v 2 first. So is v 4 . 65 / 163

  25. Definition: S -Weakly Committing Nodes A node is S -weakly committing if on every path from it we reach the same element of S first. Trivially, all elements of S are S -weakly committing. v 1 is S -weakly committing, since we always reach v 2 first. So is v 4 . Nodes p and q are not weakly committing. 66 / 163

  26. Definition: Weakly Commitment-closed Sets A set S is weakly commitment-closed if all nodes not in S are S -weakly committing. 67 / 163

  27. Definition: Weakly Commitment-closed Sets A set S is weakly commitment-closed if all nodes not in S are S -weakly committing. This S is not weakly commitment-closed. 68 / 163

  28. Definition: Weakly Commitment-closed Sets A set S is weakly commitment-closed if all nodes not in S are S -weakly committing. This S is not weakly commitment-closed. Now it is! 69 / 163

  29. Weakly Commitment-closed Sets in Reactive Systems So let’s see how it works for reactive systems. 70 / 163

  30. Weakly Commitment-closed Sets in Reactive Systems Which nodes are S -weakly committing? 71 / 163

  31. Weakly Commitment-closed Sets in Reactive Systems Which nodes are S -weakly committing? v 1 , q and v 4 . 72 / 163

  32. Weakly Commitment-closed Sets in Reactive Systems Which nodes are S -weakly committing? v 1 , q and v 4 . But not p . So S is not weak commitment-closed. 73 / 163

  33. Weakly Commitment-closed Sets in Reactive Systems Which nodes are S -weakly committing? v 1 , q and v 4 . But not p . So S is not weak commitment-closed. So the induced graph is bad. 74 / 163

  34. Weakly Commitment-closed Sets in Reactive Systems Now S is weakly commitment-closed! 75 / 163

  35. Weakly Commitment-closed Sets in Reactive Systems Now S is weak commitment-closed! So the induced graph is good. 76 / 163

  36. Theorem 1: Soundness and Completeness of WCC For each weak form of control dependence c in the literature, a set S is closed under c if and only if S is weakly commitment-closed. 77 / 163

  37. Generality of WCC The beauty of weak commitment-closedness is that there is no need to consider special cases considered by previous authors. It works for them all. 78 / 163

  38. Generality of WCC Using Weak Commitment-Closedness, things like end reachability are irrelevant. It ‘works’ for all directed graphs. 79 / 163

  39. Algorithm for WCC We have an algorithm O ( n 3 ) log ( n ) which given any node set V , computes the minimal weakly commitment closed set containing V . 80 / 163

  40. Using WCC Because of Theorem 1, this algorithm can be used in all cases instead of the weak forms of control dependence in the literature. 81 / 163

  41. Traditional Slicing using Weakly Commitment-closed Sets So in traditional slicing, given a slicing criterion V ′ we must find the minimal weakly commitment closed set containing V ′ . 82 / 163

  42. Traditional Slicing using Weakly Commitment-closed Sets So in traditional slicing, given a slicing criterion V ′ we must find the minimal weakly commitment closed set containing V ′ . We have an O ( n 3 ) log ( n ) algorithm for this. This is the same as for Amtoft’s WOD − − − → . 83 / 163

  43. Traditional Slicing using Weakly Commitment-closed Sets So in traditional slicing, given a slicing criterion V ′ we must find the minimal weakly commitment closed set containing V ′ . We have an O ( n 3 ) log ( n ) algorithm for this. This is the same as for Amtoft’s WOD − − − → . We believe it can be improved to O ( n 3 ). 84 / 163

  44. Another Example This set is weakly commitment-closed. 85 / 163

  45. Another Example This set is weakly commitment-closed. What is the induced graph? 86 / 163

  46. Another Example This set is weakly commitment-closed. This is the induced graph. 87 / 163

  47. Another Example Any comments regarding non-termination? 88 / 163

  48. WCC does not preserve non-termination It certainly does not preserve non-termination. 89 / 163

  49. WCC does not preserve non-termination It certainly does not preserve non-termination. But that’s not surprising because this is weak commitment-closedness. 90 / 163

  50. We need Strong Commitment Closedness for that. To preserve non-termination we need strong commitment closedness. 91 / 163

  51. S -avoiding Nodes A node is S -avoiding if no paths from it reach S . 92 / 163

  52. S -avoiding Nodes A node is S -avoiding if no paths from it reach S . q , v 3 , v 4 are S -avoiding . 93 / 163

  53. S -Strongly Committing Nodes A node is S -strongly committing if it is S -weakly committing and all paths from it eventually reach S . 94 / 163

  54. S -Strongly Committing Nodes A node is S -strongly committing if it is S -weakly committing and all paths from it eventually reach S . i.e. all paths from it reach the same element of S first. 95 / 163

  55. S -Strongly Committing Nodes A node is S -strongly committing if it is S -weakly committing and all paths from it eventually reach S . i.e. all paths from it reach the same element of S first. v 1 is S -strongly committing. 96 / 163

  56. Strong Commitment Closedness S is strongly commitment-closed if all elements not in S are either S -avoiding or S -strongly committing. 97 / 163

  57. Strong Commitment Closedness S is strongly commitment-closed if all elements not in S are either S -avoiding or S -strongly committing. p is neither S -avoiding nor S -strongly committing. 98 / 163

  58. Strong Commitment Closedness S is strongly commitment-closed if all elements not in S are either S -avoiding or S -strongly committing. p is neither S -avoiding nor S -strongly committing. So S is not strongly commitment-closed. 99 / 163

  59. Strong Commitment Closedness S is strongly commitment-closed if all elements not in S are either S -avoiding or S -strongly committing. p is neither S -avoiding nor S -strongly committing. So S is not strongly commitment-closed. Now it is! 100 / 163

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend