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

generalising control dependence
SMART_READER_LITE
LIVE PREVIEW

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


slide-1
SLIDE 1

Generalising Control Dependence

10th CREST Open Workshop Program Analysis and Slicing Sebastian Danicic

Goldsmiths, University of London

25th January 2011

1 / 163

slide-2
SLIDE 2

Co-Authors

Richard W. Barraclough @UK PLC, Mark Harman Crest, University College London, UK ´ Akos Kiss University of Szeged, Hungary, Michael R. Laurence University of Sheffield, UK

2 / 163

slide-3
SLIDE 3

Control Dependence - a Brief History

3 / 163

slide-4
SLIDE 4

Control Dependence - a Brief History

1977 D. E. Denning, P. J. Denning,Certification of programs for secure information flow Communications of the ACM

4 / 163

slide-5
SLIDE 5

Control Dependence - a Brief History

1977 D. E. Denning, P. J. Denning,Certification of programs for secure information flow Communications of the ACM 1979 Weiser: PhD Thesis First use of Control Dependence in Slicing - although called something else.

5 / 163

slide-6
SLIDE 6

Control Dependence - a Brief History

1977 D. E. Denning, P. J. Denning,Certification of programs for secure information flow Communications of the ACM 1979 Weiser: PhD Thesis First use of Control Dependence in Slicing - although called something else. 1987 J. Ferrante, K. J. Ottenstein, J. D. Warren, The program dependence graph and its use in optimization, TOPLAS. First to use the term Control Dependence

6 / 163

slide-7
SLIDE 7

Control Dependence - a Brief History

1977 D. E. Denning, P. J. Denning,Certification of programs for secure information flow Communications of the ACM 1979 Weiser: PhD Thesis First use of Control Dependence in Slicing - although called something else. 1987 J. Ferrante, K. J. Ottenstein, J. D. Warren, The program dependence graph and its use in optimization, TOPLAS. First to use the term Control Dependence 1990 A. Podgurski, L. Clarke, A formal model of program dependences and its implications for software testing, debugging, and maintenance, TSE.

7 / 163

slide-8
SLIDE 8

Control Dependence - a Brief History

1977 D. E. Denning, P. J. Denning,Certification of programs for secure information flow Communications of the ACM 1979 Weiser: PhD Thesis First use of Control Dependence in Slicing - although called something else. 1987 J. Ferrante, K. J. Ottenstein, J. D. Warren, The program dependence graph and its use in optimization, TOPLAS. First to use the term Control Dependence 1990 A. Podgurski, L. Clarke, A formal model of program dependences and its implications for software testing, debugging, and maintenance, TSE. 1996 G. Bilardi, K. Pingali, A framework for generalized control dependence, in: PLDI.

8 / 163

slide-9
SLIDE 9

Control Dependence - a Brief History

1977 D. E. Denning, P. J. Denning,Certification of programs for secure information flow Communications of the ACM 1979 Weiser: PhD Thesis First use of Control Dependence in Slicing - although called something else. 1987 J. Ferrante, K. J. Ottenstein, J. D. Warren, The program dependence graph and its use in optimization, TOPLAS. First to use the term Control Dependence 1990 A. Podgurski, L. Clarke, A formal model of program dependences and its implications for software testing, debugging, and maintenance, TSE. 1996 G. Bilardi, K. Pingali, A framework for generalized control dependence, in: PLDI. 2007 V. P. Ranganath et al., A new foundation for control dependence and slicing for modern program structures, TOPLAS.

9 / 163

slide-10
SLIDE 10

Control Dependence - a Brief History

