Вы находитесь на странице: 1из 14

1

:
1. ;
;
2. .


.
.
, ,
. ,
,
.
- ,
.
:


, :
(
).
. ,
, .
:

2
1.
2.
3.
4.
5.
6.

;
;
;
;
;
.
,
.

,
.
. , R ,
dom(A) R .

. , R ,

R. R , 2
,
.
, ,
,
, .
.

D F G H

G V M N

B M T X


.
.
.
_ - _
_ - _
,
.
, .

.
.

3

, .
, ,
.
i , 1 i n .
i dom(i). R
A1, A2 ,..., An . R = B1, B 2 ,..., Bm R
. t 1 t2 R B R , t1(B) t2(B).
, ,
. , - ,
.
.
[_,,,]
, .
. .
F-
,
. :
[,,,]
{,}
F- {,}-> ,
.
F- . R
X, Y R. R
X -> Y, Y(X-x) - . F X->Y X , Y - .

2
SATISFIES,
.

SATISFIES
: R F- X->Y.
: , R X->Y, - .

SATISFIES(R,X->Y)
1. R - , -
.
2. - Y-,
, - .
, R F- X -> Y.

.
SATISFIES F-
-> _

...
...
...
...
...
...
...
...

83
83
116
116
281
281
301
412

9
11
10
12
8
9
12
15

10:15
10:15
13:25
13:25
5:50
5:50
18:35
13:25

F- _ ->

...
...
...
...
...
...
...
...

281
281
83
83
116
116
412
301

8
9
9
11
10
12
15
12

5:50
5:50
10:15
10:15
13:25
13:25
13:25
18:35

F-.
, R.
F- . F. ,
F- R. , F-,
, . F . F- F
F- X -> Y (: F = X -> Y ),
F, X -> Y. -
, , F-,
F-. :
: X -> X.
: X -> Y XZ -> y.
: X -> Y X -> Z X -> YZ.
: X -> YZ X -> Z.
: X -> Y Y -> Z X -> Z.
: X -> Y YZ -> W XZ -> W.
.
R , X , Y Z R . ,
XY -> Z X -> Y . XX -> Z X ->
Z.
, ,
. .

5
F- F- R . F , F+ , -
F ,
F - , F.
.
F = {AB -> C, C -> B } - F- R(ABC). F + = {A -> A, AB -> A, AC
-> A, ABC -> A, B -> B, AB -> B, BC -> B, ABC -> B, C -> C, AC -> C, BC -> C, ABC -> C, AB -> AB,
ABC -> AB, AC -> AC, ABC -> AC, BC -> BC, ABC -> BC, ABC -> ABC, AB -> C, AB -> AC, AB -> BC,
AB -> ABC, C -> B, C -> BC, AC -> B, AC -> AB}
, F- R,
F- , . , F = X -> Y ,
X -> Y
F+ .

3
F+

F = X -> Y.

MEMBER .
MEMBER.
: F- F F- X -> Y.
: , F = F = X -> Y, .

MEMBER(F, X -> Y)
begin
if Y CLOSURE(X,F) then return ()
else return()
end
CLOSURE , F,
.
CLOSURE.
: F- F.
: F.

CLOSURE(X,F)
begin
OLDDEP = 0; NEWDEP = X
while NEWDEP OLDDEP do begin
OLDDEP = NEWDEP
for F- W -> Z F do
if NEWDEP
NEWDEP = NEWDEP

end

W then

6
return(NEWDEP)
end
MEMBER
F = {_ _ -> _,
_ -> _, _ _ -> }
F |= _ ->
MEMBER


, (
) F-
F-. ,
.
.
.
F- F G R , F G , F + = G+ .
F G , F G. ,
F, G F-.
, ,
F G , F G.
:
EQUIV
: F- F G.
: , F G ; .

EQUIV(F,G)
begin
v=DERIVES(F,G) and DERIVES(G,F);
return(v)
end
DERIVES F |= G :
DERIVES
: F- F G.
: , F |= G; .

DERIVES(F,G)
begin
v=
for F- X -> Y G do
v = v and MEMBER(F, X -> Y)

7
end
return(v)
end
F- F , F
, F F . F , F . F
G, F G F .
. G = { AB -> C, A -> B, B -> C, A -> C}. F= {AB -> C, A -> B, B -> C}
G, , F = {A -> B, B -> C} G.
F G.
, EQUIV F G , DERIVES(F,G)
DERIVES(G,F) . F G.
()
F , F- X -> Y, , F - { X ->
Y} |= X -> Y . F- F F , F - { X -> Y} |= X -> Y.
F- G F, , F
G. G , F=G.
F- G NONREDUN, :
: F- G.
: G.

NONREDUN(G)
begin
F=G
for X -> Y G do
if MEMBER(F-{X->Y],X->Y) then F=F-{X->Y}
end
return(F)
end
: G= {A -> B, B -> A, B -> C, A -> C}.
:
{A -> B, B -> A, A -> C}.
G {A -> B, A -> C, B -> A , B -> C} ,

