20.9 Piecewise merge of paired states
Let a site state be a pair (v,d), where v is a vector time and d is a database value. This section investigates a merge operator + that uses vector-time ordering to discard a causally dominated input and invokes a separate database-value merge ⊕ only when neither input strictly dominates the other.
Database-value merge
Let ⊕ be a binary operation on database values satisfying the following axioms.
These axioms concern database values only and make no reference to vector times or causality.
The equality case
Consider first the candidate definition
\[ (v_1,d_1)+(v_2,d_2)= \begin{cases} (v_2,d_2), & \text{if }v_1\le v_2,\\ (v_1,d_1), & \text{if }v_2\le v_1,\\ (v_1\mathbin{\uparrow}v_2,d_1\mathbin{\oplus}d_2), & \text{otherwise.} \end{cases} \]When v1 = v2, both of the first two conditions hold. The cases therefore overlap. If the first matching case is given priority, reversing the arguments can change the result whenever d1 ≠ d2, so commutativity of ⊕ does not make + commutative.
A symmetric definition uses strict vector-time ordering:
The final case now includes both concurrent and equal vector times.
Associativity gap
Associativity of ⊕ does not imply associativity of the piecewise operator +. The dominance cases can discard a database value in one grouping even though the same value participates in ⊕ in another grouping.
Counterexample
va = (1,0),
vb = (1,1),
vc = (0,1).
a = (va,{a}),
b = (vb,{b}),
c = (vc,{c}).
(a + c) + b = (vb,{a,b,c}),
a + (c + b) = (vb,{b}).
The example satisfies all the stated algebraic axioms on ⊕. Associativity of + therefore requires an additional condition connecting the database values in reachable states with their vector times, or it must itself be required as an axiom. Determining the weakest appropriate condition is left open here.
Convergence obligation
Commutativity and idempotence make + insensitive to the order and duplication of pairwise merges, but without associativity its result can still depend on grouping. The stated axioms are therefore not sufficient to establish convergence for arbitrary reachable paired states.