13.07.2015 Views

Nested Hoare Triples and Frame Rules for Higher-order Store

Nested Hoare Triples and Frame Rules for Higher-order Store

Nested Hoare Triples and Frame Rules for Higher-order Store

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Since w = n w ′ , we have ι −1 (w ′ )(emp) n−1= ι −1 (w)(emp). Hence, by thenon-expansiveness of p <strong>and</strong> the compatibility of ∗ with projections, we haveπ n−1 (h) ∈ p(w) ∗ ι −1 (w)(emp) ∗ r. By the assumption that w |= {p}c{q}, thisyields c(π n−1 (h)) ∈ Ad(q(w)∗ι −1 (w)(emp)∗r). Using the non-expansiveness of q,the uni<strong>for</strong>mity of r, <strong>and</strong> the fact that ι −1 (w)(emp) n−1= ι −1 (w ′ )(emp) again, weknow that π n−1 (h ′ ) ∈ q(w ′ )∗ι −1 (w ′ )(emp)∗r whenever h ′ ∈ q(w)∗ι −1 (w)(emp)∗r. Thus π n−1 (c(π n−1 (h))) ∈ Ad(q(w ′ ) ∗ ι −1 (w ′ )(emp) ∗ r) by Lemma 15 <strong>and</strong> thecontinuity of π n−1 . This was to show.⊓⊔Lemma 18 (Heyting BI algebra). Let I = {{||}, ⊥}. Then (UAdm, ⊆, ∗, I)is a complete BI algebra. That is, (UAdm, ⊆) is a residuated complete Heytingalgebra with a (monotone) commutative monoid structure (UAdm, ∗, I) <strong>and</strong> the∗ operator also has the corresponding residuation operator.Proof. Since admissibility <strong>and</strong> uni<strong>for</strong>mity are preserved by arbitrary intersections,UAdm is a complete lattice, with meets given by set-theoretic intersection,least element {⊥} <strong>and</strong> greatest element Heap. Binary joins are given byset-theoretic union, <strong>and</strong> arbitrary joins by ⊔ i p i = ⋂ {p ∈ UAdm | p ⊇ ⋃ i p i}.The join is described more explicitly as ⊔ i p i = {h | ∀n ∈ ω. π n (h) ∈ ⋃ i p i}.First, note that the right h<strong>and</strong> side r = def{h | ∀n ∈ ω. π n (h) ∈ ⋃ i p i} is anelement of UAdm: r is uni<strong>for</strong>m, i.e., h ∈ r implies π m (h) ∈ r <strong>for</strong> all m ∈ ω, sinceπ n · π m = π min{n,m} . To show that r is also admissible suppose h 0 ⊑ h 1 ⊑ . . . isa chain in r, <strong>and</strong> let h be the lub of this chain. We must show that π n (h) ∈ ⋃ i p i<strong>for</strong> all n ∈ ω. By compactness, π n (h) ⊑ h k ⊑ h <strong>for</strong> some k, <strong>and</strong> hence π n (h) =π n (h k ) ∈ ⋃ p i using the idempotency of π n <strong>and</strong> the fact that h k ∈ r. To seethe inclusion r ⊆ ⊔ i p i, note that <strong>for</strong> all h, if π n (h) ∈ ⋃ i p i ⊆ p <strong>for</strong> all n ∈ ω<strong>and</strong> some arbitrary p ∈ UAdm, then also h = ⊔ n π n (h) ∈ p by admissibility, <strong>and</strong>hence h ∈ ⊔ i p i follows. For the other inclusion, we claim that the right h<strong>and</strong>side r = def{h | ∀n ∈ ω. π n (h) ∈ ⋃ i p i} is one of the elements appearing in theintersection; from this claim it is immediate that r ⊇ ⊔ i p i. The claim followssince r ⊇ ⋃ i p i by the uni<strong>for</strong>mity of the p i ’s.The implication of this complete lattice UAdm is described by p ⇒ q def={h | ∀n ∈ ω. if π n (h) ∈ p then π n (h) ∈ q}: Using π n · π m = π min{n,m} it is easyto see that p ⇒ q is uni<strong>for</strong>m. Admissibility follows analogously to the case ofjoins: if h 0 ⊑ h 1 ⊑ . . . is a chain in p ⇒ q with lub h, <strong>and</strong> if n ∈ ω is such thatπ n (h) ∈ p then we must show that π n (h) ∈ q. Since π n (h) ⊑ h is compact, thereis some k such that π n (h) ⊑ h k ⊑ h, <strong>and</strong> thus the required π n (h) = π n (h k ) ∈ qfollows from h k ∈ p ⇒ q. Next, to see that p ⇒ q is indeed the implicationin UAdm, first note that we have p ∩ (p ⇒ q) ⊆ q, using the uni<strong>for</strong>mity of p<strong>and</strong> the admissibility of q. If p ∩ r ⊆ q <strong>for</strong> some r ∈ UAdm, <strong>and</strong> h ∈ r <strong>and</strong>π n (h) ∈ p <strong>for</strong> some n ∈ ω, then the uni<strong>for</strong>mity of r yields π n (h) ∈ q. Thus weobtain p ∩ r ⊆ q ⇔ r ⊆ p ⇒ q.That ∗ is an operation on UAdm is established in the proof of Lemma 12. Itis easy to check that ∗ is commutative <strong>and</strong> associative <strong>and</strong> that it is monotone,i.e., if p ⊆ p ′ <strong>and</strong> q ⊆ q ′ then p ∗ q ⊆ p ′ ∗ q ′ . Moreover, we have I ∈ UAdm, <strong>and</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!