87
Whileconflictedchangesetsarealwaysproblematictheynaturallyresultfromthemerge
ofsomeminimallyconsistentchangesets.Suchsituationsareexactlytheonesinwhichsyn-
tacticconsistencyisnotpreserved,sincetwosubsequencescannotbeinsertedintoase-
quenceatexactlythesameposition.Indistributedimplementations,communicationerrors
couldleadtofailuretotransmitsomechanges.Inthiscase,automaticmergewouldproduce
resultsthatarenotcausalsets.
4.3 A-sequencesandP-sequences
AP-sequencerepresentsaparticularstateofaPalimpsestsequence,asdefinedbyasetof
changes.P-sequenceshaveanaddressingstructureasdescribedaboveanddiscussedin
Chapter3,andaredefinedasaparticulartypeofA-sequence.A-sequences(shortforad-
dressablesequences)representthenotionofasequencewithanexplicitaddressspace,iden-
tifyingoneormoregapsbetweensequenceitems.
Thenormalmathematicalrepresentationofasequenceoflengthnisasafunctionfrom
theinterval1…n (or0…n-1 )frompositionsinthesequencetovaluesatpositionsinthe
sequence.A-sequenceshaveasimilardefinition,butwithanaddressspaceotherthanthe
naturalnumbers.AnA-sequence,X,isafunction(calledthecontentsfunction)C
X (a
1 , a
2 ),
wherea
1 anda
2 aredrawnfromatotallyorderedset(A
X , <)ofaddresses.ThevaluesofC
x are
sequencesofitemsdrawnfromasetVofvalues.TherearenorestrictionsonthesetV,asits
elementsareapplication-specificdata.ThesequenceC
X (a
1 , a
2 )isthesequenceofvalues
storedbetweenpositionsa
1 anda
2 ofX.TheindexfunctionI
X (a),fora e A
x ,returnsanum-
berfrom0…size(A
X )-1,representingthepositionofainX.TheinverseP
X (n),returnsthen-
thaddressofagivenA-sequence.C
x mustsatisfycertainproperties:
1. C
X (a, a) = L(Thenullstring)
2. C
X (a
1 , a
2 ) = L(ifa
2 < a
1 )
88
TheseensurethateachaddresscorrespondstonomoreasingleelementfromVandthat
zero-ornegative-lengthaddressrangescontainonlythenullstring.Theydonotensure
thateveryrangeofaddresseshasanycontent,becauseanA-sequencecancontainaddresses
fordeleteddatathatdoesnotappearinthefinalsequence.Wewillomitthesubscriptiden-
tifyingtheparticularA-sequencewhenonlyonesequenceisunderdiscussion.
4.3.1 P-sequences
P-sequencesformalizehowchangesareassembledintoasetoforderedaddressesrelated
toparticularsequencesofvalues.ThePalimpsestaddressingschemeassignsaddressesina
waythatadmitsofotheruses,aswell.Thestructureoftheaddressspaceenablesthedeter-
minationofwhatdataiscommontotwoP-sequences.GiventwoP-sequencesitispossibleto
determine,byinspection,whatdatawasduplicatedbycopyoperationsormovedbymove
operations,andwhatoriginalinsertionoperationinitiallyaddedanyparticularvaluetothe
sequence.P-sequencesaredefinedforminimallyconsistentchangesets,butIshallnotewe
dependenciesonminimalconsistency,andtowhatextentthatrestrictioncanberelaxed.
TheP-sequenceP
S hasthreecomponents:
1. Atotalorderingrelation,<
SA ,onA’(S) .
2. ThesetofaddressesA’(S)determinedbyasetofchangesS.
3. AfunctionC
S (a
1 , a
2 )thatreturnsasubsequenceforaP-sequencerangeindicatedby
2addressesinA’(S) .
TheP-sequenceP
S isanA-sequencewithaddressesA’(S), contentsfunctionC
S ,andad-
dressordering<
SA .TheorderingofaP-sequenceiswhatdeterminesthefinallinearstructure
oftheaddressesinthesequence,andallowstheenumerationofitscontents.Itis<
SA that
orderstheaddressescreatedbyaminimallyconsistentchangeset.
4.3.2 TheP-sequenceaddressordering
Inthissectiontheaddressordering,<
sa isdefined.Thisdefinitionandthefollowingones
areabittricky,sincetheactualaddressesinaP-sequencearethechangesinA’(S) .Theef-
Previous Page Next Page