CS457 Syllabus & Progress

### The "cover" of a Set of Functional Dependencies

• Cover set

• Cover set

• Let 1 and 2 be two different sets of functional dependencies

• 1 is cover set of 2 if:

 every functional dependency in ℉2 can be inferred from the functional dependency in ℉1

• Example:

 ``` Relation R = (A, B, C, D, E, F) ℉1 = { A → BC D → DF } ℉2 = { A → B } ```

1 covers 2 because

 ``` ℉2 = { A → B } 1. A → B can be inferred from ℉1 as follows: A → A (Reflexivity rule) A → BC (A → A and A → BC) A → B (Subset rule) ```

• How to determine if 1 covers 2

• Let 1 and 2 be two sets of functional dependencies

• Algorithm to determine if 1 covers 2 :

 ``` For each functional dependency X → Y ∈ ℉2 do: { compute X+ using the FDs in ℉1 if ( Y ⊄ X+ ) return(NO); } return(YES); ```

• Example of functional dependency cover

• Consider the following two sets of functional dependencies:

 ``` Relation R = (A, B, C, D, E, F) ℉1 = { A → C AC → D E → AD E → F } ℉2 = { A → CD E → DF } ```

• Question:

 Does ℉1 covers ℉2 ???

Check each functional dependency in 2:

1. A → CD   ∈   2 :

 ``` Compute A+ with respect to ℉1: ℉1 = { A → C AC → D E → AD E → F } A+ = A (Initialization) = AC (A → C) = ACD (AC → D) stop... Check: CD ⊆ ACD ?? Yes. ---> Check next functional dependency in ℉2.... ```

2. E → DF   ∈   2 :

 ``` Compute E+ with respect to ℉1: ℉1 = { A → C AC → D E → AD E → F } E+ = E (Initialization) = ADE (E → AD) = ADEF (E → F) = ACDEF (A → C) Done Check: DF ⊆ ACDEF ?? Yes. Continue (no more functional dependency - DONE) ```

Conclusion: 1 covers 2

• Does 2 covers 1 ???

Check each functional dependency in 1:

1. A → C   ∈   ℉1 :

 ``` Compute A+ with respect to ℉2: ℉2 = { A → CD E → DF } A+ = A (Initialization) = ACD A → CD Done Check: C ⊆ ACD ?? Yes. Continue (next functional dependency in ℉1) ```

2. AC → D   ∈   ℉1 :

 ``` Compute AC+ with respect to ℉2: ℉2 = { A → CD E → DF } AC+ = AC (Initialization) = ACD (A → CD) Done Check: D ⊆ ACD ?? Yes. Continue (next functional dependency in ℉1) ```

3. E → AD   ∈   ℉1 :

 ``` Compute E+ with respect to ℉2: ℉2 = { A → CD E → DF } E+ = E (Initialization) = DEF (E → DF) Done Check: AD ⊆ DEF ?? NO !!! ```

Conclusion: 2 do not cover 1