133
interdependenceofthechangesinvolved.WerevisitedthisideainSection6.4,andde-
scribedthestorageofinsertionsatdestinationsattheirultimateorigin.Thereasonforthis
shouldnowbeclear.Alladdressesdescribedaboveinitem1areatthedestinationofamove
orcopy,andarefoundduringtraversalofthesourceregion.Bystoringtheaddressesde-
scribedinitem2thereaswell,thetraversalprocessisactuallysimplified.Otherwise,extra
workwouldberequiredtolocatethoseaddresses(andtheirsegments)whiletraversingthe
segmentlistatthesourceoftheoperation.
RandomaccesstothecontentsofaP-sequenceataparticularaddressisfacilitatedbythe
abilitytoaccesstheinitialsegmentofanyinsertiongivenitschangeID.Thisalsoallows
easyaccesstomoveddata,astheinitialpathoftheaddressprovidestheinformationforthe
movecopystackthatshouldbeusedatthepointoftheinsertion.Thedataitselfcanbedi-
rectlylocatedbytheinsertionaddressattheendofthepath.
6.7.3 ComparisonofP-sequences
ComparisonofVTMLdocumentsiseasysincetherelationshipsbetweenportionsofVTML
documentsareverysimple.AregionofanyversionofaVTMLdocumentiseitherpresentin
bothversionsinthesamesequentialorder,orisdeletedinoneofthetwo.InaPalimpsest
document,however,more-complexrelationshipsarepossible.
ThesimplestcomparisonrelationshipinaVTMLdocumentisidentity.Somesegmentsap-
pearinbothdocuments,andtheyappearinthesamerelativeorderineach.Theonlyother
possiblerelationshipisdeletion.InVTML,thereisevenaclearandobviousnotionofthe
“position”ofadeletedstringinotherversionsofadocument.InPalimpsest,thisnotion
needscarefulanalysis,sincedatainasubsequencemaybemovedorduplicatedinanother
context.IntheresultofaPalimpsestcomparison,theproperlocationofadeletedsequence
inanotherversionistheaddressthatwouldhavebeenitsfinaldestinationhaditnotbeen
deleted.
134
Thisisonecriticaldifferencebetweenthe“deletion”ofasubsequencecausedbyamove
andthatcausedbyanexplicitdeletionoperation,andyetanotherwayinwhichmoveis
logicallydistinctfromcopyplusdeletion.However,despitethepossibilitythattheposition
ofthezero-lengthsegmentrepresentingdeletedtextisdifferentthanmightotherwisebe
expected,deletionisquitesimilarbetweenPalimpsestandVTML.Deletedsegmentsinone
sequencecanberepresentedascorrespondingtozero-lengthsegmentsintheother.
Correspondingregionsinthathavebeenmovedcanalsoberepresentedasacorrespon-
dencebetweensubsequencesjustasinthecaseofdeletedsubsequences.Thepairsofcorre-
spondingsegmentswillhavetwodifferentsortedordersdependingonwhethertheyarear-
rangedinsequenceaccordingtotheirorderinonedocumentortheotherone.The
Palimpsestaddressesofmovedsegmentsaredifferentinbothversions,sincethePalimpsest
addresseswillcontaintheIDsofanyactivemovesthataffectanaddress.Thecommonin-
formationintheseaddressesmakesthecorrespondencesexplicit.
Copyintroducesadifferentrelationship,onethatisinternaltoeachinstanceofaP-
sequence:thatofduplication(perhapsalsomodifiedbyotherchanges).Copyrelationships
couldpotentiallyintroduceagreatdealofcomplexityintocomparisonreporting,iftherela-
tionshipsbetweenallcopiesofagivensectionweretobeconsideredincalculatingthere-
sultsofacomparison.Considerasinglesubsequencethathasduplicatedbycopyingmultiple
times.Ifacomparisonreportthatrecognizedarelationshipbetweeneverysequenceinei-
therdocumentthatshareddata,theneachcopyinonedocumentwouldhavetoberelated
toeachcopyintheotherdocument.Thisisbad.Itisbadnotonlybecausecomparisonre-
portsshouldnothavespacerequirementsofO(n
2
)foradocumentwithncopies,butbecause
theinformationinquestionisalmosttotallyuseless,sinceitisimplicitintheinternalcopy
relationshipsofeachdocument.Therefore,theonlysensiblecorrespondencebetweencopy
resultsintwoversionsistheonethatresultswhentheaddressesbeingcomparedareidenti-
cal.
Previous Page Next Page