89
fectofthosechanges,andthusthecontentofA’(S) issignificantlymodifiedbytheordering
oftheaddresses,sincemove,copyanddeleteallspecifytheirregionsofeffectintermsof
theendpointsofrangesofaddresses.Becauseofthis,itisnecessarytobecarefultoavoid
circulardefinitions.Thisisachievedbydefininganorderingoverallsyntacticallylegalad-
dressesthatcanbecreatedfromachangeset.Theeffectsofthosechangesarethendefined
intermsoftheorderingofthelargerset.Theeffectsinquestion,inthiscase,arethesetof
legaladdressesinthesequence,andthecontentsoftherangesbetweenthelegaladdresses.
Onlywiththesedefinitionsinplacecanaconsistentdefinitionbegivenofwhichmembers
ofA(S)arenotincludedinA’(S) .
A(S),whereSisaminimallyconsistentchangeset,isthesetofalladdressessatisfying
Definition4.1andconstructedusingonlytheIDsofchangesinS.Wewilldefinetheorder-
ingrelation<
SA onthesetA(S),andwilllaterrestrictittothesetA’(S) ˝ A(S).Indefining
<
SA ,wewillneedtodefineanotherrelationshipbetweenaddresses.Therefersrelationallows
ustoorderchangeswithrespecttotheotherchangesreferredtobythedestinationofthe
initialchangeintheirchangepaths.
Definition4.6:Thedestinationrelation<
d isdefinedonaddressesasfollows:
1. Fora = (I
1 …I
n ,i),b = (I’
1 …I’
n ,j),a <
d biffI
1 e Ids(Dest(I’
1 ))
2. Ifa <
d b,andb <
d c,thena <
d c.
Lemma4.1:Fora = (I
1 …I
n ,i),b = (I’
1 …I’
n ,j),a <
d biffI
1 <
r I’
1 .
Proof:Toshowtheforwarddirection(a <
d bimpliesthatI
1 <
r I’
1 )weonlyneedtoobserve
thatI
1 e Ids(Dest(I’
1 ))impliesthatChange(I
1 ) e Refs(I’
1 ),andthusI
1 <
r I’
1 byDefinition4.3.
Intheotherdirection,assumethatI
1 <
r I’
1 anditisnottruethata <
d b.Thenmustbea
counterexample,anaddressx = (I’’
1 …I’’
n , k)suchthatI
1 £
r I’’
1 <
r I’
1 ,andforwhicha £
d xor
x <
d bisfalse.Thismeanseitherthatx aandI
1 ˇ Ids(Dest(x))orI’’
1 ˇ Ids(Dest(b)).But
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
Previous Page Next Page