Documentation

CslibFrontier.Computability.Distributed.ConcurrentObjects.Linearizability.Nonblocking

Incremental completion extensions and Herlihy–Wing Theorem 2 (Nonblocking) #

Incremental invariants for appending pending invocations, linearizing pending operations in a completion extension, flushing already-linearized responses into the observed history, and Herlihy–Wing Theorem 2 (exists_linearizable_append_resp_of_total, the nonblocking completion property of linearizability for pending total operations; [HW90], §3.2, Theorem 2, pp. 471–472; [SHP21], §5.3, Theorem 5.2, p. 9).

Main results #

References #

theorem Cslib.Distributed.ConcurrentObjects.History.append_pending_inv_extension {P : Type u_1} {Obj : Type u_2} {Op : Obj → Type u_3} {Resp : Obj → Type u_4} [DecidableEq P] {H R S : History P Op Resp} {p : P} {x : Obj} (op : Op x) {cs_p : List (OpCall P Op Resp)} (hwf' : (H ++ R).WellFormed) (heqS : (H ++ R).complete.Equivalent S) (hprecS : ∀ (e₀ e₁ : OpId P), (H ++ R).IsCompletedOp e₀ → (H ++ R).IsCompletedOp e₁ → H.prec e₀ e₁ → S.prec e₀ e₁) (hHp : H.procSubhistory p = List.flatMap OpCall.toEvents cs_p) (hRp_nil : R.procSubhistory p = []) :
have H₁ := H ++ [Event.inv p x op]; (H₁ ++ R).WellFormed ∧ (H₁ ++ R).complete.Equivalent S ∧ ∀ (e₀ e₁ : OpId P), (H₁ ++ R).IsCompletedOp e₀ → (H₁ ++ R).IsCompletedOp e₁ → H₁.prec e₀ e₁ → S.prec e₀ e₁

Appending a new invocation Event.inv p x op for an idle process p (whose subhistory in H consists solely of completed calls cs_p and has no pending response in R) preserves well-formedness of (H ++ [Event.inv p x op]) ++ R, leaves complete unchanged, and preserves real-time precedence into S.

theorem Cslib.Distributed.ConcurrentObjects.History.linearize_pending_in_extension {P : Type u_1} {Obj : Type u_2} {Op : Obj → Type u_3} {Resp : Obj → Type u_4} [DecidableEq P] {H R S : History P Op Resp} {p : P} {x : Obj} {op : Op x} (res : Resp x) {cs_p : List (OpCall P Op Resp)} (hR_resp : R.IsRespList) (hwf' : (H ++ R).WellFormed) (hseqS : S.IsSequential) (heqS : (H ++ R).complete.Equivalent S) (hprecS : ∀ (e₀ e₁ : OpId P), (H ++ R).IsCompletedOp e₀ → (H ++ R).IsCompletedOp e₁ → H.prec e₀ e₁ → S.prec e₀ e₁) (hHp : H.procSubhistory p = List.flatMap OpCall.toEvents cs_p ++ [Event.inv p x op]) (hRp_nil : R.procSubhistory p = []) :
have R₁ := R ++ [Event.resp p x res]; have S' := S ++ [Event.inv p x op, Event.resp p x res]; R₁.IsRespList ∧ (H ++ R₁).WellFormed ∧ S'.IsSequential ∧ (H ++ R₁).complete.Equivalent S' ∧ ∀ (e₀ e₁ : OpId P), (H ++ R₁).IsCompletedOp e₀ → (H ++ R₁).IsCompletedOp e₁ → H.prec e₀ e₁ → S'.prec e₀ e₁

Linearizing an uncompleted pending invocation Event.inv p x op of process p by appending Event.resp p x res to the response extension R and [Event.inv p x op, Event.resp p x res] to the sequential witness S preserves well-formedness, sequentiality, equivalence of complete, and real-time precedence <_H.

theorem Cslib.Distributed.ConcurrentObjects.History.flush_resp_from_extension {P : Type u_1} {Obj : Type u_2} {Op : Obj → Type u_3} {Resp : Obj → Type u_4} [DecidableEq P] {H R S : History P Op Resp} {p : P} {x : Obj} {res : Resp x} (hR_resp : R.IsRespList) (hwf' : (H ++ R).WellFormed) (heqS : (H ++ R).complete.Equivalent S) (hprecS : ∀ (e₀ e₁ : OpId P), (H ++ R).IsCompletedOp e₀ → (H ++ R).IsCompletedOp e₁ → H.prec e₀ e₁ → S.prec e₀ e₁) (hRp_eq : R.procSubhistory p = [Event.resp p x res]) :
have H₁ := H ++ [Event.resp p x res]; have R' := List.filter (fun (e : Event P Op Resp) => decide (e.proc ≠ p)) R; IsRespList R' ∧ (∀ (q : P), (H₁ ++ R').procSubhistory q = (H ++ R).procSubhistory q) ∧ (H₁ ++ R').WellFormed ∧ (H₁ ++ R').complete.Equivalent S ∧ ∀ (e₀ e₁ : OpId P), (H₁ ++ R').IsCompletedOp e₀ → (H₁ ++ R').IsCompletedOp e₁ → H₁.prec e₀ e₁ → S.prec e₀ e₁

Moving an already-linearized pending response Event.resp p x res of process p from the extension R into H₁ := H ++ [Event.resp p x res] (leaving R' := R.filter (·.proc ≠ p)) preserves every process subhistory of H₁ ++ R' and maintains real-time precedence into S.

theorem Cslib.Distributed.ConcurrentObjects.exists_linearizable_append_resp_of_total {P : Type u_1} {Obj : Type u_2} {Op : Obj → Type u_3} {Resp : Obj → Type u_4} [DecidableEq P] [DecidableEq Obj] {spec : (y : Obj) → SeqSpec P Op Resp y} {H : History P Op Resp} {p : P} {x : Obj} {op : Op x} (hlin : IsLinearizable spec H) (htot : (spec x).IsTotalOp op) (hpending : ∃ (cs : List (OpCall P Op Resp)), H.procSubhistory p = List.flatMap OpCall.toEvents cs ++ [Event.inv p x op]) :
∃ (res : Resp x), IsLinearizable spec (H ++ [Event.resp p x res])

Herlihy–Wing Theorem 2 (Nonblocking Property of Linearizability) ([HW90], §3.2, Theorem 2, pp. 471–472; amended L2 proof of [SHP21], §5.3, Theorem 5.2, p. 9): if process p has a pending invocation of a total operation op : Op x in a linearizable history H, then there exists a response res : Resp x such that H ++ [Event.resp p x res] is also linearizable.