95
newaddressiscreatedimmediatelyprecedinganydatathatmayhaveoriginallyfollowedit.
Thisnewpointfollowsthenewlyinserteddata.
4.4 SomefactsaboutP-sequences
TheP-sequencehasanumberofpropertiesthatmakeitusefulformodelingversion
management,(collaborative)undo,merge,andnon-sequentialundo.Thefollowinglemma
summarizesanumberoftheseproperties.
Lemma4.4:ThefollowingclaimsaretrueforaminimallyconsistentchangesetS:
ForId(c) = I,Refs(I)eS,A’(S) ˝ A’(S ¨ c).
1. IfX
S isaP-sequence,anda <
SA binX,thengivenId(c) = I,Refs(I)eS,andX’
S aP-
sequenceforS ¨ c,thena <
SA binX’.
2. Anydatathatisthesourceonlyofmovechanges,appearsexactlyonceintheP-
sequence.
3. ForId(c) = I,Refs(I)eS, A’(S ¨ c)isacausalchangeset.
4. IfXisaP-sequenceforS,foranyaddressa e S,Length(C
X (a, P
X (I
X (a)+1))) £ 1.
5. IfXisaP-sequenceforasetS,thenforanyvalues
i inthecontents,s
1 …s
i …s
n ofa
P-sequence,thereisatleastonepairofaddressesa,a’ suchthatC
X (a, a’, S) = s,and
forwhichthereexistsnoc e S,withDest(c) = aorDest(c) = a’.
Proof:Claim1canbeverifiedbyexaminationofDefinition4.1,andDefinition4.9.New
changesneverremoveaddresses.
Claim2isaconsequenceofDefinition4.8.Foranyaddressesa,binS,theirrelativeorder
isdeterminedentirelybychangesalreadyinS.Thenewchangecannoteitheratargetofa
destinationofaorb(becauseSisminimalconsistent),norcanitsIDbeinthepathofany
addressinA’(S). Therefore,theorderingofaandbcannotbeaffectedin A’(S ¨ c).
Claim3isbitmorecomplex.Itdependsonclauses6and7of
96
Definition4.14.Clause7eliminatesanyrangethatisoverlappedbyanymoveintheset
beingconsidered.Clause6definesthecontentofthedestinationofamove,m,intermsof
thecontentofitssource,consideredinachangesetthatremovestheeffectsofmandall
lowerprioritymoveoperations.Thisrecursivecheckoftherangewillnotcontainanydata
inthesourceofahigherprioritymove(becauseofclause7).Clause7willnoteliminatedata
becauseofbeingthesourceofmorthelowerprioritymoveoperations.Onefinalobserva-
tionisthatforanydatathatisthesourceofseveralmoves,onlyonewillhavethehighest
priority,andthatdatawilloccuronlyatthedestinationofthatmove.
Claim4istrivial.Notethat A’(S ¨ c)isnotnecessarilyunconflicted.Inorderforthatto
betrue,theremustbenoc’ e SwithDest(c’) = Dest(c).
Claim5isaconsequenceofthefactthattheonlyclauseof
Definition4.14thatactuallyreturnsanythingotherthanthenullsequenceisclause4.
Clause4alwaysreturnsexactly1elementofaninsertion’scontent.
Claim6istruebecauseeveryelementofaninsertionstartsoffwithanaddresstoits
rightanditsleft,andneitherofthoseaddressesisthetargetofanyoperation.Addinga
change,insertion,move,orcopy,does“remove”anaddressbymakingitadestination.
However,eventheinsertionofanullrangewillcreateanewaddress,immediatelybounding
thesequenceelementstoitsleftanditsright.Forlongerinsertedsequences,theleftmost
newaddressformstherightboundaryofthesequenceitemtotheleft,andrightmostnew
addressformstheleftboundaryofthesequenceitemtotheright.v
Theseclaimsprovidethebasisformodelingsystemactivitieslikeversionmanagement
andundo.
Claim1meansthataddressesdonotvanishwhenchangesareadded.
Claim2meansthattherelativeorderingofaddressesispreservedwhenchangesare
addedtoaset.
Previous Page Next Page