Controlling Mutation and Aliases with Fractional Permissions

Size: px
Start display at page:

Download "Controlling Mutation and Aliases with Fractional Permissions"

Transcription

1 Controlling Mutation and Aliases with Fractional Permissions John Boyland University of Wisconsin- Milwaukee ECOOP 12

2 Outline of Session I. Fractional Permissions II. Applications III. Problems

3 I. Fractional Permissions

4 Structured Aliasing? My Thoughts

5 Structured Aliasing? My Thoughts Aliasing is relevant ONLY if mutable state.

6 Structured Aliasing? My Thoughts Aliasing is relevant ONLY if mutable state. For isolation/parallelism, we want tracking.

7 Structured Aliasing? My Thoughts Aliasing is relevant ONLY if mutable state. For isolation/parallelism, we want tracking. Fractions: don t copy tokens, split tokens.

8 Structured Aliasing? My Thoughts Aliasing is relevant ONLY if mutable state. For isolation/parallelism, we want tracking. Fractions: don t copy tokens, split tokens. Unify separation logic & ownership.

9 Fractional Permissions

10 Fractional Permissions Rough recipe:

11 Fractional Permissions Rough recipe: Separation Logic

12 Fractional Permissions Rough recipe: Separation Logic - Scalars

13 Fractional Permissions Rough recipe: Separation Logic - Scalars + Fractions

14 Fractional Permissions Rough recipe: Separation Logic - Scalars + Fractions + Nesting (AKA Adoption)

15 Separation Logic Linear heap predicates flow-sensitive state information Nonlinear scalar predicates Hoare logic, and e.g., y = x + z Linear and nonlinear connectives and, or, implication, existentials,... [Reynolds, O Hearn, Brookes, Parkinson...]

16 Minus Scalars Separation Logic intends (full) verification. We do verification of limited properties: aliasing, mutation, concurrency object structure, design patterns Thus we drop integer and boolean values: only interested in pointer values.

17 Plus Fractions We distinguish write (one) from read (less than one) permission to mutable state. Important for concurrency correctness. Some variants of SL have fractions in some limited situations. Fractions are endemic for us.

18 Plus Nesting Motivation: nonlinear (flow-insensitive) analysis is simpler. Add a way to express flow-insensitive ownership along with flow-sensitive uniqueness aka adoption [Fähndrich&DeLine 2002] Interesting interactions with fractions.

19 I. Outline Fractions Fractional Heaps Fractional Permission Logic

20 Fractions

21 Fractions Q + positive rational numbers (R + OK).

22 Fractions Q + positive rational numbers (R + OK). No zero (0 permission = no permission).

23 Fractions Q + positive rational numbers (R + OK). No zero (0 permission = no permission). Both addition and multiplication are total and permit cancellation.

24 Fractions Q + positive rational numbers (R + OK). No zero (0 permission = no permission). Both addition and multiplication are total and permit cancellation. Fractions can be arbitrarily small.

25 Fractions Q + positive rational numbers (R + OK). No zero (0 permission = no permission). Both addition and multiplication are total and permit cancellation. Fractions can be arbitrarily small. Fractions greater than one permitted in intermediate heaps.

26 Fractional Heaps A partial map from locations L to pairs of values V and fractions Q + L = O F, pointer and field V = O, pointers to objects. A memory has only fractions of one.

27 Fractional Heaps 1

28 Scaling Fractional Heaps 1 ½

29 Some Heaps Add 1

30 Some Heaps Add 1

31 Some Heaps Don t Add 1

32 Some Heaps Don t Add 1

33 Some Heaps Don t Add 1 Different Values Clash

34 Memory 1

35 Memory 1 whole fraction

36 Memory 1 not defined

37 Memory

38 Memory 1

39 Permission Logic o.f o 1 (o,f) o A unit permission (Wrigstad token )

40 Permission Logic Heap for 1 Heap for 2

41 Permission Logic 1 + 2

42 Permission Logic Π 1 +Π 2 Heap for 1 Heap for 2

43 Permission Logic Π 1 +Π 2

44 Permission Logic 0 q Heap for

45 Permission Logic 0 q q = 3/2

46 Permission Logic Existential: r (o.f r)+π obligatory unit permission yields witness Conditional: Γ?Π 1 :Π 2 Here Γ is a boolean formula true or false

47 Boolean Formulae true conjunction negation comparison Γ 1 Γ 2 Γ o = o All these can be true, false or unknown

48 Boolean Formulae existential unrestricted predicates calls can be recursive x Γ p(...) Either can be true or unknown (not false).

49 Boolean Formulae nesting Π o.f ownership indicates that is available in : there is Π 0, o.f o by itself, as with all formulae, has no heap. Known nesting may be less that actual. Π 1 Π 2 Π 0 +Π 1 =Π 2

