Databases Reference
In-Depth Information
reference
R
in the expression on the right side of the second assignment denotes the value of
relvar
R
after the first assignment has been executed):
R
:=
R
-
d1
i1
,
R
:=
R
-
d2
∪
∪
i2
;
Now, the following pairs of sets aren't necessarily disjoint, in general:
d1
and
d2
;
i1
and
i2
;
d1
and
i2
;
d2
and
i1
. However, it's fairly easy to see (exercise for the reader!) that the foregoing
double assignment is logically equivalent to a single assignment of the form—
R
:=
r
-
d
∪
i
;
—where:
r
is the initial value of
R
(i.e., the value of
R
before the first assignment is done)
d
= (
d1
-
i2
)
d2
∪
i
= (
i1
∪
i2
) -
d2
Note that
d
and
i
here are certainly disjoint; however, it's not the case, in general, that
d
is
included in
r
or that
i
and
r
are disjoint. Now define:
d′
= (
r
∩
d
) -
i
i′
=
i
- (
r
∪
d
)
Then the original double assignment is logically equivalent to the following single assignment—
R
:=
r
-
d′
∪
i′
;
—where
d′
-
r
=
r
i′ =
Ø.
Note finally that it follows by induction from all of the above that a multiple assignment of
the form
i′ = d′
∩
∩
R
:=
rx1 , R
:=
rx2 , ... , R
:=
rxn
for arbitrary
n
> 0 can always be reduced to a single assignment of the form
R
:=
r
-
d
∪
i
where
r
is the initial value of
R
and
d
-
r
=
r
i = d
i =
Ø.
∩
∩