Commit 6454d3df authored by Rodolphe Lepigre's avatar Rodolphe Lepigre Committed by Ralf Jung

Herlihy-Wing queue example (involving prophecy variables)

parent 95827b99
...@@ -110,3 +110,5 @@ theories/logatom/conditional_increment/cinc.v ...@@ -110,3 +110,5 @@ theories/logatom/conditional_increment/cinc.v
theories/logatom/rdcss/rdcss.v theories/logatom/rdcss/rdcss.v
theories/logatom/rdcss/spec.v theories/logatom/rdcss/spec.v
theories/logatom/proph_erasure.v theories/logatom/proph_erasure.v
theories/logatom/herlihy_wing_queue/spec.v
theories/logatom/herlihy_wing_queue/hwq.v
This source diff could not be displayed because it is too large. You can view the blob instead.
From iris.heap_lang Require Export lifting notation.
From iris.program_logic Require Export atomic.
Set Default Proof Using "Type".
(** A general logically atomic interface for Herlihy-Wing queues. *)
Record atomic_hwq {Σ} `{!heapG Σ} := AtomicHWQ {
(* -- operations -- *)
new_queue : val;
enqueue : val;
dequeue : val;
(* -- other data -- *)
name : Type;
name_eqdec : EqDecision name;
name_countable : Countable name;
(* -- predicates -- *)
is_hwq (N : namespace) (sz : nat) (γ : name) (v : val) : iProp Σ;
hwq_content (γ : name) (ls : list loc) : iProp Σ;
(* -- predicate properties -- *)
is_hwq_persistent N sz γ v : Persistent (is_hwq N sz γ v);
hwq_content_timeless γ ls : Timeless (hwq_content γ ls);
hwq_content_exclusive γ ls1 ls2 :
hwq_content γ ls1 - hwq_content γ ls2 - False;
(* -- operation specs -- *)
new_queue_spec N (sz : nat) :
0 < sz
{{{ True }}}
new_queue #sz
{{{ v γ, RET v; is_hwq N sz γ v hwq_content γ [] }}};
enqueue_spec N (sz : nat) (γ : name) (q : val) (l : loc) :
is_hwq N sz γ q -
<<< (ls : list loc), hwq_content γ ls >>>
enqueue q #l @ N
<<< hwq_content γ (ls ++ [l]), RET #() >>>;
dequeue_spec N (sz : nat) (γ : name) (q : val) :
is_hwq N sz γ q -
<<< (ls : list loc), hwq_content γ ls >>>
dequeue q @ N
<<< (l : loc) ls', ls = l :: ls' hwq_content γ ls', RET #l >>>;
}.
Arguments atomic_hwq _ {_}.
Existing Instances is_hwq_persistent hwq_content_timeless.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment