Database-axiom System of data dependence

Source: Internet
Author: User

Axiom System of data dependence
逻辑蕴含    定义6.11  F 的关系模式R <U,F>,其任何一个关系r,若函数依赖X→Y都成立, (即r中任意两元组t,s,若tX]=sX],则tY]=sY]),则称F逻辑蕴含X →Y
Armstrong Axiom System
    关系模式R <U,F >来说有以下的推理规则:A1.自反律(Reflexivity):若Y ? X ? U,则X →Y为F所蕴含。A2.增广律(Augmentation):若X→Y为F所蕴含,且Z ? U,则XZ→YZ为F所蕴含。A3.传递律(Transitivity):若X→Y及Y→Z为F所蕴含,则X→Z为F所蕴含。
(l)自反律: 若Y ? X ? U,则X →Y为F所蕴含     证: 设Y ? X ? U 对R <U,F> 的任一关系r中的任意两个元组t,s:若t[X]=s[X],由于Y ? X,有t[y]=s[y],所以X→Y成立,自反律得证
(2)增广律: 若X→Y为F所蕴含,且Z ? U,则XZ→YZ 为F所蕴含。 证:设X→Y为F所蕴含,且Z ? U。     设R<U,F> 的任一关系r中任意的两个元组t,s:若t[XZ]=s[XZ],则有t[X]=s[X]和t[Z]=s[Z];由X→Y,于是有t[Y]=s[Y],所以t[YZ]=s[YZ],所以XZ→YZ为F所蕴含,增广律得证。
(3) 传递律:若X→Y及Y→Z为F所蕴含,则                 F所蕴含。证:设X→Y及Y→Z为F所蕴含。对R<U,F> 的任一关系 r中的任意两个元组 t,s:若t[X]=s[X],由于X→Y,有 t[Y]=s[Y];再由Y→Z,有t[Z]=s[Z],所以X→Z为F所蕴含,传递律得证。
1.根据A1,A2,A3这三条推理规则可以得到下面三条推理规则: 合并规则:由X→Y,X→Z,有X→YZ。       (A2, A3) 伪传递规则:由X→Y,WY→Z,有XW→Z。       (A2, A3) 分解规则:由X→Y及 Z?Y,有X→Z。       (A1, A3)
2.根据合并规则和分解规则,可得引理6.1   引理6.l  X→A1 A2…Ak成立的充分必要条件是X→Ai成立(i=l,2,…,k)

The Armstrong Axiom system is an effective and complete
Validity: Starting from f each function dependence deduced according to Armstrong Axiom must be in the f+;
Completeness: Every function dependency in f+, must be deduced from F based on Armstrong axioms