1977 D. E. Denning, P. J. Denning,Certification of programs for secure information flow Communications of the ACM 1979 Weiser: PhD Thesis First use of Control Dependence in Slicing - although called something else. 1987 J. Ferrante, K. J. Ottenstein, J. D. Warren, The program dependence graph and its use in optimization, TOPLAS. First to use the term Control Dependence 1990 A. Podgurski, L. Clarke, A formal model of program dependences and its implications for software testing, debugging, and maintenance, TSE. 1996 G. Bilardi, K. Pingali, A framework for generalized control dependence, in: PLDI. 2007 V. P. Ranganath et al., A new foundation for control dependence and slicing for modern program structures, TOPLAS. 2008 T. Amtoft, Slicing for modern program structures: a theory for eliminating irrelevant loops, IPL.

10 / 163

slide-11
SLIDE 11

Traditional (Ferrante et al.) Control Dependence

Node p controls node v if there is a path from p to end which does not pass through v but there is a successor of p from which all paths to end go through v.

11 / 163

slide-12
SLIDE 12

Traditional (Ferrante et al.) Control Dependence

Which nodes does p control? Node p controls node v if there is a path from p to end which does not pass through v but there is a successor of p from which all paths to end go through v.

12 / 163

slide-13
SLIDE 13

Traditional (Ferrante et al.) Control Dependence

Which nodes does p control? {q, v4, v5}, Node p controls node v if there is a path from p to end which does not pass through v but there is a successor of p from which all paths to end go through v.

13 / 163

slide-14
SLIDE 14

Traditional (Ferrante et al.) Control Dependence

Which nodes does p control? {q, v4, v5}, but not v3. Node p controls node v if there is a path from p to end which does not pass through v but there is a successor of p from which all paths to end go through v.

14 / 163

slide-15
SLIDE 15

Traditional (Ferrante et al.) Control Dependence

Which nodes does p control? {q, v4, v5}, but not v3. q controls v3. Node p controls node v if there is a path from p to end which does not pass through v but there is a successor of p from which all paths to end go through v.

15 / 163

slide-16
SLIDE 16

Traditional (Ferrante et al.) Control Dependence

Which nodes does p control? {q, v4, v5}, but not v3. q controls v3. So p transitively controls v3. Node p controls node v if there is a path from p to end which does not pass through v but there is a successor of p from which all paths to end go through v.

16 / 163

slide-17
SLIDE 17

Slicing - Data and Control Dependence

Slice at v5.

17 / 163

slide-18
SLIDE 18

Slicing - Data and Control Dependence

Slice at v5.

1 First add start and end. 18 / 163

slide-19
SLIDE 19

Slicing - Data and Control Dependence

Slice at v5.

1 First add start and end. 2 v5 is data dependent on v2. 19 / 163

slide-20
SLIDE 20

Slicing - Data and Control Dependence

Slice at v5.

1 First add start and end. 2 v5 is data dependent on v2. 3 v5 is control dependent on p. 20 / 163

slide-21
SLIDE 21

Slicing - Data and Control Dependence

Slice at v5.

1 First add start and end. 2 v5 is data dependent on v2. 3 v5 is control dependent on p. 4 p is data dependent on v1. 21 / 163

slide-22
SLIDE 22

Slicing - Data and Control Dependence

Slice at v5.

1 First add start and end. 2 v5 is data dependent on v2. 3 v5 is control dependent on p. 4 p is data dependent on v1. 5 The set of red nodes is closed under

control and data dependence

22 / 163

slide-23
SLIDE 23

Slicing - Data and Control Dependence

Slice at v5.

1 First add start and end. 2 v5 is data dependent on v2. 3 v5 is control dependent on p. 4 p is data dependent on v1. 5 The set of red nodes is closed under

control and data dependence

6 Remove the non-red nodes. 23 / 163

slide-24
SLIDE 24

Slicing - Data and Control Dependence

Slice at v5.

1 First add start and end. 2 v5 is data dependent on v2. 3 v5 is control dependent on p. 4 p is data dependent on v1. 5 The set of red nodes is closed under

control and data dependence

6 Remove the non-red nodes. 7 Finally, ‘rewire’ the graph. 24 / 163

slide-25
SLIDE 25

Rewiring

To rewire, add an edge between two red nodes if there is a path with no intervening red nodes. We label it with the same label as the initial edge.

25 / 163

slide-26
SLIDE 26

The Induced Graph

To rewire, add an edge between two red nodes if there is a path with no intervening red nodes. We label it with the same label as the initial edge.

26 / 163

slide-27
SLIDE 27

Slicing

So slicing involves computing a set closed under control and data and then building the induced graph.

27 / 163

slide-28
SLIDE 28

Slicing

Notice: non-termination may not be preserved.

28 / 163

slide-29
SLIDE 29

Slicing

Notice: non-termination may not be preserved. This is because traditional control dependence is ‘non-termination insensitve’.

29 / 163

slide-30
SLIDE 30

Slicing

Notice: non-termination may not be preserved. This is because traditional control dependence is ‘non-termination insensitve’. We prefer to call it weak.

30 / 163

slide-31
SLIDE 31

Slicing

What if you want slices to preserve non-termination?

31 / 163

slide-32
SLIDE 32

Slicing

What if you want slices to preserve non-termination? We need q to be included too.

32 / 163

slide-33
SLIDE 33

Slicing

but q does not control anything using the traditional definitions of Ferrante and Ottenstein (1987) and previously Weiser (1981).

33 / 163

slide-34
SLIDE 34

Slicing

Podgurski and Clarke (1990) introduced a form of control dependence which solved this problem.

34 / 163

slide-35
SLIDE 35

Slicing

Podgurski and Clarke (1990) introduced a form of control dependence which solved this problem. q controls end using their definition.

35 / 163

slide-36
SLIDE 36

Slicing

the slice produced using Podgurski and Clarke’s control dependence preserves non-termination.

36 / 163

slide-37
SLIDE 37

Slicing

Theirs is a ‘non-termination sensitive’ or as we prefer, strong form of control dependence.

37 / 163

slide-38
SLIDE 38

Two Forms of Slice

The weak slice and the strong slice

38 / 163

slide-39
SLIDE 39

Slicing

but Podgurski and Clarke’s definition only works if end is reachable from every node.

39 / 163

slide-40
SLIDE 40

Slicing

but Podgurski and Clarke’s definition only works if end is reachable from every node. This is not the case in reactive systems.

40 / 163

slide-41
SLIDE 41

Slicing Reactive Systems

41 / 163

slide-42
SLIDE 42

Slicing Reactive Systems

In reactive systems we have intentionally non-terminating programs.

42 / 163

slide-43
SLIDE 43

Slicing Reactive Systems

In reactive systems we have intentionally non-terminating programs. Here we have a ‘deliberate’ infinite loop.

43 / 163

slide-44
SLIDE 44

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

slide-45
SLIDE 45

Slicing Reactive Systems

The red set is closed under traditional control dependence and also under Podgurski and Clarke’s control dependence.

45 / 163

slide-46
SLIDE 46

Slicing Reactive Systems

The red set is closed under traditional control dependence and also under Podgurski and Clarke’s control dependence. But ...

46 / 163

slide-47
SLIDE 47

Slicing Reactive Systems

The induced graph isn’t even a legal CFG. v2 is a non-predicate of out degree greater than one.

47 / 163

slide-48
SLIDE 48

Slicing Reactive Systems

Ranganath et al. (2007) noticed that we need new forms of control dependence to solve this problem.

48 / 163

slide-49
SLIDE 49

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

slide-50
SLIDE 50

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

slide-51
SLIDE 51

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

slide-52
SLIDE 52

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

slide-53
SLIDE 53

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

slide-54
SLIDE 54

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

slide-55
SLIDE 55

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

slide-56
SLIDE 56

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

slide-57
SLIDE 57

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

slide-58
SLIDE 58

Weak Commitment-Closedness

We do not give yet another definition of control dependence.

58 / 163

slide-59
SLIDE 59

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

slide-60
SLIDE 60

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

slide-61
SLIDE 61

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

