LI 13.3.17 F lecture on 02.05 and 04.05 Topic Persistence / Temporal DS Model : So far we assumed RAM machine → Now poinlermachine Insists of r[¥Et\# nodes with root ^ teeth Taft In C NODE = STRUCT → 04 ) FIELDS
LI13.3.17
F lectureon
02.05 and 04.05
TopicPersistence /
TemporalDS
Model: So
far
we assumedRAM machine
→
Now
poinlermachine
Insistsof
r[¥Et\#
nodes with
root
^
teeth
Taft
In C NODE=
STRUCT
→ 04 ) FIELDS
Allowedoperations
-
×
=
new node
-
×=
y .
field
-
x. field =
y
-
×=
y+2 (
manipulate data )
-
destroyx ( if
no
pointersto
× )
Temporatdspersstenee
→
neverdestroy
oldversion
↳
update
→ makes new version
Retroactivity:
next week(
use time travel )
Persistence
Presentation
mightchange
,
= •/
behavior is
preserved.
Fta
:
onlylatest
update
f.
µ
:
update anyversion
today
#confluent :
merging
two version
(
functional :
impkmentinHASKE#
nevermodify versions
black hole :never
storeupdates
PartialPersistence
-
e
g
superpositionof o and u
.
Driscoll et.
al.
1982 :
ttpointer
machine DS with
*
in
degree<
p=
OG) ( #
pointersto
anynode)
tinsopaoe
can be madepartially persistent
with
to-
OG)
amortized multiplicative overhead
-
OH )space per update
Et'
#
ItPoaoidnhters
MODS
=p
@PNODE
stores
badPointersLTD[
latest version only W
�2� Allow ⇐
ZpMODS
MOD=
( VERSION,
FIELD,
VALUE)
⇐
Historyof OG
) versions.
UPDATE:
If NODE not full
-
add MOD
if
switching pointers→
updateback
pointers
if full
- createnew
NODE ( NODE
'
=
NODE with
#€¥÷/[yIy0s
applied)
¥dynN¥'
-
change TintoNODE
→ NODE
'
↳
follow NODE
'
pointers
-
change pointersto NODE
NODE ↳follow NODE
'
backpointers
ftp.t#E/arndeIsoidghanse
7[f-|Q : Does it terminate ?
- it ?
NODE
'
Pt=tdAhayis:
§=
C.
£
#mods in nodes
in latest version
£
largeconstant
.
amortized cost
=
+
OC1)
+ OC1) +
p
.
recursion- 2. c.
pa- Za
< c
W-
-
compute A
£ C or
this is 0
+
modifypotential
.
( .
FuHPersisten= ( Driscoll 89 )
RoblesWe have
a tree of versions ?
•
X
y§↳.g)
in order traversal
bx bye
>bzezex
Solution Linearize versions
Note bv < bw <
ew<
er⇐ > v is andnestor of
w
Maintainingordered list :
÷ert
,delete OC 1)
-
Order queried
amortized 04)
→ allows usto
maintain tree of NODES
III
Yen
£
@
VERSIONS ROOT VERSION
,
SUBTREE OF VERSIONS
-
Query:
Scan all MODS✓
@Back
pointersare
alwaysstored
.
p
.
mox inloutdegree
d- # fields
store
ffrdsotntetonohoonsmonotds
Problems. Constantly discharging( Huge cost )
LIMBIFE
'
nsertananse
#
B%DDy.fi
split of vase