1 Termination and shape-shifting heaps Byron Cook [email protected] Microsoft Research, Cambridge...

67
1 Termination and shape-shifting heaps Byron Cook [email protected] Microsoft Research, Cambridge Joint work with Josh Berdine, Dino Distefano, and Peter O’Hearn

Transcript of 1 Termination and shape-shifting heaps Byron Cook [email protected] Microsoft Research, Cambridge...

Page 1: 1 Termination and shape-shifting heaps Byron Cook bycook@microsoft.com Microsoft Research, Cambridge Joint work with Josh Berdine, Dino Distefano, and.

1

Termination and shape-shifting heaps

Byron Cook

[email protected]

Microsoft Research, Cambridge

Joint work with Josh Berdine, Dino Distefano, and Peter O’Hearn

Page 2: 1 Termination and shape-shifting heaps Byron Cook bycook@microsoft.com Microsoft Research, Cambridge Joint work with Josh Berdine, Dino Distefano, and.

2

0

5

10

15

20

25

30

35

40

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23

0

10

20

30

40

50

60

70

80

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23

Lines of code (x1000)

Cut-point set size

Experimental results with Terminator [CAV’06,PLDI’06,SAS’05]

Page 3: 1 Termination and shape-shifting heaps Byron Cook bycook@microsoft.com Microsoft Research, Cambridge Joint work with Josh Berdine, Dino Distefano, and.

3

0

5

10

15

20

25

30

35

40

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23

0

10

20

30

40

50

60

70

80

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23

Lines of code (x1000)

Cut-point set size

0

2

4

6

8

10

12

1 3 5 7 9 11 13 15 17 19 21 23

True bugs

False bugs

Experimental results with Terminator [CAV’06,PLDI’06,SAS’05]

Page 4: 1 Termination and shape-shifting heaps Byron Cook bycook@microsoft.com Microsoft Research, Cambridge Joint work with Josh Berdine, Dino Distefano, and.

4

0

5

10

15

20

25

30

35

40

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23

0

10

20

30

40

50

60

70

80

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23

Lines of code (x1000)

Cut-point set size

0

2

4

6

8

10

12

1 3 5 7 9 11 13 15 17 19 21 23

True bugs

False bugs

Experimental results with Terminator [CAV’06,PLDI’06,SAS’05]

Page 5: 1 Termination and shape-shifting heaps Byron Cook bycook@microsoft.com Microsoft Research, Cambridge Joint work with Josh Berdine, Dino Distefano, and.

5

0

5

10

15

20

25

30

35

40

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23

0

10

20

30

40

50

60

70

80

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23

Lines of code (x1000)

Cut-point set size

0

2

4

6

8

10

12

1 3 5 7 9 11 13 15 17 19 21 23

True bugs

False bugs

Experimental results with Terminator [CAV’06,PLDI’06,SAS’05]

Page 6: 1 Termination and shape-shifting heaps Byron Cook bycook@microsoft.com Microsoft Research, Cambridge Joint work with Josh Berdine, Dino Distefano, and.

6

Experimental results with Terminator [CAV’06,PLDI’06,SAS’05]

0

5

10

15

20

25

30

35

40

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23

0

10

20

30

40

50

60

70

80

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23

Lines of code (x1000)

Cut-point set size

0

2

4

6

8

10

12

1 3 5 7 9 11 13 15 17 19 21 23

True bugs

False bugs

Page 7: 1 Termination and shape-shifting heaps Byron Cook bycook@microsoft.com Microsoft Research, Cambridge Joint work with Josh Berdine, Dino Distefano, and.

7

Outline

Introduction

TERMINATOR’s proof rule

MUTANT/TERMINATOR

Experimental results

Conclusion & Discussion

Page 8: 1 Termination and shape-shifting heaps Byron Cook bycook@microsoft.com Microsoft Research, Cambridge Joint work with Josh Berdine, Dino Distefano, and.

8

Outline

Introduction

TERMINATOR’s proof rule

MUTANT/TERMINATOR

Experimental results

Conclusion & Discussion

Page 9: 1 Termination and shape-shifting heaps Byron Cook bycook@microsoft.com Microsoft Research, Cambridge Joint work with Josh Berdine, Dino Distefano, and.

9

TERMINATOR’s proof rule

Page 10: 1 Termination and shape-shifting heaps Byron Cook bycook@microsoft.com Microsoft Research, Cambridge Joint work with Josh Berdine, Dino Distefano, and.

10

TERMINATOR’s proof rule

Page 11: 1 Termination and shape-shifting heaps Byron Cook bycook@microsoft.com Microsoft Research, Cambridge Joint work with Josh Berdine, Dino Distefano, and.