slide-62
SLIDE 62

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

slide-63
SLIDE 63

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

slide-64
SLIDE 64

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. v1 is S-weakly committing, since we always reach v2 first.

64 / 163

slide-65
SLIDE 65

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. v1 is S-weakly committing, since we always reach v2 first. So

is v4.

65 / 163

slide-66
SLIDE 66

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. v1 is S-weakly committing, since we always reach v2 first. So

is v4. Nodes p and q are not weakly committing.

66 / 163

slide-67
SLIDE 67

Definition: Weakly Commitment-closed Sets

A set S is weakly commitment-closed if all nodes not in S are S-weakly committing.

67 / 163

slide-68
SLIDE 68

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

slide-69
SLIDE 69

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

slide-70
SLIDE 70

Weakly Commitment-closed Sets in Reactive Systems

So let’s see how it works for reactive systems.

70 / 163

slide-71
SLIDE 71

Weakly Commitment-closed Sets in Reactive Systems

Which nodes are S-weakly committing?

71 / 163

slide-72
SLIDE 72

Weakly Commitment-closed Sets in Reactive Systems

Which nodes are S-weakly committing? v1, q and v4.

72 / 163

slide-73
SLIDE 73

Weakly Commitment-closed Sets in Reactive Systems

Which nodes are S-weakly committing? v1, q and v4. But not p. So S is not weak commitment-closed.

73 / 163

slide-74
SLIDE 74

Weakly Commitment-closed Sets in Reactive Systems

Which nodes are S-weakly committing? v1, q and v4. But not p. So S is not weak commitment-closed. So the induced graph is bad.

74 / 163

slide-75
SLIDE 75

Weakly Commitment-closed Sets in Reactive Systems

Now S is weakly commitment-closed!

75 / 163

slide-76
SLIDE 76

Weakly Commitment-closed Sets in Reactive Systems

Now S is weak commitment-closed! So the induced graph is good.

76 / 163

slide-77
SLIDE 77

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

slide-78
SLIDE 78

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

slide-79
SLIDE 79

Generality of WCC

Using Weak Commitment-Closedness, things like end reachability are

  • irrelevant. It ‘works’ for all directed graphs.

79 / 163

slide-80
SLIDE 80

Algorithm for WCC

We have an algorithm O(n3)log(n) which given any node set V , computes the minimal weakly commitment closed set containing V .

80 / 163

slide-81
SLIDE 81

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

slide-82
SLIDE 82

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

slide-83
SLIDE 83

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(n3)log(n) algorithm for this. This is the same as for Amtoft’s WOD − − − →.

83 / 163

slide-84
SLIDE 84

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(n3)log(n) algorithm for this. This is the same as for Amtoft’s WOD − − − →. We believe it can be improved to O(n3).

84 / 163

slide-85
SLIDE 85

Another Example

This set is weakly commitment-closed.

85 / 163

slide-86
SLIDE 86

Another Example

This set is weakly commitment-closed. What is the induced graph?

86 / 163

slide-87
SLIDE 87

Another Example

This set is weakly commitment-closed. This is the induced graph.

87 / 163

slide-88
SLIDE 88

Another Example

Any comments regarding non-termination?

88 / 163

slide-89
SLIDE 89

WCC does not preserve non-termination

It certainly does not preserve non-termination.

89 / 163

slide-90
SLIDE 90

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

slide-91
SLIDE 91

We need Strong Commitment Closedness for that.

To preserve non-termination we need strong commitment closedness.

91 / 163

slide-92
SLIDE 92

S-avoiding Nodes

A node is S-avoiding if no paths from it reach S.

92 / 163

slide-93
SLIDE 93

S-avoiding Nodes

A node is S-avoiding if no paths from it reach S. q, v3, v4 are S-avoiding .

93 / 163

slide-94
SLIDE 94

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

slide-95
SLIDE 95

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

slide-96
SLIDE 96

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. v1 is S-strongly committing.

96 / 163

slide-97
SLIDE 97

Strong Commitment Closedness

S is strongly commitment-closed if all elements not in S are either S-avoiding or S-strongly committing.

97 / 163

slide-98
SLIDE 98

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

slide-99
SLIDE 99

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

slide-100
SLIDE 100

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

slide-101
SLIDE 101

Graphs Induced from Strongly Commitment Closed Sets

So let’s look at this induced graph.

101 / 163

slide-102
SLIDE 102

Graphs Induced from Strongly Commitment Closed Sets

So let’s look at this induced graph.

102 / 163

slide-103
SLIDE 103

Incomplete Predicates

So let’s look at this induced graph. p is an ‘incomplete’ predicate.

103 / 163

slide-104
SLIDE 104

Interpreting Incomplete Predicates

So let’s look at this induced graph. p is an ‘incomplete’ predicate. How do we interpret this?

104 / 163

slide-105
SLIDE 105

Interpreting Incomplete Predicates

So let’s look at this induced graph. p is an ‘incomplete’ predicate. How do we interpret this? If p evaluates to T then we get silent non-termination.

105 / 163

slide-106
SLIDE 106

The Advantage of Incomplete Predicates

Using incomplete predicates for silent non-termination means that we don’t have to include ‘ghost’ control sinks that may introduce further unnecessary dependences.

106 / 163

slide-107
SLIDE 107

Theorem 2: Soundness and Completeness of SCC

For each form c of the strong forms of control dependence in the literature, S is closed under c if and only if S is strongly commitment-closed.

107 / 163

slide-108
SLIDE 108

Non-termination Sensitive Slicing using Strongly Commitment-closed Sets

So in Non-termination Sensitive Slicing slicing, given a slicing criterion V ′ we must find the minimal strongly commitment-closed set containing V ′.

108 / 163

slide-109
SLIDE 109

Non-termination Sensitive Slicing using Strongly Commitment-closed Sets

So in Non-termination Sensitive Slicing slicing, given a slicing criterion V ′ we must find the minimal strongly commitment-closed set containing V ′. Again, we have an O(n3)log(n) algorithm for this.

109 / 163

slide-110
SLIDE 110

Non-termination Sensitive Slicing using Strongly Commitment-closed Sets

So in Non-termination Sensitive Slicing slicing, given a slicing criterion V ′ we must find the minimal strongly commitment-closed set containing V ′. Again, we have an O(n3)log(n) algorithm for this. Again, we believe it can be improved to O(n3).

110 / 163

slide-111
SLIDE 111

Semantics?

What is the semantic relationship between a graph and the graphs induced by a weakly and strongly commitment-closed sets?

111 / 163

slide-112
SLIDE 112

Semantics Induced by Weakly Commitment-closed Sets

What is the semantic relationship between a graph and a graph induced by a weakly commitment-closed set?

112 / 163

slide-113
SLIDE 113

Walks

Walks are like paths where we also record whether the T or F branches were taken at the predicates.

113 / 163

slide-114
SLIDE 114

Examples of Walks

start, v1, v2

114 / 163

slide-115
SLIDE 115

Examples of Walks

start, v1, v2, (p, T)

115 / 163

slide-116
SLIDE 116

Examples of Walks

start, v1, v2, (p, T), (q, F), v4, v3, (q, T), v3

116 / 163

slide-117
SLIDE 117

Examples of Walks

start, v1, v2, (p, F), v5, end

117 / 163

slide-118
SLIDE 118

Walks of the Induced Graph

G1 G2 Let’s compare walks of the original graph with the walks of a graph induced by a weakly commitment closed set.

118 / 163

slide-119
SLIDE 119

Walks of the Induced Graph

G1 start, v1, v2 G2 start, v2

119 / 163

slide-120
SLIDE 120

Walks of the Induced Graph

G1 start, v1, v2, (p, T) G2 start, v2, (p, T)

120 / 163

slide-121
SLIDE 121

Walks of the Induced Graph

G1 start, v1, v2, (p, T), (q, F), v4, v3, (q, T), v3 G2 start, v2, (p, T), v3, v3

121 / 163

slide-122
SLIDE 122

Walks of the Induced Graph

G1 start, v1, v2, (p, F), v5, end G2 start, v2, (p, F), v5, end

122 / 163

slide-123
SLIDE 123

Walks of Graphs Induced from WCC Sets

G1 G2 What is the relationship between the walks of G1 and the walks of G2?

123 / 163

slide-124
SLIDE 124

Weak Projections

G1 G2 Every walk of G1 when restricted to G2 is a walk of G2.

124 / 163

slide-125
SLIDE 125

Weak Projections

G1 G2 Every walk of G1 when restricted to G2 is a walk of G2. We say G2 is a weak projection of G1.

125 / 163

slide-126
SLIDE 126

Theorem 3: Semantics of WCC

G1 G2 The graph induced from V is a weak projection if and only if V is weakly commitment-closed.

126 / 163

slide-127
SLIDE 127

Result

G1 G2 Theorems 1 and 3 imply that sets closed under all weak forms of control dependence in the literature induce weak projections.

127 / 163

slide-128
SLIDE 128

Weak Projections

G1 G2 So weak projection captures semantically what all previous authors of definitions of weak control dependence wanted to achieve!

128 / 163

slide-129
SLIDE 129

Weak Control Dependence

G1 G2 So authors of future definitions should also prove their definitions satisfy this property!

129 / 163

slide-130
SLIDE 130

Strong Control Dependence

G1 G2 What about graphs induced from strongly commitment-closed sets?

130 / 163

slide-131
SLIDE 131

Maximal Walks

Maximal walks are those which are not a prefix of any other walk.

131 / 163

slide-132
SLIDE 132

Maximal Walks corresponding to termination

The only maximal walks that correspond to termination are those whose final element is end.

132 / 163

slide-133
SLIDE 133

Maximal Walks corresponding to non-termination

All other finite maximal walks are considered non-terminating.

133 / 163

slide-134
SLIDE 134

Walks of Graphs Induced from SCC sets

start, v1, v2, (p, T), (q, T), v3, (q, F), v4, v3 . . .

134 / 163

slide-135
SLIDE 135

Walks of Graphs Induced from SCC sets

start, v1, v2, (p, T), (q, T), v3, (q, F), v4, v3 . . . start, v2, (p, T)

135 / 163

slide-136
SLIDE 136

Walks of Graphs Induced from SCC sets

What is the relationship between the two?

136 / 163

slide-137
SLIDE 137

Remember Weak Projections

G2 is a weak projection of G1 means every walk of G1 when restricted to G2 is a walk of G2.

137 / 163

slide-138
SLIDE 138

Strong Projections

G2 is a strong projection of G1 means every maximal walk of G1 when restricted to G2 is a maximal walk of G2.

138 / 163

slide-139
SLIDE 139

Theorem 4: Semantics of SCC

The graph induced from V is a strong projection if and only if V is strongly commitment-closed.

139 / 163

slide-140
SLIDE 140

Result

Theorems 2 and 4 imply that sets closed under all strong forms of control dependence in the literature induce strong projections.

140 / 163

slide-141
SLIDE 141

Strong Projection

So, again, strong projection captures semantically what all previous authors of definitions of strong control dependence wanted to achieve.

141 / 163

slide-142
SLIDE 142

Strong Projections are Non-Termination Preserving

It follows that strong projections are non-termination preserving.

142 / 163

slide-143
SLIDE 143

Strong Projections are Non-Termination Preserving

From this it follows that strong projections are non-termination preserving (as required!).

143 / 163

slide-144
SLIDE 144

Strong Projections with end preserve both

Also notice, strong projections are weak projections.

144 / 163

slide-145
SLIDE 145

Strong Projections with end preserve both

Also notice, strong projections are weak projections. But not vice-versa.

145 / 163

slide-146
SLIDE 146

Strong Projections with end preserve both

If end is in the weak projection, then the weak projection preserves termination.

146 / 163

slide-147
SLIDE 147

Strong Projections with end preserve both

So if end is in the strong projection, then the strong projection preserves both termination and non-termination.

147 / 163

slide-148
SLIDE 148

Conclusion

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)

148 / 163

slide-149
SLIDE 149

Conclusion

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?

149 / 163

slide-150
SLIDE 150

Conclusion

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!

150 / 163

slide-151
SLIDE 151

Conclusion

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?

151 / 163

slide-152
SLIDE 152

Conclusion

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!

152 / 163

slide-153
SLIDE 153

Conclusion

Weak (Non-termination sensitive):

W-controls

− − − − − − → (Weiser 1979)

F-controls

− − − − − − → (Ferrante and Ottenstein 1987)

WOD

− − − → (Amtoft 2007)

153 / 163

slide-154
SLIDE 154

Conclusion

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)

154 / 163

slide-155
SLIDE 155

Conclusions

155 / 163

slide-156
SLIDE 156

Conclusions

We have generalised non-termination insensitive and sensitive control dependence by defining and giving algorithms for weak and strong commitment-closedness.

156 / 163

slide-157
SLIDE 157

Conclusions

We have generalised non-termination insensitive and sensitive control dependence by defining and giving algorithms for weak and strong commitment-closedness. Theorem 1: A set is closed under each of the weak forms of control dependence in the literature if and only if it is weakly commitment-closed.

157 / 163

slide-158
SLIDE 158

Conclusions

We have generalised non-termination insensitive and sensitive control dependence by defining and giving algorithms for weak and strong commitment-closedness. Theorem 1: A set is closed under each of the weak forms of control dependence in the literature if and only if it is weakly commitment-closed. Theorem 2: A set is closed under each of the strong forms of control dependence in the literature if and only if it is strongly commitment-closed.

158 / 163

slide-159
SLIDE 159

Conclusions

We have generalised non-termination insensitive and sensitive control dependence by defining and giving algorithms for weak and strong commitment-closedness. Theorem 1: A set is closed under each of the weak forms of control dependence in the literature if and only if it is weakly commitment-closed. Theorem 2: A set is closed under each of the strong forms of control dependence in the literature if and only if it is strongly commitment-closed. We defined semantic relations: weak and strong projections between graphs in terms of walks.

159 / 163

slide-160
SLIDE 160

Conclusions

We have generalised non-termination insensitive and sensitive control dependence by defining and giving algorithms for weak and strong commitment-closedness. Theorem 1: A set is closed under each of the weak forms of control dependence in the literature if and only if it is weakly commitment-closed. Theorem 2: A set is closed under each of the strong forms of control dependence in the literature if and only if it is strongly commitment-closed. We defined semantic relations: weak and strong projections between graphs in terms of walks. Theorem 3: The graph induced from V is a weak projection if and

  • nly if V is weakly commitment-closed.

160 / 163

slide-161
SLIDE 161

Conclusions

We have generalised non-termination insensitive and sensitive control dependence by defining and giving algorithms for weak and strong commitment-closedness. Theorem 1: A set is closed under each of the weak forms of control dependence in the literature if and only if it is weakly commitment-closed. Theorem 2: A set is closed under each of the strong forms of control dependence in the literature if and only if it is strongly commitment-closed. We defined semantic relations: weak and strong projections between graphs in terms of walks. Theorem 3: The graph induced from V is a weak projection if and

  • nly if V is weakly commitment-closed.

Theorem 4: The graph induced from V is a strong projection if and

  • nly if V is strongly commitment-closed.

161 / 163

slide-162
SLIDE 162

The End

Thanks for listening?

162 / 163

slide-163
SLIDE 163

The End

Thanks for listening? Any questions?

163 / 163