Extends a sequential specification to the concurrent setting. (Herlihy and Wing,TOPLAS1990)
We are looking at the monitoring problem; Is a given execution (consisting of a sequence of calls and returns) linearizable?
We assume the history is differentiated: each value occurs in at most one push and one pop.
Any (stack/queue) history h is linearizable if and only if there is a linearizable differentiated history h’ and some map that renames the values of h’ to the values of h. (Abdulla, Haziza, Holík, Jonsson, and Rezine,TACAS2013)
This enables us to construct polynomial-time algorithms
We present an algorithm that is quadratic in the length of the history.
If we ever cannot progress, conclude unlinearizability.
pop-operations that returns \(\bot\), indicating an empty stack
First, sort values by push return. O(n log n)
We achieve \(O(n~log~n)\).
Small model property; a (differentiated, completed) queue history is linearizable if and only if for no pair of values \(a\), \(b\), we have
\[enq(a) < enq(b) \wedge deq(b) < deq(a)\]
where < is the happens-before relation
Note: does not hold for stacks.
\[enq(a) < enq(b) \wedge deq(b) < deq(a)\]
\[\textrm{outer seg. of } b \subseteq \textrm{inner seg. of } a\]
We want to see if for any two values, the outer (enq.call, deq.ret) segment of one is contained in the inner (enq.ret, deq.call) segment of the other. We call a pair of such values critical.
We construct a red-black tree, where each node contains
We present an \(O(n)\) algorithm for (multi)sets, with operations add(x) and rmv(x).
We also present a greedy linear-time algorithm for sets with membership queries.
We have shown monitoring algorithms