Skip to content
Snippets Groups Projects
Commit 4b77644c authored by Ralf Jung's avatar Ralf Jung
Browse files

add related work to linear paradox variant 2

parent 0bc19271
No related branches found
No related tags found
No related merge requests found
...@@ -218,8 +218,8 @@ End inv. End inv. ...@@ -218,8 +218,8 @@ End inv. End inv.
(** This proves that if we have linear impredicative invariants, we can still (** This proves that if we have linear impredicative invariants, we can still
drop arbitrary resources (i.e., we can "defeat" linearity). drop arbitrary resources (i.e., we can "defeat" linearity).
Variant 1: a strong invariant creation lemma that lets us create invariants Variant 1: we assume a strong invariant creation lemma that lets us create
in the "open" state. *) invariants in the "open" state. *)
Module linear1. Section linear1. Module linear1. Section linear1.
Context {PROP: sbi}. Context {PROP: sbi}.
Implicit Types P : PROP. Implicit Types P : PROP.
...@@ -271,9 +271,23 @@ End linear1. End linear1. ...@@ -271,9 +271,23 @@ End linear1. End linear1.
(** This proves that if we have linear impredicative invariants, we can still (** This proves that if we have linear impredicative invariants, we can still
drop arbitrary resources (i.e., we can "defeat" linearity). drop arbitrary resources (i.e., we can "defeat" linearity).
Variant 2: the invariant can depend on the chosen [γ], and we also have Variant 2: maybe the strong invariant creation lemma (variant 1 above) is a bit
an accessor that gives back the invariant token immediately, too obvious, so here we just assume that the invariant can depend on the chosen
not just after the invariant got closed again. *) [γ]. Moreover, we also have an accessor that gives back the invariant token
immediately, not just after the invariant got closed again.
The assumptions here match the proof rules in Iron, save for the side-condition
that the invariant must be "uniform". In particular, [cinv_alloc] delays
handing out the [cinv_own] token until after the invariant has been created so
that this can match Iron by picking [cinv_own γ := fcinv_own γ 1 ∗
fcinv_cancel_own γ 1]. This means [cinv_own] is not "uniform" in Iron terms,
which is why Iron does not suffer from this contradiction.
This also loosely matches VST's locks with stored resource invariants.
There, the stronger variant of the "unlock" rule (see Aquinas Hobor's PhD thesis
"Oracle Semantics", §4.7, p. 88) also permits putting the token of a lock
entirely into that lock.
*)
Module linear2. Section linear2. Module linear2. Section linear2.
Context {PROP: sbi}. Context {PROP: sbi}.
Implicit Types P : PROP. Implicit Types P : PROP.
...@@ -292,9 +306,6 @@ Module linear2. Section linear2. ...@@ -292,9 +306,6 @@ Module linear2. Section linear2.
[cinv_own] but we do not need that. They would also have a name matching [cinv_own] but we do not need that. They would also have a name matching
the [mask] type, but we do not need that either.) *) the [mask] type, but we do not need that either.) *)
Context (gname : Type) (cinv : gname PROP PROP) (cinv_own : gname PROP). Context (gname : Type) (cinv : gname PROP PROP) (cinv_own : gname PROP).
(** [cinv_alloc] delays handing out the [cinv_own] token until after the
invariant has been created so that this can match Iron by picking
[cinv_own γ := fcinv_own γ 1 ∗ fcinv_cancel_own γ 1]. *)
Hypothesis cinv_alloc : E, Hypothesis cinv_alloc : E,
fupd E E ( γ, P, P -∗ fupd E E (cinv γ P cinv_own γ))%I. fupd E E ( γ, P, P -∗ fupd E E (cinv γ P cinv_own γ))%I.
Hypothesis cinv_access : P γ, Hypothesis cinv_access : P γ,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment