Reasoning over Permissions Regions in Concurrent Separation Logic
James Brotherston, Diana Costa, Aquinas Hobor and John Wickerson
IRIS Day O’Science, Coronavirus Lockdown Edition
Tuesday 7th April, 2020
1/ 13
Reasoning over Permissions Regions in Concurrent Separation Logic - - PowerPoint PPT Presentation
Reasoning over Permissions Regions in Concurrent Separation Logic James Brotherston, Diana Costa, Aquinas Hobor and John Wickerson IRIS Day OScience, Coronavirus Lockdown Edition Tuesday 7th April, 2020 1/ 13 Concurrent separation logic (
James Brotherston, Diana Costa, Aquinas Hobor and John Wickerson
IRIS Day O’Science, Coronavirus Lockdown Edition
Tuesday 7th April, 2020
1/ 13
following concurrency rule: {A1} C1 {B1} {A2} C2 {B2} {A1 ⊛ A2} C1 || C2 {B1 ⊛ B2}
compositionally with respect to separation (⊛) between their respective memory resources.
read-only resources between threads, which can be controlled using fractional permissions.
2/ 13
memory into two or more “read-only copies”.
(0, 1) are read-only permissions.
Heaps can be composed provided they agree where they
x 0.5 → d ⊛ x 0.5 → d ≡ x → d .
3/ 13
{x → d} {x 0.5 → d ⊛ x 0.5 → d} {x 0.5 → d} {x 0.5 → d} foo(); bar(); {x 0.5 → d ∗ A} {x 0.5 → d ∗ B} {x 0.5 → d ⊛ x 0.5 → d ⊛ A ⊛ B} {x → d ⊛ A ⊛ B}
regions of memory and not just pointers.
4/ 13
Suppose we define linked list segments using ⊛: ls x y =def (x = y ∧ emp) ∨ (∃z. x → z ⊛ ls z y) . Now consider traversal procedure foo(x,y): foo(x,y) { if x=y then return; else foo([x],y); } This satisfies the following Hoare triple:
foo(x,y);
. However, we will have difficulties proving so!
5/ 13
foo(x,y) { if x=y then return;
else
→ z ⊛ (ls z y)0.5)
→ z ⊛ (ls z y)0.5 × (x → z ⊛ ls z y)0.5
}
6/ 13
x 0.5 → z ⊛ (ls z y)0.5 | = (x → z ⊛ ls z y)0.5 .
the LHS, but not on the RHS. In general, Aπ ⊛ Bπ | = (A ⊛ B)π .
disjointness of heaps, to define our list segments, the proof above goes through (since (A ∗ B)π ≡ Aπ ∗ Bπ).
7/ 13
The triple {ls x y} foo(x,y); || foo(x,y);{ls x y} is correct, but again the proof fails: {ls x y}
foo(x,y); foo(x,y);
× {ls x y}
8/ 13
(ls x y)0.5 ⊛ (ls x y)0.5 | = ls x y .
(partially) non-overlapping. In general, A0.5 ⊛ A0.5 | = A .
the two formulas (ls x y)0.5 are copies of the same region.
9/ 13
nominal α is interpreted as denoting a unique heap.
(α ∧ A)σ ⊛ (α ∧ A)π ≡ (α ∧ A)σ⊕π where ⊕ is addition on permissions.
every instance of ls x y by α ∧ ls x y (and adding an initial step in which we introduce the fresh label α).
10/ 13
strong ∗ separating conjunctions, and nominal labels α.
meaning A is true at α, which is useful in treating more complex sharing examples.
(A ∗ B)π ≡ Aπ ∗ Bπ (α ∧ A)σ ⊛ (α ∧ A)π ≡ (α ∧ A)σ⊕π
CSL to verify various concurrent programs with sharing.
11/ 13
12/ 13
James Brotherston, Diana Costa, Aquinas Hobor and John Wickerson. Reasoning over Permissions Regions in Concurrent Separation Logic. Accepted to CAV 2020.
13/ 13