91
appliedtoapairofaddress,(a,b).Byinductionwecanassumethatallpairs(c,d) <
wf (a,b)
aretotallyorderedunder<
sa .Since(a, b)and(c, d)mustbeorderedbysomeclauseofthe
definition,wewilljustconsidertheminorder.Inthediscussionofacase,Ialsosometimes
commentontheintentofthatclauseofthedefinition.
Case1isabasecase,andordersthetwoaddressesbythestrictordering<
d ,preserving
theinductionhypothesis.
Case2isabasecase,andordersthetwoaddressesbythenormalstrictorderoninte-
gers.Thisonlyappliestotwoaddressesinvolvingthesameinsertionchange.Cases1and2
canneverconflict,sincetheirpreconditionsdonotoverlap.
Case3istruebyinductionsincetheaddressesX,X’ areclearlylessunder<
d .
Case4istruebyinduction,sinceDest(I
1 )and Dest(I’
1 )arebothlessunder<
wf .Anytwo
addressescreatedbydifferentchangesareorderedintermsoftheirdestinations.SinceSis
unconflicted,thesemustbedifferent.
Case5isalsotruebyinduction,since (I
2 …I
n ,i)and(I’
2 …I’
n ,j)arealsosmallerunder
<
wf .Ifthetwoaddressestobecomparedarebothpartoftheresultofsomemoveorcopy
operation,theyshouldbecomparedrelativetoitssource.Thisfinalcasecompletesthe
proof,andestablishesatotalorderingonalllegaladdressesforaminimallyconsistent
changeset. v
Theorem4.3:nilistheminimalelementunder<
SA .
Proof:ThisisaconsequenceofDefinition4.4.nilisminimalundertherefersrelation<
r ,
whichmeansthatforanynon-emptychangesetthereisoneinsertionIsuchthat
Dest(I) = nil.Sinceeveryaddressinthatinsertionwillbegreaterthannil,nosubsequent
insertionormoveoperationthatfollowswillbeabletocreateanaddressthatislessthan
nil.v
Apossibleextension:
92
Theorem4.2canbeeasilyextendedtoapplytoconflictedchangesetsbymodifyingcase
3ofthedefinition.TheextensionisrequiredtocoverthecasewhereDest(I
1 )andDest(I’
1 )
areequalinclause3.Inthissituationanmethodisneededtoorderpairsofchangeswhose
destinationsareequal.Typically,animplementationwillhaveachoiceoftotalorderingson
changes,whetherarbitraryones,perhapsbasedonthebinaryrepresentationofchanges,or
temporalones(ifaglobalclockisavailable).Manyapplicationswillalsowanttodetectsuch
situations,andsignalanerror,somethingwehavemodeledbydisallowingthem.
4.3.3 P-sequenceaddresses:A’(S)
ThesetA(S)definedbyasetofchangesSissignificantlylargerthanisneededtorepre-
sentthehistoryofaP-sequence.ForagivenmovewithIDM,forinstance,itincludesad-
dressesoftheform(M.p,i)wheretheaddresses(p,i)arenotinthesourcerangeofM.
These“junk”addressesarenotevenusefulinrepresentinguserintentions(unlikethecon-
tent-freeaddressesdiscussedinSection3.4.2).Thefollowingadditionalrestrictions,applied
toA(S),givetheactualaddressspaceA(S)foraminimallyconsistentchangesetS.
Definition4.9:ThesetA’(S) isdefinedasthosemembers,a e A(S),foranunconflicted
causalchangesetSsatisfyingthefollowingconditions:
1. aisoftheform(I,i),whereIistheIDofaninsertion.
2. Ifaisoftheform(I
1 …I
n ,i)andChange(I
1 ) = M[a
1 , a
2 , d]then
a
1 £
SA (I
2 …I
n , I) £
SA a
2 .
3. Ifaisoftheform(I
1 …I
n ,i)andChange(I
1 ) = C[a
1 , a
2 , d]then
a
1 £
SA (I
2 …I
n , I) £
SA a
2 .
4. aisnil.
ThisdefinitionensurestheA’(S) containstargetaddressesofmovesandcopiesonlyfor
thoseaddressesthatcouldpotentiallybeinthesourcerangeoftheoperationinquestion.
Allchangesetswithchangescontainnil,asalreadynoted,butitem4ensuresthatevenan
emptychangesetincludesit.
Previous Page Next Page