11

TERMINATOR’s proof rule

Page 12: 1 Termination and shape-shifting heaps Byron Cook bycook@microsoft.com Microsoft Research, Cambridge Joint work with Josh Berdine, Dino Distefano, and.

12

TERMINATOR’s proof rule

Page 13: 1 Termination and shape-shifting heaps Byron Cook bycook@microsoft.com Microsoft Research, Cambridge Joint work with Josh Berdine, Dino Distefano, and.

13

TERMINATOR’s proof rule

Page 14: 1 Termination and shape-shifting heaps Byron Cook bycook@microsoft.com Microsoft Research, Cambridge Joint work with Josh Berdine, Dino Distefano, and.

14

TERMINATOR’s proof rule

Ø

Page 15: 1 Termination and shape-shifting heaps Byron Cook bycook@microsoft.com Microsoft Research, Cambridge Joint work with Josh Berdine, Dino Distefano, and.

15

TERMINATOR’s proof rule

Ø

Page 16: 1 Termination and shape-shifting heaps Byron Cook bycook@microsoft.com Microsoft Research, Cambridge Joint work with Josh Berdine, Dino Distefano, and.

16

TERMINATOR’s proof rule

Page 17: 1 Termination and shape-shifting heaps Byron Cook bycook@microsoft.com Microsoft Research, Cambridge Joint work with Josh Berdine, Dino Distefano, and.

17

TERMINATOR’s proof rule

Page 18: 1 Termination and shape-shifting heaps Byron Cook bycook@microsoft.com Microsoft Research, Cambridge Joint work with Josh Berdine, Dino Distefano, and.

18

TERMINATOR’s proof rule

Page 19: 1 Termination and shape-shifting heaps Byron Cook bycook@microsoft.com Microsoft Research, Cambridge Joint work with Josh Berdine, Dino Distefano, and.

19

TERMINATOR’s proof rule

Page 20: 1 Termination and shape-shifting heaps Byron Cook bycook@microsoft.com Microsoft Research, Cambridge Joint work with Josh Berdine, Dino Distefano, and.

20

TERMINATOR’s proof rule

Page 21: 1 Termination and shape-shifting heaps Byron Cook bycook@microsoft.com Microsoft Research, Cambridge Joint work with Josh Berdine, Dino Distefano, and.

21

TERMINATOR’s proof rule

Page 22: 1 Termination and shape-shifting heaps Byron Cook bycook@microsoft.com Microsoft Research, Cambridge Joint work with Josh Berdine, Dino Distefano, and.

22

TERMINATOR’s proof rule

Page 23: 1 Termination and shape-shifting heaps Byron Cook bycook@microsoft.com Microsoft Research, Cambridge Joint work with Josh Berdine, Dino Distefano, and.

23

TERMINATOR’s proof rule

Page 24: 1 Termination and shape-shifting heaps Byron Cook bycook@microsoft.com Microsoft Research, Cambridge Joint work with Josh Berdine, Dino Distefano, and.

24

Outline

Introduction

TERMINATOR’s proof rule

MUTANT/TERMINATOR

Experimental results

Conclusion & Discussion

Page 25: 1 Termination and shape-shifting heaps Byron Cook bycook@microsoft.com Microsoft Research, Cambridge Joint work with Josh Berdine, Dino Distefano, and.

25

Outline

Introduction

TERMINATOR’s proof rule

MUTANT/TERMINATOR

Experimental results

Conclusion & Discussion

Page 26: 1 Termination and shape-shifting heaps Byron Cook bycook@microsoft.com Microsoft Research, Cambridge Joint work with Josh Berdine, Dino Distefano, and.

26

Reversing the strategy

Page 27: 1 Termination and shape-shifting heaps Byron Cook bycook@microsoft.com Microsoft Research, Cambridge Joint work with Josh Berdine, Dino Distefano, and.

27

Reversing the strategy

Page 28: 1 Termination and shape-shifting heaps Byron Cook bycook@microsoft.com Microsoft Research, Cambridge Joint work with Josh Berdine, Dino Distefano, and.

28

Reversing the strategy

Page 29: 1 Termination and shape-shifting heaps Byron Cook bycook@microsoft.com Microsoft Research, Cambridge Joint work with Josh Berdine, Dino Distefano, and.

29

Reversing the strategy

Page 30: 1 Termination and shape-shifting heaps Byron Cook bycook@microsoft.com Microsoft Research, Cambridge Joint work with Josh Berdine, Dino Distefano, and.

30

Reversing the strategy