{A -> B, B -> A, B -> C}.
, F- G
. G, G.

F = {A -> B, B -> A, AB -> C}.
F- F-,
, F , . F- F
, F. ,
F- F.

8
. F- F- R X -> Y F- F.
R X -> Y F,
1. X AZ , X Z (F - {X -> Y}) {Z -> Y} F
2. Y = AW, Y W (F - {X -> Y}) {X -> W} F.
, - ,
X -> Y F.
. G = {A -> BC,B -> C,AB -> D}.
A -> BC, B - AB -> D.
. F - F- R X -> Y F. F X -> Y ,
, Y , X -> y. X -> Y
, Y . F F-.
. F- F (, ),
F- F ( , ).
. G = {A -> BC, B -> C, AB -> D} ,
. G1 = {A -> BC, B -> C, A -> D} , , G 2 = {A -> B, B ->
C, AB -> D} , . G 3 = {A -> B, B -> C, A -> D}
, , , .
:

REDUCE
: F- G.
: G.

REDUCE(G)
begin
F = RIGHTRED(LEFTRED(G))
F F- X ->
return(F)
end
RIGHTRED LEFTRED ,
:

RIGHTRED
: F- G.
: G.

RIGHTRED(G)
begin
F=G
for X -> Y G do
for Y do
if MEMBER(F - {X -> Y}

Y X -> Y F

{X ->(Y - A)}, X -> A) then

9
end
end
return(F)
end
LEFTRED
: F- G.
: G.
Begin
F=G
for X -> Y G do
for do
if MEMBER(F,{X - A) -> Y) then
X X -> Y F
end
end
return(F)
end
. G= {A -> C, AB -> DE, AB ->CDI, AC -> J}. LEFTRED(G) G = {A
-> C, AB -> DE, AB -> CDI, A -> J} RIGHTRED(G) F= {A -> C, AB -> E, AB -> DI, A ->
J}, .
F- , R
, F- .
: X Y F F, F |= X->Y F |= Y ->X.
F={A -> BC, B -> A, AD -> E}, F-
, .. . F- () ? F |= A ->
B F |= B -> A . . F-
, ().
F- E F .
F-
(CF-), :
(X1, X2, ..., Xk) -> Y
X1, X2, ..., Xk , F- , Y
F- .

. d
{R1, R2, ...,Rp}, R i= (Si,Ki), Si- , Ki .
F- F R.
R=( R1, R2, ...,Rp). :
1. F R , ..
Ri}

F {K Ri | Ri R

10
2. Ri .
3. , 1 2.
4. Ri R.
F- .
. R F- G,
|EG| . , R ,
. .
F - F . |EF| , F
F.
.
F F EF .
EF(X) , , EF(X).
.
SYNTHESIZE
: F F R.
: F.
1. F G.
2. CF (X1,X2,,Xk)
K={X1,X2,Xk).

Y G Rj= X1X2XkY

3. . 2.
.
A

B1B2C1C2DEI1I2I3J

B1B2C1

AC2DEI1I2I3J

B1B2C2
E

AC1DEI1I2I3J

I1I2I3

C1D

C2D

I1I2

I3

I2I2

J
I1

I1I3

I2

R= AB1B2C1C2DEI1I2I3J
, . F ,
F= {A

B1B2C1C2DE

B1B2C1

C1D

C2D

I1I2

I3

I2I2

B1B2C2

I1I2

A
J

I1

I1I3

I2}


G={ (AB1B2C1 ,B1B2C2)
(E)
(C1D)

DE

I1I2
J

(C2D)

(I1I2, I2I2, I1I3)}


CF ,

11
R1=AB1B2C1C2DE K1= {AB1B2C1 ,B1B2C2}
R2= EI1I2

K2={E}

R3= C1DJ

K3={C1D}

R4= C2DJ

K4={C2D}

R5= I1I2I3

K5={ I1I2, I2I2, I1I3}

R=( R1, R2, R3, R4 ,R5)


,
,,
, ,
, .
() ,
, .
, , :

,
, .

,
, ,
.
, .

.
().
:
1. ;
2. ;
3. ;
4. ;
5. ;
6. ;
7. ;
8. ;
9. ;
10. ;
11. ;

12
12. .


. ,

.
. ,
.
,
, ,
.
.
, .
,
, ,
.
. -,
, -, ,
, .. .

,
.
( ,
)
, ; ..
, ,
, .
( ,
) ,
.

,
, .
,
.

,
.
, ,
. ,
.
,
, ..

13
, .
(
) ( ).

, .. .

,
() .
. -,
, .. ,
. -,
, .. ,
. ,
, .
, ,
, ..
.


. , Rx ,
X , Ry , Y ,
Rx Y , Ry X
Z .. ,

.


. ,
, .
, .. ,
. ,
, . ,
, .. .

. .

, .. ,
. ,
. ,
, .
,

.

14

.

.
.

. ,
.


, ,
.

, ,
.
, , SQL.

Оценить