67
withadeletion,asthechange,liketheOurobouros,swallowsitsowntailanddisappears
(deleting,dutifully,theinfiniteregioninquestion).
Thisproblemcannotbesolvedbysimplyrulingoutself-reference,sinceacopyordelete
cyclecanhaveanynumberoflinks.Checkingalargesetofchangesforsuchcyclesisa
ratherdifficulttaskatmergetime.Furthermore,theindexingrequiredtomaketherelevant
relationshipsexplicitisnotusefulforanyothertaskthanpreventingthissortofconflict.
Thegeographicalorderprincipleallowsanelegantsolutiontotheproblem.Ifeverypoint
referredtobyeachchangeislinearlyordered,thenthecycleproblemcanbesolvedwithout
attemptingtoperformglobalcycledetectiononalargesetofchanges
6
.Conceptually,the
statedescribedbyasetofchangescanbefoundbysimplyscanningallpossibleaddressesin
thedocumentfromlefttoright(leasttogreatest),applyingeachchangeassoonasitisen-
countered.Thisgivesprioritytothechangewiththeleftmostaddress.Aliteralscanofall
possibleaddresseswouldbeveryinefficient,sincetherecanbeaverylargenumberofthem,
butitispossibletoimplementthisrulewithoutsuchaliteralscan.Anynumberofother
priorityrulescouldbedevisedonsimilarstructuralprinciples:theadvantageofthisoneis
thataleft-rightscanenumeratingsomenumberofelementsofasequenceisinfactacom-
monoperationineditingscenarios:suchascanmusttakeplacewheneveradisplaybuffer
needstobefilledorrefreshed.Thisrulealsoworkswellinadistributedenvironmentbe-
causeitdoesnotrequireanyinformationotherthanthechangesthemselves.

6
Althoughcycle-detectionisastandardproblemforwhichgoodalgorithmsarewellknown,the
graphwearerequiredtocheckisnotexplicitlyrepresentedinaconvenientway.Someformofindex
wouldberequiredtoefficientlydeterminewhatchangesare“connected”byhavingthedestination
pointofonechangeinthesourceregionofanotherchange.Sincethischeckwouldhavetobeper-
formedoneveryadditionofanewchangetoasequence,itcouldquicklybecomeexpensiveevenwith
afastincrementalalgorithmfordeterminingtheseconnections.
68
3.4 Persistentaddressing
InSection3.3wesimplyassumed,whenweneededto,thatwecanconstructatotalor-
deringonthepointsthatdefinethezonesofeffectofanoperation,whichwillbesensible
foreachoperation,evenwhencombinedwithotheroperationsthatcausechangesinthe
orderofthesequence.Thissectiondescribesthebasicideabehindthisordering,andex-
ploressomeoftheimplicationsofitsexistence.Aswiththeotherdescriptionsinthischap-
ter,thegoalisinsight;theprecisedefinitionsarepartofChapter4’sformalmodel.
3.4.1 Thebasicprinciple
Thefundamentalideaoftheglobaladdressspaceistoimaginethatthereisanaddress
foreverypointthatcouldexistinanyversionofthesequence.Thismeansthateachopera-
tionthatcouldaffectasequencecanonlycreatenewaddresses,andnotre-orderordelete
oldones.Whenasetofoperationsisinterpretedtocreateaparticularstateofasequence,
manyoftheglobaladdressescontainanullsubstring,anddonotcorrespondtoanycontent
inthatstateofthesequence.Theseaddressesdesignatetheplaceswheretextwasdeleted,
orthesourceofactivemoveoperations:theycanbethoughtofalmostastheghostsofsub-
sequencesthatusedtoexistina
particularplace,butdosono
more.
Figure3.2showstwochanges,
eachappliedtothesamebase
sequence,andthenshowstheset
ofaddressablepointswhenthose
changesareincludedinadocu-
ment.Thelowersequencerepre-
sentstheunderlyingaddress
ABCDEABCF
ABCDEF
C2
ABCDEABCF
ABCDEF
M3
F F F F iii ig g g gu u u ur r r re e e e 3333....2222:::: Some move and copy changes and their re-
sults
Previous Page Next Page