90
thiscan’tbetruesinceforanyaddress c=(X
1 …X
n ,m),Ids(Dest(c) ˝ Refs(X
1 ),whichcontra-
dictstheinitialassumption. v
Lemma4.2:<
d isanirreflexivepartialorder.
Proof:ThisisastraightforwardconsequenceofLemma4.1andtheassumptionthatSisa
causalchangeset. v
Definition4.7:ThedestinationchainofanDestX(a)addressa = (I
1 …I
n ,i),isasequence
ofaddressesa
o , …, a
I ,awherea
i–1 = Dest(X)
,anda
i = (X…X’,j)
.
Thedestinationchainofanaddressistheresultofrepeatedlyfindingthedestinationof
theinitialinanaddress’schangepath.Foracausalchangeset,thiswillbeafinitesequence
withaninitialaddressofnil.
Definition4.8:Forelementsa,bofA(S)givenaminimallyconsistentchangesetS,
a <
SA bisdefinedas(inorderofpriority):
1. Foranyaddressesa,b = (I
1 …I
n ,I),IfDest(I
1 )=a,thena<
SA b.
2. Fora = (I,i),b = (I,j),a <
SA biffi <j.
3. Fora = (I
1 ,i),b = (I
2 ,j)),I
1 I
2 ,letX,X’ betheinitialitemsofDestC(a),DestC(b),
aftertheremovaloftheircommonprefix.Thea <
SA biffX<
SA X’.
4. Fora = (I
1 …I
n ,i),b = (I’
1 …I’
n ,j),I
1 I’
1 ,a <
SA biffDest(I
1 ) <
SA Dest(I’
1 ).
5. Fora = (I
1 …I
n ,i),b = (I’
1 …I’
n ,j),I
1 = I’
1 ,a <
SA biff (I
2 …I
n ,i) <
SA (I’
2 …I’
n ,j).
Lemma4.3:Theordering<
SA ofDefinition4.8iswellfounded.
Proof:Therecursioninthisdefinitioniswellfoundedundertheordering<
wf ,definedas
a <
wf biffa <
d borahasashorterpaththanb.Sincethetheelementnilisminimalunder
bothorderings,anysetofaddresseswillhaveaminimalelementunder<
wf .v
Theorem4.2:therelation<
SA isatotalorder.
Proof:Wewillprovethisbyinductionoverthefollowingextensionof<
wf topairs.Apair
(a, b) <
wf (c, d)iffeitheraorbislessthaneitheroneofcandd.Thebasecaseisanaddress
setcontainingonlynil,whichistotallyordered.Now,considereachcaseofthedefinition
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:
Previous Page Next Page