function dependent closures
定义6.l2    在关系模式R<U,F>中为FF的闭包,记为F+。定义6.13   设F为属性集U上的一组函数依赖,X ?U, XF+ ={ A|X→A能由F 根据Armstrong公理导出},XF+称为属性集X关于函数依赖集F 的闭包
引理6.2     设F为属性集U上的一组函数依赖,X,Y ? U,X→Y能    由F 根据Armstrong公理导出的充分必要条件是Y ?XF+用途    将判定X→Y是否能由F根据Armstrong公理导出的问题,转化为求出XF+ 、判定Y是否为XF+的子集的问题
Algorithm6.1Attribute set X (x? u) Closure of the function dependency set F on U xf+ input: x,f output: xf+ step: (1) Makes X (0) =x,I=0(2Ask B, here B ={A | (? V) (? W) (v→w?) F∧v? X (i) ∧a? W)};(3XI+1) =b∪x (I) (4) Determine X (I+1) = X (I)? (5) if equal or X (I) =u, then X (I) is xf+, the algorithm terminates. (6If no, thenI=I+l, return to paragraph (2Step For algorithm6.1To make AI =| XI|{AI}Form a step greater than1The Strictly ascending sequence, the upper bound of the sequence is | U |, so the algorithm is up to | u| - | X| The second cycle is terminated.
[例1]  已知关系模式R<U,F>,其中U={A,B,C,D,E};F={AB→C,B→D,C→E,EC→B,AC→B}。求(AB)F+ 。解  设X(0)=AB;(1) X(1)=AB∪CD=ABCD。(2) X(0)≠ X(1)     X(2)=X(1)∪BE=ABCDE。(3) X(2)=U,算法终止    ?(AB)F+ =ABCDE。
The validity and completeness of Armstrong axiom system
定理6.2  Armstrong公理系统是有效的、完备的 证明:     1. 有效性        可由定理6.1得证    2. 完备性        只需证明逆否命题: 若函数依赖X→Y不能由F从Armstrong公理导出,那么它必然不为F所蕴含
function Dependency Set equivalence
定义6.14  如果G+=F+,就说函数依赖集F覆盖G(F是G的覆盖,或G是F的覆盖),或F与G等价。引理6.3  F+ = G+ 的充分必要条件是FF+ 证:  必要性显然,只证充分性。(1)若F?G+ ,则XF+ ? XG++ 。(2)任取X→Y?F+  则有 Y ? XF+  ? XG++ 。             所以X→Y ? (G+)+= G+。即F+ ? G+。(3F+ ,所以F+ = G+。
Minimum dependency Set

Definition 6.15 If the function dependency set F satisfies the following conditions, it is said that f is a minimum function dependency set. Also known as a minimum dependency set or minimum overwrite.
(1) The right side of any of the function dependencies in F contains only one property.
(2) There is no such function dependency x→a in F, which makes F and f-{x→a} equivalent.
(3) There is no such function dependency x→a in F, X has a true subset Z makes f-{x→a}∪{z→a} and F equivalent.

[例2] 关系模式S<U,F>,其中:          U={ Sno,Sdept,Mname,Cno,Grade },          F={ Sno→Sdept,Sdept→Mname,(Sno,Cno)→Grade }      设F’={Sno→Sdept,Sno→Mname,Sdept→Mname,               (Sno,Cno)→Grade,(Sno,Sdept)→Sdept}F是最小覆盖,而F’不是。因为:F ’ - {Sno→Mname}与F ’等价          F ’ - {(Sno,Sdept)→Sdept}也与F ’等价       

Theorem 6.3 Each function dependency set F equal price to a minimum function dependence
Set FM. This FM is called the minimum dependent set of F.
Proof: Structural proof, find out a minimum dependency set of F.

(1Check each function in F to rely on fdi:x→y, if y=a1a2 ... Ak,k >2, then use {X→aj |j=1,2, ...., k} to replace X→y. (2Check each function dependent fdi:x→ in FA, making g=f-{x→A}, ifA? xg+, the function dependency is removed from F. (3) Remove each function dependent fdi:x→ in FA, set x=b1b2 ... Bm, which examines bi (i=l,2,..., m), ifA? (X-BI) f+, replace X with X-bi. [Example3] F = {A→b,b→A, B→c,A→c,c→A} Fm1, Fm2 are all the minimum dependent sets of F: fm1= {A→b,b→c,c→A} fm2= {A→b,b→A,A→c,c→AThe minimum dependent set of F is the FM not unique minimization process (theorem6.3) is also an algorithm for verifying that f is a minimal dependency set
Decomposition of patterns

The method of decomposing low-level relational patterns into several high-level relational patterns is not unique.
The decomposition method is only meaningful if the relational pattern is equal to the original relational pattern.

Definitions of three modes of decomposition equivalence:

⒈ 分解具有无损连接性⒉ 分解要保持函数依赖⒊ 分解既要保持函数依赖,又要具有无损连接性
定义6.16 关系模式R<U,F>的一个分解:ρ={ R1<U1,F1>,R2<U2,F2>,…,Rn<Un,Fn>}    U= ∪Ui,且不存在  Ui ? Uj,Fi 为 F在 Ui 上的投影定义6.17  函数依赖集合{X→Y | X→Y ? F+∧XY ?Ui} 的一个覆盖 Fi 叫作 F 在属性 Ui 上的投影
例:S-L(Sno, Sdept, Sloc)        F={ Sno→Sdept,Sdept→Sloc,Sno→Sloc}        S-L∈2NF  分解方法可以有多种:1. S-L分解为三个关系模式:SN(Sno)                        SD(Sdept)                        SO(Sloc)2.  SL分解为下面二个关系模式:  NL(Sno, Sloc)                        DL(Sdept, Sloc)3. 将SL分解为下面二个关系模式:  ND(Sno, Sdept)                            NL(Sno, Sloc)

Relationship Mode R

Decomposition algorithm

Algorithm 6.2 discriminant A decomposition of non-destructive connectivity
Algorithm 6.3 (synthesis method) is converted to 3NF to maintain the decomposition of the function dependency.
Algorithm 6.4 converted to 3NF decomposition with both non-destructive connectivity and function dependencies maintained
Lossless connection decomposition of algorithm 6.5 (decomposition method) converted to BCNF
Algorithm 6.6 achieves 4NF of decomposition with lossless connectivity
If decomposition is required to have non-destructive connectivity, then the mode decomposition must be able to achieve 4NF
If the decomposition is required to maintain the function dependence, then the pattern decomposition must be able to reach 3NF, but not necessarily to achieve bcnf
If the decomposition of the requirements of both non-destructive connectivity, and maintain the function dependence, the mode decomposition must be able to reach 3NF, but not necessarily to achieve bcnf

Normalization theory provides a theoretical guide and tool for database design
It's just a guide and a tool.

Not the higher the degree of normalization, the better the pattern.
The database schema must be chosen rationally in combination with the application environment and the real-world situation

Database-axiom System of data dependence

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.