Prophecy Variables in Separation Logic
(Extending Iris with Prophecy Variables)
Ralf Jung, Rodolphe Lepigre, Gaurav Parthasarathy, Marianna Rapoport, Amin Timany, Derek Dreyer, Bart Jacobs
MPI-SWS, KU Leuven, ETH Zürich, University of Waterloo
Prophecy Variables in Separation Logic (Extending Iris with Prophecy - - PowerPoint PPT Presentation
Prophecy Variables in Separation Logic (Extending Iris with Prophecy Variables) Ralf Jung, Rodolphe Lepigre, Gaurav Parthasarathy, Marianna Rapoport, Amin Timany, Derek Dreyer, Bart Jacobs MPI-SWS, KU Leuven, ETH Zrich, University of Waterloo
MPI-SWS, KU Leuven, ETH Zürich, University of Waterloo
1
1
1
2
2
3
3
3
3
3
4
4
4
5
5
5
6
6
7
7
1 (p, b) gives exclusive right to resolve p
7
1 (p, b) gives exclusive right to resolve p
7
1 (p, b) gives exclusive right to resolve p
7
8
1 (p, b)}
8
1 (p, b)}
8
1 (p, b)}
1 (p, b)}
8
1 (p, b)}
1 (p, b)}
8
1 (p, b)}
1 (p, b)}
8
9
1 (c.p, b)) 9
10
10
11
11
11
11
11
12
12
wp e1 {Φ} if e1 ∈ Val then Φ(e1) else (return value) ∀σ1, κ1, κ2. S(σ1, κ1 + + κ2) reducible(e1, σ1) ∧ (progress) ∀e2, σ2, ef.
ef, κ1)
κ2) ∗ wp e2 {Φ} ∗∗e∈
ef wp e {True}
(preservation) S(σ, κ) • σ.1
γheap ∗ ∃Π. • Π γproph ∧ dom(Π) = σ.2 ∧
∀{p ← vs} ∈ Π. vs = filter(p, κ) (state interp.)
13
wp e1 {Φ} if e1 ∈ Val then Φ(e1) else (return value) ∀σ1, κ1, κ2. S(σ1, κ1 + + κ2) reducible(e1, σ1) ∧ (progress) ∀e2, σ2, ef.
ef, κ1)
κ2) ∗ wp e2 {Φ} ∗∗e∈
ef wp e {True}
(preservation) S(σ, κ) • σ.1
γheap ∗ ∃Π. • Π γproph ∧ dom(Π) = σ.2 ∧
∀{p ← vs} ∈ Π. vs = filter(p, κ) (state interp.) Reduction now collects “observations”
13
wp e1 {Φ} if e1 ∈ Val then Φ(e1) else (return value) ∀σ1, κ1, κ2. S(σ1, κ1 + + κ2) reducible(e1, σ1) ∧ (progress) ∀e2, σ2, ef.
ef, κ1)
κ2) ∗ wp e2 {Φ} ∗∗e∈
ef wp e {True}
(preservation) S(σ, κ) • σ.1
γheap ∗ ∃Π. • Π γproph ∧ dom(Π) = σ.2 ∧
∀{p ← vs} ∈ Π. vs = filter(p, κ) (state interp.) Reduction now collects “observations” Observations yet to be made
13
14
14
14
wp e1 {Φ} if e1 ∈ Val then Φ(e1) else (return value) ∀σ1. S(σ1) reducible(e1, σ1) ∧ (progress) ∀e2, σ2, ef.
ef)
ef wp e {True}
(preservation) S(σ) • σ
γheap
(state interp.) Some intuitions about the involved components:
Q allow updates to owned resources
15
16
wp e1 {Φ} if e1 ∈ Val then Φ(e1) else (return value) ∀σ1, κ1, κ2. S(σ1, κ1 + + κ2) reducible(e1, σ1) ∧ (progress) ∀e2, σ2, ef.
ef, κ1)
κ2) ∗ wp e2 {Φ} ∗∗e∈
ef wp e {True}
(preservation) S(σ, κ) • σ.1
γheap ∗ ∃Π. • Π γproph ∧ dom(Π) = σ.2 ∧
∀{p ← vs} ∈ Π. vs = filter(p, κ) (state interp.) Some more intuitions about the involved components:
17
tp (e2 ::
18