82
ticularchangefromthesetrepresentingthestatecorrespondingtotheuser’s“currentver-
sion”.Real-timecollaborationcouldbeachievedbyagroupofprocesseseachkeepingasin-
glechangesetrepresentingthecurrentversion,andbroadcastingnewchangestotheoth-
ers.Thedistributionalgorithmthendeterminestheultimatelevelofconsistencyachieved
bythesystem,independentlyofthedatamodel,sinceorderofarrivalwillnotaffectthe
finalresults.
4.2.1 Changesandchangesets
Theelementsofachangesetareoffourtypes:insertion,deletion,moveandcopy.Each
changecinasethasauniqueidentifier.Twochangesmaybeidenticalineveryproperty
excepttheirID(thisoccurswhentwoauthorsmakethesamecorrection).Formally,werep-
resentIDsaselementsofasetId,andachangeasatuple(i, c)
whereiisanID,andcisthe
restoftheinformationabouttheactualoperationrepresentedbythechange.Changesmay
bewrittenwithoutexplicitIDs,whereitwillnotcauseconfusion.ThefunctionId(c)gives
theIDofagivenchangec,andChange(I)givesthechangewithIDI.
Thefollowingnotationsareusedtoidentifytheactiontakenbyachange,thepossible
valuesofcinachangetuple(I, c).I[a, s]representstheinsertionofafinitesequenceof
items(s)atalocationgivenbytheaddressa.D[a
1 , a
2 ]representsthedeletionofallitems
whoseaddressesfallbetweena
1 anda
2 .M[a
1 , a
2 , d]representsthemovementofthesubse-
quencewithaddressesfroma
1 …a
2 ,inclusive,totheaddressd.C[a
1 , a
2 , d]representsady-
namiccopythatduplicatesthesubsequencewithaddressesfroma
1 …a
2 ,inclusive,tothe
addressd.
4.2.2 ThestructureofPalimpsestaddresses
Palimpsestaddressesrepresentthelocationsofdata,bytheIDsofthechangesthatcre-
atedthatdataandhaveaffecteditsposition.Theaddresseshavethegeneralformdiscussed
inSection3.4.3.
83
Definition4.1:Eachaddressisatuple(p, i)wherepisachangepath,iisanonnegative
integerand:
1. Achangepath,pisa(possiblyempty)sequenceofchangeIDsI
1 …I
n ,.
2. ThelastchangeID,I
n (ifpisnonempty)denotesaninsertion,
3. Theindexiisintheinterval0…NwhereNisthelengthofthesequenceinsertedby
changeI
n .Thisdenotesapositioninthesequenceofitemsinsertedbytheinsertion
withIDI
n .
4. NoIDmayoccurmorethanonceinthechangepathp.
5. Thereisonlyonelegaladdresswithanullchangepath,anditmusthaveanindexof
0.Thisspecialaddress,((), 0),isreferredtoasnil.
6. EachIDinthechangepath,I
1 …I
n–1 ,mustdesignatemoveorcopyoperations.(We
willdiscusstheeffectoftheseontheorderingofaddressesinSection4.3.2).
Theintentionbehindthisaddressingsystemisasfollows:
Thefirstoperationmadeinanydocumentmustbeaninsertionwhosetargetisthespe-
cialaddressnil.
Aninsertiondefinesanaddressforeachinter-itemgapinthesequencethatitinserts,
includingthepositionsbeforethefirstelement(0),andafterthelastelement(N).
Addressesatthedestinationofoneormorecopyandmoveoperationsareidentifiedby
thelocationwhereaninitialinsertionoccurred.Theotherelementsinthepathrepre-
sentsuccessivemoveorcopychangesthataffectedtheoriginaladdress.
Thesetofaddressesisfinite,anddoesnotcontainanyaddressesthatwouldrepresent
causal“loops”,forinstancetheresultsofamoveappliedtoitsowndestination.
Thus,dataisalwaysidentifiedbyreferencetotheoriginalinsertionthatcreatedit,re-
gardlessofwhatotherchangesmayaffectthatdata.Thesamecontentsmayhavemorethan
Previous Page Next Page