Information Technology Reference
In-Depth Information
r
,
w
,
σ
)
deep import rec with map
(
p
,
q
,
r
,
w
,
σ
)=(
where
(
r
,
w
,
σ
)
de f
=
deep import rec without map
(
p
,
q
,
r
,
w
,
σ
)
w
.
val
(
r
)
if w
.
keys
.
has
(
r
)
r
r
de f
=
if
¬
w
.
keys
.
has
(
r
)
w fw
.
keys
.
has
(
r
)
w
de f
=
w
if
¬
w
.
keys
.
has
(
r
)
σ
if w
.
keys
.
has
(
r
)
σ
if
¬
w
.
keys
.
has
(
r
)
The auxiliary function
deep import rec without map
is divided into several steps: a
copy step, an attribute values update step, a clients update step, a once status update
step, and a result generation step. Each of the steps has several definitions associated
to it and each set of definitions depends on the definitions of the previous step. The
following discussion goes through each of these steps in more details.
The copy step includes the definitions of
o
,
o
0
,
σ
de f
=
σ
0
and
w
0
. The definition
o
is the
object referenced by
r
, and the definition
o
0
makes a copy of
o
. In the next step, the
σ
0
that includes the copy
o
0
. There are two cases to be
differentiated at this point. If
o
is handled by
q
,then
o
0
must be handled by
p
.Otherwise
o
0
must be handled by the handler of
o
. The definition
w
0
is the updated map.
The attribute values update step recursively uses
deep import rec with map
to im-
port all the non-void reference attribute values of
o
using the updated map. This leads
to an updated object with the deep imported values. This step includes the definition of
{
function defines an updated state
r
1
,...,
r
n
}
w
1
,...,
w
n
}
{
σ
1
,...,
σ
n
}
a
1
,...,
a
n
}
, as well as the definitions of
{
,
{
,
,and
o
1
,...,
o
n
}
{
contains each attributes of
o
whose value is a non-
void reference. The function defines
.Theset
{
a
1
,...,
a
n
}
r
i
,
w
i
,
σ
i
)
n
as a sequence of tuples.
Each of the tuples is responsible for a single recursive deep import operation for one
of the attributes in
(
for
i
=
1
...
. Each such operation results in an updated map and an
updated state that must be used in the next deep import operation. The result of this is
an updated map
w
n
, and updated state
{
a
1
,...,
a
n
}
σ
n
, and references
r
1
,...,
r
n
to deep imported
data structures. Finally, the function defines a sequence of updated objects
o
n
}
that ends with the updated object
o
n
. The updated object has the values of the attributes
{
o
1
,...,
{
a
1
,...,
a
n
}
set to the deep imported data structures referenced by
r
1
,...,
r
n
.
σ
n
that contains the initial copy
o
0
.In
Until now, the function has an updated state
σ
n
such that the reference to
o
0
points to
the updated object
o
n
. This is done in the clients update step. This step includes the
definition
the client update step, the function updates
σ
0
, which includes the object
o
0
.
In a next step, the function takes care of the once routines of the imported object. For
this, it defines a new state
σ
x
. Note that
σ
n
is derived from the state
σ
y
based on the state
σ
x
.Itdefines
{
f
1
,...,
f
w
}
as the set of all
σ
x
.
(
σ
x
.
o
n
))
non-separate once functions of
o
that are fresh on the processor
handler
ref
(
,
σ
x
.
which handles the copied object, but non-fresh on the processor
,which
handles the object referenced by
r
. Note that the two processor can be the same, in
which case the set
handler
(
r
)
{
f
1
,...,
f
w
}
is empty. Similarly, it defines the set
{
f
w
+
1
,...,
f
m
}
for
σ
x
such
that the once status is taken over to the handler of the copied object. These definitions
deal with the case where a once routine is fresh on the handler of the copied object, but
non-fresh on the handler of the object referenced by
r
. Note that the remaining cases
once procedures. For each once routine defined in this way, it updates the state
Search WWH ::
Custom Search