50 Unit Permission Again o.f o (o,f) o { Π o.f 1

51 Unit Permission Again o.f o (o,f) o 1{ Π o.f Π 1 o.f where 1 Π 1 Π

52 Example: Point permission to write o s x and y fields: ( r o.x r)+ ( r o.y r) preceding permission nested in o s All field ( r o.x r)+ ( r o.y r) o.all

53 Example: Point permission to write o s x and y fields: ( r o.x r)+ ( r o.y r) model field preceding permission nested in o s All field ( r o.x r)+ ( r o.y r) o.all

54 Example: Point A point is an object we know has x and y: Point(r) = ( r r.x r )+ ( r r.y r ) o is a Point Point(o) o is a Point and we can read its state: Point(o)+q(o.All 0) r.all

55 Nesting o.x o x + o.y o y + o.all

56 Nesting o.x o x + o.y o y + o.all Point(o)+o.All 0 1

57 Carving Point(o)+q(o.All 0) (o,all) (o,x) (o,y) 1

58 Carving Point(o)+q(o.All 0) (o,all) (o,x) (o,y) 1 1

59 Carving Point(o)+q(o.All 0) (o,all) (o,x) (o,y) 1 1 1

60 Carving Point(o)+q(o.All 0) (o,all) (o,x) (o,y) q(o.x r x )+(q(o.x r x ) + q(o.all 0)) 1 1 1

61 In General: Invariants Invariant(o,...) nests state in o.all Invariant(o,...) + o.all 0 gives one access Carving permits breaking the invariant: o.x r x +((o.x r x ) + (o.all 0)) Until o.all 0 is needed again.

62 Linked-List Node Field data is a unique Point; Field next is a unique Node: Node(r) = rp r.data r p + r p.all 0 + Point(r p )+ r n r.next r n + r n.all 0 + Node(r n ) r.all

63 Linked-List Node Field data is a unique Point; Field next is a unique Node: Node(r) = rp r.data r p + r p.all 0 + Point(r p )+ r n r.next r n + r n.all 0 + Node(r n ) r.all Can you spot the problem?

64 Linked-List Node Field data is a unique Point; Field next is a unique Node: Node(r) = rp r.data r p + r p.all 0 + Point(r p )+ r n r.next r n + r n.all 0 + Node(r n ) r.all

65 Linked-List Node Field data is a unique Point; Field next is a unique Node: Node(r) = rp r.data r p + r p.all 0 + Point(r p )+ r n r.next r n + r n.all 0 + Node(r n ) r.all Every node points to a new next node!

66 Linked-List Node Node(r) = r p r.data r p + r p.all 0 + Point(r p )+ r n r.next r n + r.all r n =0?0 : r n.all 0 + Node(r n ) 0

67 Linked-List Node Node(r) = r p r.data r p + r p.all 0 + Point(r p )+ r n r.next r n + r.all r n =0?0 : r n.all 0 + Node(r n ) not null unique 0

68 Linked-List Node Node(r) = r p r.data r p + r p.all 0 + Point(r p )+ r n r.next r n + r.all r n =0?0 : r n.all 0 + Node(r n ) maybe null unique 0

69 Two Element List (n 1,All) (n 1,data) (p 1,All) (p 1,x) (p 1,y) (n 1,next) (n 2,All) (n 2,data) (p 2,All) (p 2,x) (p 2,y) (n 2,next) Node(n 1 )+ n 1.All 0 p 1 n 2 p 2 1

70 Two Element List (n 1,All) (n 1,data) (p 1,All) (p 1,x) (p 1,y) (n 1,next) (n 2,All) (n 2,data) (p 2,All) (p 2,x) (p 2,y) (n 2,next) Node(n 1 )+ n 1.All 0 p 1 n 2 p Node(n 1 )+ = + 2 (n 1.All 0) Node(n 1 )+ 1 2 (n 1.All 0) 1 1

71 Effective Uniqueness Read permission does not guarantee unique: n 1.data = n 2.data is possible DETOUR 1

72 1 Effective Uniqueness Read permission does not guarantee unique: n 1.data = n 2.data is possible

73 Node(l)+ l.all 0 Node n = l; Iteration while (n!= null) { Point p = n.data; p.x += 3; n = n.next; }

74 Node(l)+ l.all 0 Node n = l; Iteration while (n!= null) { Point p = n.data; p.x += 3; n = n.next; } Node(l)+(n = l)+ l.all 0

75 Node(l)+ l.all 0 Node n = l; Iteration while (n!= null) { Point p = n.data; p.x += 3; n = n.next; } Node(l)+(n = l)+ l.all 0 Node(n)+n.All 0+ n.all 0 + l.all 0

76 Node(l)+ l.all 0 Node n = l; Iteration while (n!= null) { Point p = n.data; p.x += 3; n = n.next; } Node(l)+(n = l)+ l.all 0 Node(n)+n.All 0+ n.all 0 + l.all 0 Point(p)+p.All 0+ p.all 0 + n.all 0+ n.all 0 + l.all 0

77 Node(l)+ l.all 0 Node n = l; Iteration while (n!= null) { Point p = n.data; p.x += 3; n = n.next; } Node(l)+(n = l)+ l.all 0 Node(n)+n.All 0+ n.all 0 + l.all 0 p.x r x + p.x r x + p.all 0+ p.all 0 + n.all 0+ n.all 0 + l.all 0

78 Node(l)+ l.all 0 Node n = l; Iteration while (n!= null) { Point p = n.data; p.x += 3; n = n.next; } Node(l)+(n = l)+ n =0?0:n.All 0 + Node(n)+ l.all 0 Node(n)+n.All 0+ n.all 0 + l.all 0 (n =0?0:n.All 0 + Node(n)) + l.all 0

79 II. Applications

80 Annotations as Sugar (maybe null) unique field s value nested with o.all 0 method effects are lent permissions writes(x.f) x.f r reads(x.f) z(x.f r) passed in on entry; passed out on exit

81 Annotations as Sugar (maybe null) unique field s value nested with o.all 0 method effects are lent permissions writes(x.f) x.f r reads(x.f) z(x.f r) passed in on entry; passed out on exit Fraction variable

82 Annotations as Sugar Shorthand: r.all r.all 0 Ownership: one object s state in another: owned(o)r r.all o.all

83 Independent Iterators interface Iterator { boolean hasnext(); Object next(); void remove(); }

84 Independent Iterators interface Iterator { reads(all) boolean hasnext(); writes(all) Object next(); writes(all) void remove(); }

85 Why Independent? 1. Utility methods can use iterator alone. 2. Iterators can be concatenated 3. Iteration creation can be delegated.

86 Why Independent? #1 class Util { writes(it.all) static int count(iterator it, Object x) { int c = 0; while (it.hasnext()) { if (x == it.next()) ++c; } return c; } } UTILITY

87 Why Independent? #2 class AppendIterator implements Iterator { unique Iterator it1; unique Iterator it2; AppendIterator(unique Iterator i1, unique Iterator i2) { it1 = i1; it2 = i2; } reads(all) boolean hasnext() { return it1.hasnext() it2.hasnext(); }... CONCATENATION

88 Why Independent? #3 class SpecializedCollection { Object[] data;... Iterator iterator() { return Arrays.asList(data).iterator(); }... } DELEGATION

89 Can Iterators be Independent? Collections are affected by iterators: Can remove using iterator. Iterators are affected by collections: If collection modified, iterators invalid.

90 Aliasing Iterator and collection share mutable state: Iterator Collection

91 Interference R-W; W-R; W-W 1. access through iterator 2. access through collection R-W: iterator becomes invalid W-R: collection results different W-W: both

92 Avoiding Interference 1 R-R is OK If we can prevent interference: we can pretend no state overlap Iterator Collection

93 Avoiding Interference 2 prevent collection writes while iterators in use prevent collection reads while remove iterator in use

94 Avoiding Interference 2 prevent collection writes while iterators in use prevent collection reads while remove iterator in use creating iterator requires read access creating remove iterator requires write access

95 Avoiding Interference 3 prevent collection writes while iterators in use prevent collection reads while remove iterator in use creating iterator encumbers read access creating remove iterator encumbers write access

96 List Representation class LinkedList<T, Object o> { class Node { T data; Node next; }

97 List Representation class LinkedList<T, Object o> { class Node { owned(o) T data; unique Node next; }

98 List Representation class LinkedList<T, Object o> { class Node { owned(o) T data; unique Node next; } r d r.data r d + (r d =0?0:r d.all r o.all) + r n r.next r n + (r n =0?0:r n.all + Node(r n,r o )) Node(r, r o )= r.all

99 List Representation class LinkedList<T, Object o> { class Node { owned(o) T data; unique Node next; } unique Node head;

100 List Representation class LinkedList<T, Object o> { class Node { owned(o) T data; unique Node next; } unique Node head; r h r.head r h + (r h =0?0:r h.all + Node(r h,r o )) LinkedList(r, r o )= r.all

101 Iterator Representation class LinkedList<T, Object o> { class Iterator<fraction q> { Node pre; }

102 Iterator Representation class LinkedList<T, Object o> { class Iterator<fraction q> { Node pre; } Iterator(r, r o,z,r l )= r p r.pre r p + r p =0?0:zr p.all + Node(r p,r o )+ (r p =0?0:zr p.all + Node(r p,r o )) + zr l.all r.all

103 Iterator Creation class LinkedList<T, Object o> { Iterator<z> iterator() { return new Iterator(); }

104 Iterator Creation class LinkedList<T, Object o> { Iterator<z> iterator() { return new Iterator(); } this In: zr t.all

105 Iterator Creation class LinkedList<T, Object o> { Iterator<z> iterator() { return new Iterator(); } In: zr t.all Out: r r.all + (r r.all + zr t.all + v) result

106 Iterator Creation class LinkedList<T, Object o> { Iterator<z> iterator() { return new Iterator(); } In: zr t.all Out: r r.all + (r r.all + zr t.all + v) some leftover permissions

107 Iterator Heaps LinkedList(l, o)+ 1 2 l.all 0 (l,all) (l,head) (n 1,All) (n 1,data) (n 1,next) (n 2,All) (n 2,data) (n 2,next) n 1 n 2 BEFORE 1 1

108 Iterator Heaps LinkedList(l, o)+ 1 2 l.all 0 (l,all) (l,head) (n 1,All) (n 1,data) (n 1,next) (n 2,All) (n 2,data) (n 2,next) n 1 n 2 Iterator(i, o, 1 2,l)+i.All + (i.all + 1 l.all + v) 2 BEFORE 1 SOMETIME AFTER 1

109 Iterator Heaps LinkedList(l, o)+ 1 2 l.all 0 (l,all) (l,head) (n 1,All) (n 1,data) (n 1,next) (n 2,All) (n 2,data) (n 2,next) n 1 n 2 Iterator(i, o, 1 2,l)+i.All + (i.all + 1 l.all + v) 2 BEFORE 1 SOMETIME AFTER 1

110 Iterator Heaps LinkedList(l, o)+ 1 2 l.all 0 (l,all) (l,head) (n 1,All) (n 1,data) (n 1,next) (n 2,All) (n 2,data) (n 2,next) n 1 n 2 Iterator(i, o, 1 2,l)+i.All + (i.all + 1 l.all + v) 2 n 2 (i,all) (i,pre) BEFORE 1 SOMETIME AFTER 1

111 Iterator Heaps LinkedList(l, o)+ 1 2 l.all 0 (l,all) (l,head) (n 1,All) (n 1,data) (n 1,next) (n 2,All) (n 2,data) (n 2,next) n 1 n 2 Iterator(i, o, 1 2,l)+i.All + (i.all + 1 l.all + v) 2 n 1 n 2 (i,all) (i,pre) BEFORE 1 SOMETIME AFTER 1

112 Concurrency Non-interacting parallelism: Divide permissions between threads. Mutual exclusion locks ( synchronized ): Protected permissions nested in lock. Volatile fields, can be accessed anytime: State of value nested in known location.

113 Noninteracting Parallelism 1

114 Noninteracting Parallelism 1 1 1

115 Noninteracting Parallelism 1

116 Synchronization

117 Synchronization Objects serving as locks are owned by Lock: l.all G.Lock

118 Synchronization Objects serving as locks are owned by Lock: l.all G.Lock State protected by a lock is nested in it: e.g. l.val l.all

119 Synchronization Objects serving as locks are owned by Lock: l.all G.Lock State protected by a lock is nested in it: e.g. l.val l.all Synchronization provides l.all: requires l.all or l after last locked.

120 Synchronization synchronized (p) { } p.x += 1;

121 Synchronization Point(r p ) (r p.all G.Lock) (l <r p ) synchronized (p) { p.x += 1; }

122 Synchronization Point(r p ) (r p.all G.Lock) (l <r p ) synchronized (p) { } p.x += 1; New formula that compares lock order. Here l is the previously locked location.

123 Synchronization Point(r p ) (r p.all G.Lock) (l <r p ) synchronized (p) { p.x += 1; } r p.all

124 Synchronization Point(r p ) (r p.all G.Lock) (l <r p ) synchronized (p) { } p.x += 1; r p.all r p.x+(r p.x + r p.all)

125 Synchronization THREAD GLOBAL synchronized (p) { } p.x += 1; 1 1

126 Synchronization THREAD GLOBAL synchronized (p) { } p.x += 1; 1 1

127 Synchronization THREAD GLOBAL synchronized (p) { } p.x += 1; 1 1

128 Synchronization synchronized (p) { } p.x += 1;

129 Synchronization REENTRANCY synchronized (p) { } p.x += 1;

130 Synchronization REENTRANCY r p.all synchronized (p) { p.x += 1; }

131 Synchronization synchronized (p) { p.x += 1; } REENTRANCY r p.all r p.all

132 Synchronization REENTRANCY r p.all synchronized (p) { } p.x += 1; r p.all r p.x+(r p.x + r p.all)

133 Synchronization REENTRANCY r p.all synchronized (p) { } p.x += 1; r p.all r p.x+(r p.x + r p.all) r p.all

134 Volatile Fields Can be assigned at any time. Value assigned should have state nested In known owner, or 2. In G.Lock, or 3. Fractionally in G.Immutable.

135 Volatile Fields (1) THREAD1 p = new Point(1,2); // nest p in thread2 THREAD2 Thread Object x.v = p; 1 1

136 Volatile Fields (1) THREAD1 THREAD2 p = new Point(1,2); // nest p in thread2 x.v = p; 1 1

137 Volatile Fields (1) THREAD1 THREAD2 p = new Point(1,2); // nest p in thread2 x.v = p; 1 1

138 Volatile Fields (1) THREAD1 THREAD2 p = new Point(1,2); // nest p in thread2 x.v = p; 1 1

139 Volatile Fields (2) THREAD1 GLOBAL p = new Point(1,2); // make p a lock x.v = p; 1 1

140 Volatile Fields (2) THREAD1 GLOBAL p = new Point(1,2); // make p a lock x.v = p; 1 1

141 Volatile Fields (2) THREAD1 GLOBAL p = new Point(1,2); // make p a lock x.v = p; 1 1

142 Volatile Fields (2) THREAD1 GLOBAL p = new Point(1,2); // make p a lock x.v = p; 1 1

143 Immutability Nest any fraction of r.all in G.Immutable: z (zr.all G.Immutable) Implicitly: Every thread nests a fraction of G.Immutable Every method gets a fraction of G.Immutable Fractions can get arbitrarily small.

144 Volatile Fields (3) THREAD1 THREAD2 p = new Point(1,2); // make p immutable x.v = p; (G,Immutable) (G,Immutable) 1 1

145 Volatile Fields (3) THREAD1 THREAD2 p = new Point(1,2); // make p immutable x.v = p; (G,Immutable) (G,Immutable) 1 1

146 Volatile Fields (3) THREAD1 THREAD2 p = new Point(1,2); // make p immutable x.v = p; (G,Immutable) (G,Immutable) 1 1

147 Volatile Fields (3) THREAD1 THREAD2 p = new Point(1,2); // make p immutable x.v = p; (G,Immutable) (G,Immutable) 1 1

148 III. Problems

149 AWT/Swing (J)Component state can only be accessed from Swing Event Threads If an Event Thread blocks on input (e.g. using a JDialog), new thread is created/reused. Runnable instances can be passed to Swing.

150 Java Concurrency wait() releases lock temporarily Thread.start(), Thread.join() Anyone can join a thread, multiple times java.util.concurrent.reentrantlock can lock/unlock independently

151

152 Related Work Ownership Reads Linearity

153 Related Work Ownership Reads [Clarke 01] Linearity

154 Related Work Ownership Reads [Clarke & Drossopoulou 02] Linearity

155 Related Work Ownership Reads [Müller & Rudich 07] Linearity

156 Related Work Ownership Reads Linearity

157 Related Work Ownership Reads Linearity [Ishtiaq & O Hearn 01]

158 Related Work Ownership Reads [Parkinson & Bierman 12] Linearity

159 Related Work Ownership Reads [Fähndrich & Deline 02] Linearity

160 Related Work Ownership Reads [Bornat et al 05/Brookes 06] Linearity

161 Related Work Ownership Reads Linearity

162 Related Work Ownership [Bierhoff & Aldrich 07] Reads Linearity

163

Modular Reasoning about Aliasing using Permissions

Modular Reasoning about Aliasing using Permissions Modular Reasoning about Aliasing using Permissions John Boyland University of Wisconsin- Milwaukee FOAL 2015 Summary Permissions are non-duplicable tokens that give access to state. Permissions give effective

More information

Semantics of Fractional Permissions with Nesting

Semantics of Fractional Permissions with Nesting Semantics of Fractional Permissions with Nesting John Boyland December 5, 2007 Abstract Fractional permissions use fractions to distinguish write access () from read access (any smaller fraction). Nesting

More information

A Fundamental Permission Interpretation for Ownership Types

A Fundamental Permission Interpretation for Ownership Types A Fundamental Permission Interpretation for Ownership Types Yang Zhao Nanjing University of Science and Technology 200 Xiao Ling Wei, Nanjing, China yangzhao@mail.njust.edu.cn John Boyland University of

More information

Substructural Typestates

Substructural Typestates Programming Languages meets Program Verification 2014 Substructural Typestates Filipe Militão (CMU & UNL) Jonathan Aldrich (CMU) Luís Caires (UNL) Motivation! File file = new File( out.txt );! file.write(

More information

Plural and : Protocols in Practice. Jonathan Aldrich Workshop on Behavioral Types April School of Computer Science

Plural and : Protocols in Practice. Jonathan Aldrich Workshop on Behavioral Types April School of Computer Science Plural and : Protocols in Practice Jonathan Aldrich Workshop on Behavioral Types April 2011 School of Computer Science Empirical Study: Protocols in Java Object Protocol [Beckman, Kim, & A to appear in

More information

Towards imperative modules: reasoning about invariants and sharing of mutable state

Towards imperative modules: reasoning about invariants and sharing of mutable state Towards imperative modules: reasoning about invariants and sharing of mutable state David A. Naumann Joint work with Mike Barnett and Anindya Banerjee Stevens Institute of Technology Supported by NSF CCR-0208984,

More information

The practice of Mezzo

The practice of Mezzo The practice of Mezzo François Pottier INRIA IHP, April 2014 1 / 83 Acknowledgements Jonathan Protzenko, Thibaut Balabonski, Henri Chataing, Armaël Guéneau, Cyprien Mangin 2 / 83 Overview Two lectures

More information

Capabilities for Uniqueness and Borrowing

Capabilities for Uniqueness and Borrowing Capabilities for Uniqueness and Borrowing Philipp Haller and Martin Odersky EPFL 24 th European Conference on Object Oriented Programming June 24, 2010 Maribor, Slovenia Motivating Example actor { val

More information

Constraint Semantics for Abstract Read Permissions. Author(s): Boyland, John T.; Müller, Peter; Schwerhoff, Malte; Summers, Alexander J.

Constraint Semantics for Abstract Read Permissions. Author(s): Boyland, John T.; Müller, Peter; Schwerhoff, Malte; Summers, Alexander J. Research Collection Report Constraint Semantics for Abstract Read Permissions Author(s): Boyland, John T.; Müller, Peter; Schwerhoff, Malte; Summers, Alexander J. Publication Date: 2014 Permanent Link:

More information

RustBelt: Securing the Foundations of the Rust Programming Language

RustBelt: Securing the Foundations of the Rust Programming Language RustBelt: Securing the Foundations of the Rust Programming Language Ralf Jung, Jacques-Henri Jourdan, Robbert Krebbers, Derek Dreyer POPL 2018 in Los Angeles, USA Max Planck Institute for Software Systems

More information

An overview of Mezzo

An overview of Mezzo An overview of Mezzo François Pottier INRIA Bertinoro, June 2015 1 / 91 Acknowledgements Jonathan Protzenko, Thibaut Balabonski, Henri Chataing, Armaël Guéneau, Cyprien Mangin 2 / 91 What is Mezzo? An

More information

Hoare Logic and Model Checking

Hoare Logic and Model Checking Hoare Logic and Model Checking Kasper Svendsen University of Cambridge CST Part II 2016/17 Acknowledgement: slides heavily based on previous versions by Mike Gordon and Alan Mycroft Pointers Pointers and

More information

Hoare Logic and Model Checking

Hoare Logic and Model Checking Hoare Logic and Model Checking Kasper Svendsen University of Cambridge CST Part II 2016/17 Acknowledgement: slides heavily based on previous versions by Mike Gordon and Alan Mycroft Introduction In the

More information

Hoare Logic and Model Checking. A proof system for Separation logic. Introduction. Separation Logic

Hoare Logic and Model Checking. A proof system for Separation logic. Introduction. Separation Logic Introduction Hoare Logic and Model Checking In the previous lecture we saw the informal concepts that Separation Logic is based on. Kasper Svendsen University of Cambridge CST Part II 2016/17 This lecture

More information

Computation Abstractions. Processes vs. Threads. So, What Is a Thread? CMSC 433 Programming Language Technologies and Paradigms Spring 2007

Computation Abstractions. Processes vs. Threads. So, What Is a Thread? CMSC 433 Programming Language Technologies and Paradigms Spring 2007 CMSC 433 Programming Language Technologies and Paradigms Spring 2007 Threads and Synchronization May 8, 2007 Computation Abstractions t1 t1 t4 t2 t1 t2 t5 t3 p1 p2 p3 p4 CPU 1 CPU 2 A computer Processes

More information

Applied Unified Ownership. Capabilities for Sharing Across Threads

Applied Unified Ownership. Capabilities for Sharing Across Threads Applied Unified Ownership or Capabilities for Sharing Across Threads Elias Castegren Tobias Wrigstad DRF transfer parallel programming AppliedUnified Ownership memory management placement in pools (previous

More information

Ownership, Encapsulation and the Disjointness of Type and Effect. Dave Clarke Utrecht University Sophia Drossopoulou Imperial College, London

Ownership, Encapsulation and the Disjointness of Type and Effect. Dave Clarke Utrecht University Sophia Drossopoulou Imperial College, London Ownership, Encapsulation and the Disjointness of Type and Effect Dave Clarke Utrecht University Sophia Drossopoulou Imperial College, London Overview Review ownership types Describe a problem reasoning

More information

Verifying the State Design Pattern using Object Propositions

Verifying the State Design Pattern using Object Propositions Verifying the State Design Pattern using Object Propositions Ligia Nistor Computer Science Department Carnegie Mellon University Why verify programs? Verification vs. debugging Verification at compile

More information

Verification of Snapshotable Trees using Access Permissions and Typestate

Verification of Snapshotable Trees using Access Permissions and Typestate Verification of Snapshotable Trees using Access Permissions and Typestate Hannes Mehnert 1 and Jonathan Aldrich 2 1 IT University of Copenhagen, 2300 København, Danmark hame@itu.dk 2 School of Computer

More information

ASaP: Annotations for Safe Parallelism in Clang. Alexandros Tzannes, Vikram Adve, Michael Han, Richard Latham

ASaP: Annotations for Safe Parallelism in Clang. Alexandros Tzannes, Vikram Adve, Michael Han, Richard Latham ASaP: Annotations for Safe Parallelism in Clang Alexandros Tzannes, Vikram Adve, Michael Han, Richard Latham Motivation Debugging parallel code is hard!! Many bugs are hard to reason about & reproduce

More information

Pointers. Chapter 8. Decision Procedures. An Algorithmic Point of View. Revision 1.0

Pointers. Chapter 8. Decision Procedures. An Algorithmic Point of View. Revision 1.0 Pointers Chapter 8 Decision Procedures An Algorithmic Point of View D.Kroening O.Strichman Revision 1.0 Outline 1 Introduction Pointers and Their Applications Dynamic Memory Allocation Analysis of Programs

More information

Hoare logic. WHILE p, a language with pointers. Introduction. Syntax of WHILE p. Lecture 5: Introduction to separation logic

Hoare logic. WHILE p, a language with pointers. Introduction. Syntax of WHILE p. Lecture 5: Introduction to separation logic Introduction Hoare logic Lecture 5: Introduction to separation logic In the previous lectures, we have considered a language, WHILE, where mutability only concerned program variables. Jean Pichon-Pharabod

More information

CSE332: Data Abstractions Lecture 22: Shared-Memory Concurrency and Mutual Exclusion. Tyler Robison Summer 2010

CSE332: Data Abstractions Lecture 22: Shared-Memory Concurrency and Mutual Exclusion. Tyler Robison Summer 2010 CSE332: Data Abstractions Lecture 22: Shared-Memory Concurrency and Mutual Exclusion Tyler Robison Summer 2010 1 Toward sharing resources (memory) So far we ve looked at parallel algorithms using fork-join

More information

Hoare logic. Lecture 5: Introduction to separation logic. Jean Pichon-Pharabod University of Cambridge. CST Part II 2017/18

Hoare logic. Lecture 5: Introduction to separation logic. Jean Pichon-Pharabod University of Cambridge. CST Part II 2017/18 Hoare logic Lecture 5: Introduction to separation logic Jean Pichon-Pharabod University of Cambridge CST Part II 2017/18 Introduction In the previous lectures, we have considered a language, WHILE, where

More information

AP COMPUTER SCIENCE JAVA CONCEPTS IV: RESERVED WORDS

AP COMPUTER SCIENCE JAVA CONCEPTS IV: RESERVED WORDS AP COMPUTER SCIENCE JAVA CONCEPTS IV: RESERVED WORDS PAUL L. BAILEY Abstract. This documents amalgamates various descriptions found on the internet, mostly from Oracle or Wikipedia. Very little of this

More information

Linked List Nodes (reminder)

Linked List Nodes (reminder) Outline linked lists reminders: nodes, implementation, invariants circular linked list doubly-linked lists iterators the Java foreach statement iterator implementation the ListIterator interface Linked

More information

Local Verification of Global Invariants in

Local Verification of Global Invariants in Local Verification of Global Invariants in 1 Local Verification of Global Invariants in Concurrent Programs Ernie Cohen 1, Michal Moskal 2, Wolfram Schulte 2, Stephan Tobies 1 1 European Microsoft Innovation

More information

CS Bootcamp Boolean Logic Autumn 2015 A B A B T T T T F F F T F F F F T T T T F T F T T F F F

CS Bootcamp Boolean Logic Autumn 2015 A B A B T T T T F F F T F F F F T T T T F T F T T F F F 1 Logical Operations 1.1 And The and operator is a binary operator, denoted as, &,, or sometimes by just concatenating symbols, is true only if both parameters are true. A B A B F T F F F F The expression

More information

Hoare logic. A proof system for separation logic. Introduction. Separation logic

Hoare logic. A proof system for separation logic. Introduction. Separation logic Introduction Hoare logic Lecture 6: Examples in separation logic In the previous lecture, we saw how reasoning about pointers in Hoare logic was problematic, which motivated introducing separation logic.

More information

CS 2112 Lecture 20 Synchronization 5 April 2012 Lecturer: Andrew Myers

CS 2112 Lecture 20 Synchronization 5 April 2012 Lecturer: Andrew Myers CS 2112 Lecture 20 Synchronization 5 April 2012 Lecturer: Andrew Myers 1 Critical sections and atomicity We have been seeing that sharing mutable objects between different threads is tricky We need some

More information

Introduction to Locks. Intrinsic Locks

Introduction to Locks. Intrinsic Locks CMSC 433 Programming Language Technologies and Paradigms Spring 2013 Introduction to Locks Intrinsic Locks Atomic-looking operations Resources created for sequential code make certain assumptions, a large

More information

Software Model Checking. Xiangyu Zhang

Software Model Checking. Xiangyu Zhang Software Model Checking Xiangyu Zhang Symbolic Software Model Checking CS510 S o f t w a r e E n g i n e e r i n g Symbolic analysis explicitly explores individual paths, encodes and resolves path conditions

More information

Copyright 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley. Chapter 6 Outline. Unary Relational Operations: SELECT and

Copyright 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley. Chapter 6 Outline. Unary Relational Operations: SELECT and Chapter 6 The Relational Algebra and Relational Calculus Copyright 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 6 Outline Unary Relational Operations: SELECT and PROJECT Relational

More information

Permissions to Specify the Composite Design Pattern

Permissions to Specify the Composite Design Pattern Permissions to Specify the Composite Design Pattern Kevin Bierhoff Jonathan Aldrich Institute for Software Research, Carnegie Mellon University 5000 Forbes Avenue, Pittsburgh, PA 15213, USA {kevin.bierhoff,jonathan.aldrich

More information

Principles of Software Construction: Concurrency, Part 2

Principles of Software Construction: Concurrency, Part 2 Principles of Software Construction: Concurrency, Part 2 Josh Bloch Charlie Garrod School of Computer Science 1 Administrivia Homework 5a due now Homework 5 framework goals: Functionally correct Well documented

More information

It turns out that races can be eliminated without sacrificing much in terms of performance or expressive power.

It turns out that races can be eliminated without sacrificing much in terms of performance or expressive power. The biggest two problems in multi-threaded programming are races and deadlocks. Races reached new levels with the introduction of relaxed memory processors. It turns out that races can be eliminated without

More information

BIT Java Programming. Sem 1 Session 2011/12. Chapter 2 JAVA. basic

BIT Java Programming. Sem 1 Session 2011/12. Chapter 2 JAVA. basic BIT 3383 Java Programming Sem 1 Session 2011/12 Chapter 2 JAVA basic Objective: After this lesson, you should be able to: declare, initialize and use variables according to Java programming language guidelines

More information

Viper A Verification Infrastructure for Permission-Based Reasoning

Viper A Verification Infrastructure for Permission-Based Reasoning Viper A Verification Infrastructure for Permission-Based Reasoning Alex Summers, ETH Zurich Joint work with Uri Juhasz, Ioannis Kassios, Peter Müller, Milos Novacek, Malte Schwerhoff (and many students)

More information

Refinement Types for TypeScript

Refinement Types for TypeScript Refinement Types for TypeScript Panagiotis Vekris Benjamin Cosman Ranjit Jhala University of California, San Diego PLDI 16 Thursday, June 16 Extensible static analyses for modern scripting languages 2

More information

The Java Memory Model

The Java Memory Model The Java Memory Model What is it and why would I want one? Jörg Domaschka. ART Group, Institute for Distributed Systems Ulm University, Germany December 14, 2009 public class WhatDoIPrint{ static int x

More information

Synchronization SPL/2010 SPL/20 1

Synchronization SPL/2010 SPL/20 1 Synchronization 1 Overview synchronization mechanisms in modern RTEs concurrency issues places where synchronization is needed structural ways (design patterns) for exclusive access 2 Overview synchronization

More information

Uniqueness and Reference Immutability for Safe Parallelism

Uniqueness and Reference Immutability for Safe Parallelism Uniqueness and Reference Immutability for Safe Parallelism Colin Gordon (UW), Matt Parkinson (MSR), Jared Parsons (MS), Aleks Bromfield (MS), Joe Duffy (MS) OOPSLA 2012 A Prototype Extension to C# Extend

More information

Programming Languages and Techniques (CIS120)

Programming Languages and Techniques (CIS120) Programming Languages and Techniques () Lecture 20 February 28, 2018 Transition to Java Announcements HW05: GUI programming Due: THURSDAY!! at 11:59:59pm Lots of TA office hours today Thursday See Piazza

More information

Overview. CMSC 330: Organization of Programming Languages. Concurrency. Multiprocessors. Processes vs. Threads. Computation Abstractions

Overview. CMSC 330: Organization of Programming Languages. Concurrency. Multiprocessors. Processes vs. Threads. Computation Abstractions CMSC 330: Organization of Programming Languages Multithreaded Programming Patterns in Java CMSC 330 2 Multiprocessors Description Multiple processing units (multiprocessor) From single microprocessor to

More information

The New Java Technology Memory Model

The New Java Technology Memory Model The New Java Technology Memory Model java.sun.com/javaone/sf Jeremy Manson and William Pugh http://www.cs.umd.edu/~pugh 1 Audience Assume you are familiar with basics of Java technology-based threads (

More information

Programming Languages

Programming Languages TECHNISCHE UNIVERSITÄT MÜNCHEN FAKULTÄT FÜR INFORMATIK Programming Languages Concurrency: Atomic Executions, Locks and Monitors Dr. Michael Petter Winter term 2016 Atomic Executions, Locks and Monitors

More information

The Java Memory Model

The Java Memory Model Jeremy Manson 1, William Pugh 1, and Sarita Adve 2 1 University of Maryland 2 University of Illinois at Urbana-Champaign Presented by John Fisher-Ogden November 22, 2005 Outline Introduction Sequential

More information

Joins: A Case Study in Modular Specification of a Concurrent Reentrant Higher-order Library

Joins: A Case Study in Modular Specification of a Concurrent Reentrant Higher-order Library Joins: A Case Study in Modular Specification of a Concurrent Reentrant Higher-order Library Kasper Svendsen 1, Lars Birkedal 1, and Matthew Parkinson 2 1 IT University of Copenhagen, {kasv,birkedal}@itu.dk

More information

Lightweight Support for Magic Wands in an Automatic Verifier

Lightweight Support for Magic Wands in an Automatic Verifier Lightweight Support for Magic Wands in an Automatic Verifier Malte Schwerhoff and Alexander J. Summers ETH Zurich, Switzerland {malte.schwerhoff,alexander.summers}@inf.ethz.ch Abstract Permission-based

More information

Reminder of the last lecture. Aliasing Issues: Call by reference, Pointer programs. Introducing Aliasing Issues. Home Work from previous lecture

Reminder of the last lecture. Aliasing Issues: Call by reference, Pointer programs. Introducing Aliasing Issues. Home Work from previous lecture Reminder of the last lecture Aliasing Issues: Call by reference, Pointer programs Claude Marché Cours MPRI 2-36-1 Preuve de Programme 18 janvier 2017 Additional features of the specification language Abstract

More information

Reasoning About Imperative Programs. COS 441 Slides 10

Reasoning About Imperative Programs. COS 441 Slides 10 Reasoning About Imperative Programs COS 441 Slides 10 The last few weeks Agenda reasoning about functional programming It s very simple and very uniform: substitution of equal expressions for equal expressions

More information

A VERIFICATION TECHNIQUE FOR DETERMINISTIC PARALLEL PROGRAMS

A VERIFICATION TECHNIQUE FOR DETERMINISTIC PARALLEL PROGRAMS A VERIFICATION TECHNIQUE FOR DETERMINISTIC PARALLEL PROGRAMS MARIEKE HUISMAN UNIVERSITY OF TWENTE, NETHERLANDS JOINT WORK WITH SAEED DARABI AND STEFAN BLOM THE CHALLENGE OF RELIABLE SOFTWARE ICT problems

More information

Connecting Effects and Uniqueness with Adoption

Connecting Effects and Uniqueness with Adoption Int l Workshop on Aliasing, Confinement and Ownership in OOP, 2003 Connecting Effects and Uniqueness with Adoption John Tang Boyland University of Wisconsin Milwaukee Abstract. In a previous paper, we

More information

Formal Systems II: Applications

Formal Systems II: Applications Formal Systems II: Applications Functional Verification of Java Programs: Java Dynamic Logic Bernhard Beckert Mattias Ulbrich SS 2017 KIT INSTITUT FÜR THEORETISCHE INFORMATIK KIT University of the State

More information

G52CON: Concepts of Concurrency

G52CON: Concepts of Concurrency G52CON: Concepts of Concurrency Lecture 4: Atomic Actions Natasha Alechina School of Computer Science nza@cs.nott.ac.uk Outline of the lecture process execution fine-grained atomic actions using fine-grained

More information

Casting -Allows a narrowing assignment by asking the Java compiler to "trust us"

Casting -Allows a narrowing assignment by asking the Java compiler to trust us Primitives Integral types: int, short, long, char, byte Floating point types: double, float Boolean types: boolean -passed by value (copied when returned or passed as actual parameters) Arithmetic Operators:

More information

Rely-Guarantee References for Refinement Types over Aliased Mutable Data

Rely-Guarantee References for Refinement Types over Aliased Mutable Data Rely-Guarantee References for Refinement Types over Aliased Mutable Data Colin S. Gordon, Michael D. Ernst, and Dan Grossman University of Washington PLDI 2013 Static Verification Meets Aliasing 23 x:ref

More information

Lecture 4. Towards a Verifying Compiler: Data Abstraction

Lecture 4. Towards a Verifying Compiler: Data Abstraction Lecture 4 Towards a Verifying Compiler: Data Abstraction W olfram Schulte Microsoft Research Formal Methods 2006 Purity, Model fields, Inconsistency Joint work with Rustan Leino, Mike Barnett, Manuel Fähndrich,

More information

Hoare triples. Floyd-Hoare Logic, Separation Logic

Hoare triples. Floyd-Hoare Logic, Separation Logic Hoare triples Floyd-Hoare Logic, Separation Logic 1. Floyd-Hoare Logic 1969 Reasoning about control Hoare triples {A} p {B} a Hoare triple partial correctness: if the initial state satisfies assertion

More information

Aaron Turon! Mozilla Research

Aaron Turon! Mozilla Research Aaron Turon Mozilla Research C/C++ ML/Haskell Rust Safe systems programming Why Mozilla? Browsers need control. Browsers need safety. Servo: Next-generation browser built in Rust. C++ What is control?

More information

C#: framework overview and in-the-small features

C#: framework overview and in-the-small features Chair of Software Engineering Carlo A. Furia, Marco Piccioni, Bertrand Meyer C#: framework overview and in-the-small features Chair of Software Engineering Carlo A. Furia, Marco Piccioni, Bertrand Meyer

More information

A Type System for Borrowing Permissions

A Type System for Borrowing Permissions A Type System for Borrowing Permissions Karl Naden Jonathan Aldrich May 2012 CMU-CS-11-142 Robert Bocchino Kevin Bierhoff School of Computer Science Carnegie Mellon University Pittsburgh, PA 15213 This

More information

Program Verification (6EC version only)

Program Verification (6EC version only) Program Verification (6EC version only) Erik Poll Digital Security Radboud University Nijmegen Overview Program Verification using Verification Condition Generators JML a formal specification language

More information

Question 1. Notes on the Exam. Today. Comp 104: Operating Systems Concepts 11/05/2015. Revision Lectures

Question 1. Notes on the Exam. Today. Comp 104: Operating Systems Concepts 11/05/2015. Revision Lectures Comp 104: Operating Systems Concepts Revision Lectures Today Here are a sample of questions that could appear in the exam Please LET ME KNOW if there are particular subjects you want to know about??? 1

More information

Concurrency in Object Oriented Programs 1. Object-Oriented Software Development COMP4001 CSE UNSW Sydney Lecturer: John Potter

Concurrency in Object Oriented Programs 1. Object-Oriented Software Development COMP4001 CSE UNSW Sydney Lecturer: John Potter Concurrency in Object Oriented Programs 1 Object-Oriented Software Development COMP4001 CSE UNSW Sydney Lecturer: John Potter Outline Concurrency: the Future of Computing Java Concurrency Thread Safety

More information

CMSC 433 Programming Language Technologies and Paradigms. Concurrency

CMSC 433 Programming Language Technologies and Paradigms. Concurrency CMSC 433 Programming Language Technologies and Paradigms Concurrency What is Concurrency? Simple definition Sequential programs have one thread of control Concurrent programs have many Concurrency vs.

More information

CMSC 330: Organization of Programming Languages

CMSC 330: Organization of Programming Languages CMSC 330: Organization of Programming Languages Multithreading Multiprocessors Description Multiple processing units (multiprocessor) From single microprocessor to large compute clusters Can perform multiple

More information

Sequence structure. The computer executes java statements one after the other in the order in which they are written. Total = total +grade;

Sequence structure. The computer executes java statements one after the other in the order in which they are written. Total = total +grade; Control Statements Control Statements All programs could be written in terms of only one of three control structures: Sequence Structure Selection Structure Repetition Structure Sequence structure The

More information

VERIFYING CONCURRENT C PROGRAMS WITH VCC, BOOGIE AND Z3

VERIFYING CONCURRENT C PROGRAMS WITH VCC, BOOGIE AND Z3 VERIFYING CONCURRENT C PROGRAMS WITH VCC, BOOGIE AND Z3 VCC VCC stands for Verifying C Compiler developed in cooperation between RiSE group at MSR Redmond and EMIC a sound C verifier supporting: concurrency

More information

Consistency. CS 475, Spring 2018 Concurrent & Distributed Systems

Consistency. CS 475, Spring 2018 Concurrent & Distributed Systems Consistency CS 475, Spring 2018 Concurrent & Distributed Systems Review: 2PC, Timeouts when Coordinator crashes What if the bank doesn t hear back from coordinator? If bank voted no, it s OK to abort If

More information

Recap. Contents. Reenterancy of synchronized. Explicit Locks: ReentrantLock. Reenterancy of synchronise (ctd) Advanced Thread programming.

Recap. Contents. Reenterancy of synchronized. Explicit Locks: ReentrantLock. Reenterancy of synchronise (ctd) Advanced Thread programming. Lecture 07: Advanced Thread programming Software System Components 2 Behzad Bordbar School of Computer Science, University of Birmingham, UK Recap How to deal with race condition in Java Using synchronised

More information

Static Lock Capabilities for Deadlock-Freedom

Static Lock Capabilities for Deadlock-Freedom Static Lock Capabilities for Deadlock-Freedom Colin S. Gordon csgordon@cs.washington.edu University of Washington TLDI, January 28, 2012 Joint work with Michael D. Ernst and Dan Grossman Colin S. Gordon

More information

Witnessing the Elimination of Magic Wands

Witnessing the Elimination of Magic Wands Witnessing the Elimination of Magic Wands Stefan Blom and Marieke Huisman University of Twente November 8, 2013 Abstract. This paper discusses the use and verification of magic wands. Magic wands are used

More information

Witnessing the elimination of magic wands

Witnessing the elimination of magic wands Int J Softw Tools Technol Transfer (2015) 17:757 781 DOI 10.1007/s10009-015-0372-3 VERIFYTHIS 2012 Witnessing the elimination of magic wands Stefan Blom Marieke Huisman Published online: 31 March 2015

More information

Notes on the Exam. Question 1. Today. Comp 104:Operating Systems Concepts 11/05/2015. Revision Lectures (separate questions and answers)

Notes on the Exam. Question 1. Today. Comp 104:Operating Systems Concepts 11/05/2015. Revision Lectures (separate questions and answers) Comp 104:Operating Systems Concepts Revision Lectures (separate questions and answers) Today Here are a sample of questions that could appear in the exam Please LET ME KNOW if there are particular subjects

More information

Lecture 5. Towards a Verifying Compiler: Multithreading

Lecture 5. Towards a Verifying Compiler: Multithreading Lecture 5 Towards a Verifying Compiler: Multithreading W olfram Schulte Microsoft Research Formal Methods 2006 Race Conditions, Locks, Deadlocks, Invariants, Locklevels Access Sets Joint work with Rustan

More information

Design of Thread-Safe Classes

Design of Thread-Safe Classes Design of Thread-Safe Classes 1 Topic Outline Thread-Safe Classes Principles Confinement Delegation Synchronization policy documentation 2 Thread-safe Class Design Process Identify the object s state (variables)

More information

Grafting Functional Support on Top of an Imperative Language

Grafting Functional Support on Top of an Imperative Language Grafting Functional Support on Top of an Imperative Language How D 2.0 implements immutability and functional purity Andrei Alexandrescu Grafting Functional Support on Top of an Imperative Language p.

More information

MATVEC: MATRIX-VECTOR COMPUTATION LANGUAGE REFERENCE MANUAL. John C. Murphy jcm2105 Programming Languages and Translators Professor Stephen Edwards

MATVEC: MATRIX-VECTOR COMPUTATION LANGUAGE REFERENCE MANUAL. John C. Murphy jcm2105 Programming Languages and Translators Professor Stephen Edwards MATVEC: MATRIX-VECTOR COMPUTATION LANGUAGE REFERENCE MANUAL John C. Murphy jcm2105 Programming Languages and Translators Professor Stephen Edwards Language Reference Manual Introduction The purpose of

More information

BOOGIE. Presentation by Itsik Hefez A MODULAR REUSABLE VERIFIER FOR OBJECT-ORIENTED PROGRAMS MICROSOFT RESEARCH

BOOGIE. Presentation by Itsik Hefez A MODULAR REUSABLE VERIFIER FOR OBJECT-ORIENTED PROGRAMS MICROSOFT RESEARCH BOOGIE A MODULAR REUSABLE VERIFIER FOR OBJECT-ORIENTED PROGRAMS MICROSOFT RESEARCH Presentation by Itsik Hefez Introduction Boogie is an intermediate verification language, intended as a layer on which

More information

The Pointer Assertion Logic Engine

The Pointer Assertion Logic Engine The Pointer Assertion Logic Engine [PLDI 01] Anders Mφller Michael I. Schwartzbach Presented by K. Vikram Cornell University Introduction Pointer manipulation is hard Find bugs, optimize code General Approach

More information

Runtime assertion checking of multithreaded Java programs

Runtime assertion checking of multithreaded Java programs Master Thesis Runtime assertion checking of multithreaded Java programs An extension of the STROBE framework Author: Jorne Kandziora Supervisors: dr. M. Huisman dr. C.M. Bockisch M. Zaharieva-Stojanovski,

More information

The Singleton Pattern. Design Patterns In Java Bob Tarr

The Singleton Pattern. Design Patterns In Java Bob Tarr The Singleton Pattern Intent Ensure a class only has one instance, and provide a global point of access to it Motivation Sometimes we want just a single instance of a class to exist in the system For example,

More information

Thread Safety. Review. Today o Confinement o Threadsafe datatypes Required reading. Concurrency Wrapper Collections

Thread Safety. Review. Today o Confinement o Threadsafe datatypes Required reading. Concurrency Wrapper Collections Thread Safety Today o Confinement o Threadsafe datatypes Required reading Concurrency Wrapper Collections Optional reading The material in this lecture and the next lecture is inspired by an excellent

More information

Comp 204: Computer Systems and Their Implementation. Lecture 25a: Revision Lectures (separate questions and answers)

Comp 204: Computer Systems and Their Implementation. Lecture 25a: Revision Lectures (separate questions and answers) Comp 204: Computer Systems and Their Implementation Lecture 25a: Revision Lectures (separate questions and answers) 1 Today Here are a sample of questions that could appear in the exam Please LET ME KNOW

More information

Specifying Multi-Threaded Java Programs

Specifying Multi-Threaded Java Programs Specifying Multi-Threaded Java Programs A Comparison between JML and Separation Logic Ronald Burgman Faculty of Electrical Engineering, Mathematics and Computer Science University of Twente r.w.burgman@student.utwente.nl

More information

Computing Approximate Happens-Before Order with Static and Dynamic Analysis

Computing Approximate Happens-Before Order with Static and Dynamic Analysis Department of Distributed and Dependable Systems Technical report no. D3S-TR-2013-06 May 7, 2018 Computing Approximate Happens-Before Order with Static and Dynamic Analysis Pavel Parízek, Pavel Jančík

More information

Consistency: Strict & Sequential. SWE 622, Spring 2017 Distributed Software Engineering

Consistency: Strict & Sequential. SWE 622, Spring 2017 Distributed Software Engineering Consistency: Strict & Sequential SWE 622, Spring 2017 Distributed Software Engineering Review: Real Architectures N-Tier Web Architectures Internet Clients External Cache Internal Cache Web Servers Misc

More information

Titanium. Titanium and Java Parallelism. Java: A Cleaner C++ Java Objects. Java Object Example. Immutable Classes in Titanium

Titanium. Titanium and Java Parallelism. Java: A Cleaner C++ Java Objects. Java Object Example. Immutable Classes in Titanium Titanium Titanium and Java Parallelism Arvind Krishnamurthy Fall 2004 Take the best features of threads and MPI (just like Split-C) global address space like threads (ease programming) SPMD parallelism

More information

MultiJav: A Distributed Shared Memory System Based on Multiple Java Virtual Machines. MultiJav: Introduction

MultiJav: A Distributed Shared Memory System Based on Multiple Java Virtual Machines. MultiJav: Introduction : A Distributed Shared Memory System Based on Multiple Java Virtual Machines X. Chen and V.H. Allan Computer Science Department, Utah State University 1998 : Introduction Built on concurrency supported

More information

CS 5523 Operating Systems: Midterm II - reivew Instructor: Dr. Tongping Liu Department Computer Science The University of Texas at San Antonio

CS 5523 Operating Systems: Midterm II - reivew Instructor: Dr. Tongping Liu Department Computer Science The University of Texas at San Antonio CS 5523 Operating Systems: Midterm II - reivew Instructor: Dr. Tongping Liu Department Computer Science The University of Texas at San Antonio Fall 2017 1 Outline Inter-Process Communication (20) Threads

More information

Having a BLAST with SLAM

Having a BLAST with SLAM Having a BLAST with SLAM # #2 Topic: Software Model Checking via Counter-Example Guided Abstraction Refinement There are easily two dozen SLAM/BLAST/MAGIC papers; I will skim. #3 SLAM Overview INPUT: Program

More information

Midterm Exam Solutions and Grading Guidelines March 3, 1999 CS162 Operating Systems

Midterm Exam Solutions and Grading Guidelines March 3, 1999 CS162 Operating Systems University of California, Berkeley College of Engineering Computer Science Division EECS Spring 1999 Anthony D. Joseph Midterm Exam Solutions and Grading Guidelines March 3, 1999 CS162 Operating Systems

More information

THREADS: (abstract CPUs)

THREADS: (abstract CPUs) CS 61 Scribe Notes (November 29, 2012) Mu, Nagler, Strominger TODAY: Threads, Synchronization - Pset 5! AT LONG LAST! Adversarial network pong handling dropped packets, server delays, overloads with connection

More information

Applications of Ownership Types. Bertinoro Summer School Ownership Types page 1 out of 23

Applications of Ownership Types. Bertinoro Summer School Ownership Types page 1 out of 23 Applications of Ownership Types Bertinoro Summer School Ownership Types page 1 out of 23 Ownership Application 1- restrict aliasing College c; College c ; We can deduce that c.ee and c.dramsoc

More information

CS 5220: Shared memory programming. David Bindel

CS 5220: Shared memory programming. David Bindel CS 5220: Shared memory programming David Bindel 2017-09-26 1 Message passing pain Common message passing pattern Logical global structure Local representation per processor Local data may have redundancy

More information

Introduction to Programming Using Java (98-388)

Introduction to Programming Using Java (98-388) Introduction to Programming Using Java (98-388) Understand Java fundamentals Describe the use of main in a Java application Signature of main, why it is static; how to consume an instance of your own class;

More information

Sharing Objects Ch. 3

Sharing Objects Ch. 3 Sharing Objects Ch. 3 Visibility What is the source of the issue? Volatile Dekker s algorithm Publication and Escape Thread Confinement Immutability Techniques of safe publication Assignment 1 Visibility

More information

Parallel Programming Languages COMP360

Parallel Programming Languages COMP360 Parallel Programming Languages COMP360 The way the processor industry is going, is to add more and more cores, but nobody knows how to program those things. I mean, two, yeah; four, not really; eight,

More information

Chapter 32 Multithreading and Parallel Programming

Chapter 32 Multithreading and Parallel Programming Chapter 32 Multithreading and Parallel Programming 1 Objectives To get an overview of multithreading ( 32.2). To develop task classes by implementing the Runnable interface ( 32.3). To create threads to

More information