Page 31: 1 Termination and shape-shifting heaps Byron Cook bycook@microsoft.com Microsoft Research, Cambridge Joint work with Josh Berdine, Dino Distefano, and.

31

Reversing the strategy

Page 32: 1 Termination and shape-shifting heaps Byron Cook bycook@microsoft.com Microsoft Research, Cambridge Joint work with Josh Berdine, Dino Distefano, and.

32

Mutant

Page 33: 1 Termination and shape-shifting heaps Byron Cook bycook@microsoft.com Microsoft Research, Cambridge Joint work with Josh Berdine, Dino Distefano, and.

33

Mutant

Page 34: 1 Termination and shape-shifting heaps Byron Cook bycook@microsoft.com Microsoft Research, Cambridge Joint work with Josh Berdine, Dino Distefano, and.

34

Mutant example

Page 35: 1 Termination and shape-shifting heaps Byron Cook bycook@microsoft.com Microsoft Research, Cambridge Joint work with Josh Berdine, Dino Distefano, and.

35

Mutant example

Page 36: 1 Termination and shape-shifting heaps Byron Cook bycook@microsoft.com Microsoft Research, Cambridge Joint work with Josh Berdine, Dino Distefano, and.

36

Mutant example

Page 37: 1 Termination and shape-shifting heaps Byron Cook bycook@microsoft.com Microsoft Research, Cambridge Joint work with Josh Berdine, Dino Distefano, and.

37

Mutant example

Page 38: 1 Termination and shape-shifting heaps Byron Cook bycook@microsoft.com Microsoft Research, Cambridge Joint work with Josh Berdine, Dino Distefano, and.

38

Mutant example

Page 39: 1 Termination and shape-shifting heaps Byron Cook bycook@microsoft.com Microsoft Research, Cambridge Joint work with Josh Berdine, Dino Distefano, and.

39

Mutant example

Page 40: 1 Termination and shape-shifting heaps Byron Cook bycook@microsoft.com Microsoft Research, Cambridge Joint work with Josh Berdine, Dino Distefano, and.

40

Outline

Introduction

TERMINATOR’s proof rule

MUTANT/TERMINATOR

Experimental results

Conclusion & Discussion

Page 41: 1 Termination and shape-shifting heaps Byron Cook bycook@microsoft.com Microsoft Research, Cambridge Joint work with Josh Berdine, Dino Distefano, and.

41

Outline

Introduction

TERMINATOR’s proof rule

MUTANT/TERMINATOR

Experimental results

Conclusion & Discussion

Page 42: 1 Termination and shape-shifting heaps Byron Cook bycook@microsoft.com Microsoft Research, Cambridge Joint work with Josh Berdine, Dino Distefano, and.

42

Experimental results

Revisiting loops falsely accused with TERMINATOR:

Page 43: 1 Termination and shape-shifting heaps Byron Cook bycook@microsoft.com Microsoft Research, Cambridge Joint work with Josh Berdine, Dino Distefano, and.

43

Introduction

Page 44: 1 Termination and shape-shifting heaps Byron Cook bycook@microsoft.com Microsoft Research, Cambridge Joint work with Josh Berdine, Dino Distefano, and.

44

Introduction

Page 45: 1 Termination and shape-shifting heaps Byron Cook bycook@microsoft.com Microsoft Research, Cambridge Joint work with Josh Berdine, Dino Distefano, and.

45

Introduction

Page 46: 1 Termination and shape-shifting heaps Byron Cook bycook@microsoft.com Microsoft Research, Cambridge Joint work with Josh Berdine, Dino Distefano, and.

46

Introduction

Page 47: 1 Termination and shape-shifting heaps Byron Cook bycook@microsoft.com Microsoft Research, Cambridge Joint work with Josh Berdine, Dino Distefano, and.

47

Introduction

Page 48: 1 Termination and shape-shifting heaps Byron Cook bycook@microsoft.com Microsoft Research, Cambridge Joint work with Josh Berdine, Dino Distefano, and.

48

Introduction

Page 49: 1 Termination and shape-shifting heaps Byron Cook bycook@microsoft.com Microsoft Research, Cambridge Joint work with Josh Berdine, Dino Distefano, and.

49

Introduction

Page 50: 1 Termination and shape-shifting heaps Byron Cook bycook@microsoft.com Microsoft Research, Cambridge Joint work with Josh Berdine, Dino Distefano, and.

50

Introduction

Page 51: 1 Termination and shape-shifting heaps Byron Cook bycook@microsoft.com Microsoft Research, Cambridge Joint work with Josh Berdine, Dino Distefano, and.

51

Introduction

Page 52: 1 Termination and shape-shifting heaps Byron Cook bycook@microsoft.com Microsoft Research, Cambridge Joint work with Josh Berdine, Dino Distefano, and.

52

Introduction

Page 53: 1 Termination and shape-shifting heaps Byron Cook bycook@microsoft.com Microsoft Research, Cambridge Joint work with Josh Berdine, Dino Distefano, and.

53

Introduction

Page 54: 1 Termination and shape-shifting heaps Byron Cook bycook@microsoft.com Microsoft Research, Cambridge Joint work with Josh Berdine, Dino Distefano, and.

54

Introduction

Page 55: 1 Termination and shape-shifting heaps Byron Cook bycook@microsoft.com Microsoft Research, Cambridge Joint work with Josh Berdine, Dino Distefano, and.

55

Introduction

Page 56: 1 Termination and shape-shifting heaps Byron Cook bycook@microsoft.com Microsoft Research, Cambridge Joint work with Josh Berdine, Dino Distefano, and.

56

Introduction

Page 57: 1 Termination and shape-shifting heaps Byron Cook bycook@microsoft.com Microsoft Research, Cambridge Joint work with Josh Berdine, Dino Distefano, and.

57

Introduction

Page 58: 1 Termination and shape-shifting heaps Byron Cook bycook@microsoft.com Microsoft Research, Cambridge Joint work with Josh Berdine, Dino Distefano, and.

58

Introduction

Page 59: 1 Termination and shape-shifting heaps Byron Cook bycook@microsoft.com Microsoft Research, Cambridge Joint work with Josh Berdine, Dino Distefano, and.

59

Introduction

Page 60: 1 Termination and shape-shifting heaps Byron Cook bycook@microsoft.com Microsoft Research, Cambridge Joint work with Josh Berdine, Dino Distefano, and.

60

Outline

Introduction

TERMINATOR’s proof rule

MUTANT/TERMINATOR

Experimental results

Conclusion & Discussion

Page 61: 1 Termination and shape-shifting heaps Byron Cook bycook@microsoft.com Microsoft Research, Cambridge Joint work with Josh Berdine, Dino Distefano, and.

61

Outline

Introduction

TERMINATOR’s proof rule

MUTANT/TERMINATOR

Experimental results

Conclusion & Discussion

Page 62: 1 Termination and shape-shifting heaps Byron Cook bycook@microsoft.com Microsoft Research, Cambridge Joint work with Josh Berdine, Dino Distefano, and.

62

Conclusion & Discussion

Constructing automatic termination provers out of abstract interpreters: Over-approximate binary reachability using encoding into states Prove each state (partitioning of over-approximation) well-founded

MUTANT/TERMINATOR: Application using separation logic based abstract interpretation

Page 63: 1 Termination and shape-shifting heaps Byron Cook bycook@microsoft.com Microsoft Research, Cambridge Joint work with Josh Berdine, Dino Distefano, and.

63

Conclusion & Discussion

What’s next: combining termination analysis engines: Integer linear programs (TERMINATOR, roughly speaking) Mutating heaps (MUTANT) Non-linear programs (ZIGZAG)

Page 64: 1 Termination and shape-shifting heaps Byron Cook bycook@microsoft.com Microsoft Research, Cambridge Joint work with Josh Berdine, Dino Distefano, and.

64

Conclusion & Discussion

What’s next: combining termination analysis engines: Integer linear programs (TERMINATOR, roughly speaking) Mutating heaps (MUTANT) Non-linear programs (ZIGZAG)

Page 65: 1 Termination and shape-shifting heaps Byron Cook bycook@microsoft.com Microsoft Research, Cambridge Joint work with Josh Berdine, Dino Distefano, and.

65

Conclusion & Discussion

What’s next: combining termination analysis engines: Integer linear programs (TERMINATOR, roughly speaking) Mutating heaps (MUTANT) Non-linear programs (ZIGZAG)

Page 66: 1 Termination and shape-shifting heaps Byron Cook bycook@microsoft.com Microsoft Research, Cambridge Joint work with Josh Berdine, Dino Distefano, and.

66

Conclusion & Discussion

What’s next: combining termination analysis engines: Integer linear programs (TERMINATOR, roughly speaking) Mutating heaps (MUTANT) Non-linear programs (ZIGZAG)

Page 67: 1 Termination and shape-shifting heaps Byron Cook bycook@microsoft.com Microsoft Research, Cambridge Joint work with Josh Berdine, Dino Distefano, and.

67

Conclusion & Discussion

See http://research.microsoft.com/TERMINATOR Not-quite-camera-ready copy of CAV’06 paper about MUTANT Papers about TERMINATOR (PLDI’06, SAS’06, CAV’06)

Questions?