Skip to content
Snippets Groups Projects
Commit 9ba8b512 authored by Simon Spies's avatar Simon Spies
Browse files

use tokens instead of auth

parent 8a9e98cf
No related branches found
No related tags found
No related merge requests found
Pipeline #111593 passed
...@@ -4,29 +4,28 @@ From iris.base_logic.lib Require Export invariants na_invariants. ...@@ -4,29 +4,28 @@ From iris.base_logic.lib Require Export invariants na_invariants.
From iris.heap_lang Require Export lang lifting. From iris.heap_lang Require Export lang lifting.
From iris.proofmode Require Import tactics. From iris.proofmode Require Import tactics.
From iris.heap_lang Require Import proofmode notation metatheory. From iris.heap_lang Require Import proofmode notation metatheory.
From iris.algebra Require Import auth. From iris.algebra Require Import auth excl.
From iris.algebra.ordinals Require Import arithmetic. From iris.algebra.ordinals Require Import arithmetic.
Set Default Proof Using "Type". Set Default Proof Using "Type".
Section token_ra. Section token_ra.
Context {SI: indexT} {Σ: gFunctors SI} `{!inG Σ (authR (unitUR SI))}. (* NOTE: compared to the original submission, this version now uses the
more canonical exclusive resource algebra (instead of auth(unit)). *)
Context {SI: indexT} {Σ: gFunctors SI} `{!inG Σ (exclR (unitO SI))}.
Definition tok γ := own γ ( ()). Definition tok γ := own γ (Excl ()).
Lemma tok_alloc: (|==> γ, tok γ)%I. Lemma tok_alloc: (|==> γ, tok γ)%I.
Proof. Proof.
iStartProof. iMod (own_alloc ( ())); auto. iStartProof. iMod (own_alloc (Excl ())); auto. done.
by apply auth_auth_valid.
Qed. Qed.
Lemma tok_unique γ: tok γ tok γ False. Lemma tok_unique γ: tok γ tok γ False.
Proof. Proof.
rewrite /tok -own_op own_valid -auth_auth_frac_op uPred.discrete_valid. rewrite /tok -own_op own_valid uPred.discrete_valid.
iIntros (Htok). apply ->(@auth_auth_frac_valid SI) in Htok. iIntros (Htok). destruct Htok.
destruct Htok as [Htok _]. apply ->(@frac_valid' SI) in Htok.
exfalso. by eapply Qp_not_plus_q_ge_1.
Qed. Qed.
End token_ra. End token_ra.
...@@ -86,7 +85,7 @@ Definition get : val := ...@@ -86,7 +85,7 @@ Definition get : val :=
end. end.
Section semantic_model. Section semantic_model.
Context {SI} {Σ: gFunctors SI} `{Heap: !heapG Σ} `{TimeCredits: !tcG Σ} `{Sequential: !seqG Σ} `{FBI: FiniteBoundedExistential SI} `{Tok: !inG Σ (authR (unitUR SI))}. Context {SI} {Σ: gFunctors SI} `{Heap: !heapG Σ} `{TimeCredits: !tcG Σ} `{Sequential: !seqG Σ} `{FBI: FiniteBoundedExistential SI} `{Tok: !inG Σ (exclR (unitO SI))}.
Implicit Types (l r: loc). Implicit Types (l r: loc).
Implicit Types (n: nat). Implicit Types (n: nat).
......
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