Chapter3: OperationsandConflictsinSequences
ThischapterexaminesPalimpsest’sabstractdatastructure,thesequence,presentstheset
ofoperationsthatIhaveformalizedandimplementedinPalimpsest,andexaminesthekey
issuesofoperationinteractionthatarisewhenapplyingchange-basedconcurrencycontrol.
Intheexamplesinthischapter,Ipresentsequencesfromthepointofviewoftexteditors.
Fortextediting,sequencesarefundamental,suitableformodelingawordprocessingdocu-
mentorothertextfile,whethertreatedasasequenceoflines,ofcharacters,ofcharacters
andformattingcodesorhierarchicallynested(themselvessequential)containers.Otherrep-
resentationsmayaugment,buttheydonotchangetext’sfundamentallysequentialnature.
4
Iwilluseargumentsaboutdesirabletexteditorbehaviorandimplementationtradeoffs
whenchoosingdefaultpolicies,andwhenforcedtochoosebetweenincompatibleoptionsfor
thedatastructuremodel.Thisislessapplication-specificthanitmayseembecausetheim-
plementationoftexteditorsmakesextremelycomplexdemandsonasequenceimplementa-
tion,bothintermsoftheoperationspermittedandintermsofthelevelofinteractiveper-
formancerequired.Adecenttexteditorrequiresasupersetofthesequenceoperations
demandedbymostapplications.Thepurposeofthischapteristoexaminesequenceediting

4
Oneofthegoalsofthisworkistoenablesophisticatedhypertextfunctionality,likefine-grained
anchortracking.Giventhat,thecommentsaboutthe“sequentialnatureoftext”mayseemtoviolate
theexpectationsofhypertextsystems,devotedastheyaretoenablingnon-sequentialpresentation
andnavigationofdata.Theanswertothiscontradictionisthatthenon-sequentialnatureofhyper-
textisatamacrolevel,whilethefundamentalsequentialityoftextoccursatthemicro-levelofwords
andletters.Anagramsmaybeamusing,buttheyarenotawaytoenhanceunderstanding!Underlying
anykindofhypertextsystemmustbesomesequencemanagementtohandlethewordsofthehyper-
documentitself.
54
andsharingpropertiesthoroughlybutinformally,consideringexamplesandpresentingthe
intuitionsneededtounderstandtheformaldefinitionsofChapter4.
Inthischapter,andhenceforth,Iusethetermoperationtorepresentatypeofeditthat
canbeperformed.Forinstance,insertanddeleteareoperations,whileaparticularactofin-
sertingordeletingwithinasequenceiscalledachange.
3.1 Structuralcausesofconflictinsequenceediting
Tosatisfythegoalofchange-completeness,enhanceuserflexibilityandminimizethein-
teractionofbasicdatastructuredefinitionswithsynchronizationprotocols,thecorrectop-
erationsmustbechosen,andasmanyconflictsaspossiblemustberesolvable.Thehardpart
indoingthisistoensurethatarbitrarycombinationsofbasicoperationsarewelldefined
withinthesystem.Whilenoteverycombinationwillworklogically,mostcan.Theproblems
thatariseareoftwokinds,reliableaddressingandconflictingoperations.
Reliableaddressingisthelessfamiliaroftheseproblems,soIwillbrieflyconsideritfirst.
TheinformaldescriptionofmysolutiontothisproblemfollowsinSection3.4.3,andafull
formaldescriptionispartofChapter4’sdetailedmodel.Thebasicinsightissimplythatre-
ferringtopositionsinachangingobjectiseasieriftherearevalues(whichweshallcallad-
dresses)thatpersistentlynameapositioninanobject,independentlyofaparticularstateof
theobject.
Muchofthecomplexityofoperationaltransformationisrelatedtothefactthatthead-
dressesused(offsetswithinthesequentialtext-buffer)varywiththestateofthebuffer,
thusalgorithmsareneededtoupdatetheaddressesdependingonthestateofthebuffer.In
thecaseofachangetransmittedfromanothercopy,thetransformationfunctionforad-
dressesdependsontheactivestateatbothapplications.
Inthealternativesolution,everycharacterhasauniquenamethatdoesnotchangewith
itspositioninthestring,andtheproblemofaddresstranslationsimplyvanishes.Suchan
Previous Page Next Page