A Formal Context for Closures of Acyclic Hypergraphs ...icfca2019/... · Two Views of RDBM...

28
A Formal Context for Closures of Acyclic Hypergraphs ICFCA’19 Jaume Baixeries Departament de Ci` encies de la Computaci´o. Universitat Polit` ecnica de Catalunya. 26/06/2019

Transcript of A Formal Context for Closures of Acyclic Hypergraphs ...icfca2019/... · Two Views of RDBM...

Page 1: A Formal Context for Closures of Acyclic Hypergraphs ...icfca2019/... · Two Views of RDBM Dependencies: Syntax Syntax answers the following question: Given a set of dependendencies

A Formal Context for Closures of AcyclicHypergraphs

ICFCA’19

Jaume Baixeries

Departament de Ciencies de la Computacio.Universitat Politecnica de Catalunya.

26/06/2019

Page 2: A Formal Context for Closures of Acyclic Hypergraphs ...icfca2019/... · Two Views of RDBM Dependencies: Syntax Syntax answers the following question: Given a set of dependendencies

Layout

1 Two complementary views on RDBM dependencies.

2 Acyclic Hypergraphs (AHG).

3 Main Result: AHG’s and FCA.

Page 3: A Formal Context for Closures of Acyclic Hypergraphs ...icfca2019/... · Two Views of RDBM Dependencies: Syntax Syntax answers the following question: Given a set of dependendencies

Two Views of RDBM Dependencies

Dependencies are constraints that (must) apply on databases(ex: functional dependencies).

We can see dependencies from two different points of view:

Semantics and Syntax

Page 4: A Formal Context for Closures of Acyclic Hypergraphs ...icfca2019/... · Two Views of RDBM Dependencies: Syntax Syntax answers the following question: Given a set of dependendencies

Two Views of RDBM Dependencies: Semantics

Semantics explains a dependency w.r.t. a dataset:

Example

A functional dependency X → Y holds if and only if:

∀ti , tj : ti [X ] = tj [X ]⇒ ti [Y ] = tj [Y ]

Page 5: A Formal Context for Closures of Acyclic Hypergraphs ...icfca2019/... · Two Views of RDBM Dependencies: Syntax Syntax answers the following question: Given a set of dependendencies

Two Views of RDBM Dependencies: Semantics

According to its Semantics we have:

Implications.

Functional dependencies.

Multivalued dependencies.

Join dependencies.

Acyclic Join dependencies.

...

Page 6: A Formal Context for Closures of Acyclic Hypergraphs ...icfca2019/... · Two Views of RDBM Dependencies: Syntax Syntax answers the following question: Given a set of dependendencies

Two Views of RDBM Dependencies: Syntax

Syntax explains a dependency w.r.t. a set of dependencies (usuallyof the same kind).

Example: Transitivity

If two functional dependencies X → Y and Y → Z hold,then X → Z holds as well.

Page 7: A Formal Context for Closures of Acyclic Hypergraphs ...icfca2019/... · Two Views of RDBM Dependencies: Syntax Syntax answers the following question: Given a set of dependendencies

Two Views of RDBM Dependencies: Syntax

Syntax answers the following question:

Given a set of dependendencies Σ that hold in a dataset, whatother dependencies necessarily hold as well?

(regardless of the dataset)

This set is called Σ+.

Syntax induces a set of axioms for each kind of dependency.

Page 8: A Formal Context for Closures of Acyclic Hypergraphs ...icfca2019/... · Two Views of RDBM Dependencies: Syntax Syntax answers the following question: Given a set of dependendencies

Two Views of RDBM Dependencies: Syntax

According to its Syntax we have:

Armstrong dependencies.

Symmetric dependencies.

Join dependencies.

...

Page 9: A Formal Context for Closures of Acyclic Hypergraphs ...icfca2019/... · Two Views of RDBM Dependencies: Syntax Syntax answers the following question: Given a set of dependendencies

Two Views of RDBM Dependencies

Semantics Syntax

Horn Clauses / ImplicationsFunctional Dependencies Armstrong DependenciesSimilarity Dependencies

MVD ClausesDegenerated MVD Symmetric DependenciesMultivalued Dependencies

Acyclic Join Dependencies Acyclic Hypergraphs

Table: Table of references (non exhaustive) of FCA/lattice-basedcharacterization of database constraints.

Page 10: A Formal Context for Closures of Acyclic Hypergraphs ...icfca2019/... · Two Views of RDBM Dependencies: Syntax Syntax answers the following question: Given a set of dependendencies

Notation

What is an Acyclic Hypergraph?

Page 11: A Formal Context for Closures of Acyclic Hypergraphs ...icfca2019/... · Two Views of RDBM Dependencies: Syntax Syntax answers the following question: Given a set of dependendencies

Acyclic Hypergraphs

Let U be a set of attributes.

A Hypergraph is a set of subsets of U :

H = [A1,A2, . . . ,An ] Ai ⊆ U

All attributes in U need to be in one of those subsets.

Join Dependencies

With these conditions, we just have a Join Dependency.

Page 12: A Formal Context for Closures of Acyclic Hypergraphs ...icfca2019/... · Two Views of RDBM Dependencies: Syntax Syntax answers the following question: Given a set of dependendencies

Acyclic Hypergraphs

Let U be a set of attributes.

A Hypergraph is a set of subsets of U :

H = [A1,A2, . . . ,An ]

All attributes in U need to be in one of those subsets.

The hypergraphs is α-acyclic.

α-Acyclic Hypergraphs

With these conditions, we now have a Acyclic Hypergraph.

Page 13: A Formal Context for Closures of Acyclic Hypergraphs ...icfca2019/... · Two Views of RDBM Dependencies: Syntax Syntax answers the following question: Given a set of dependendencies

Acyclic Hypergraphs

Hypergraph

U = { a, b, c , d , e }

H = [ abc, bcd , cde, ae ]

α-Acyclic Hypergraph

U = { a, b, c , d , e }

H = [ abc, bcd , cde ]

Page 14: A Formal Context for Closures of Acyclic Hypergraphs ...icfca2019/... · Two Views of RDBM Dependencies: Syntax Syntax answers the following question: Given a set of dependendencies

Characterization of α-acyclicity

Every AHG has (at least) one join tree

bcd

abc

bc

cde

cd

Figure: Join tree for [ abc, bcd , cde ].

Page 15: A Formal Context for Closures of Acyclic Hypergraphs ...icfca2019/... · Two Views of RDBM Dependencies: Syntax Syntax answers the following question: Given a set of dependendencies

From the Semantical point of view

Reminder!!

This is the definition of a (Acyclic) Join Dependency.

[ ab, bc, cd ] holds in R because:

a b

1 2

3 4

×

b c

2 3

2 1

4 3

×

c d

3 5

1 2

1 5

=

R a b c d

t1 1 2 3 5

t2 1 2 1 2

t3 3 4 3 5

t4 1 2 1 5

Page 16: A Formal Context for Closures of Acyclic Hypergraphs ...icfca2019/... · Two Views of RDBM Dependencies: Syntax Syntax answers the following question: Given a set of dependendencies

Acyclic Hypergraphs

However, we said that we only focus on the syntax of AJD’s.

Acyclic Join Dependencies → Acyclic Hypergraphs

Join Dependencies → Hypergraphs

Page 17: A Formal Context for Closures of Acyclic Hypergraphs ...icfca2019/... · Two Views of RDBM Dependencies: Syntax Syntax answers the following question: Given a set of dependendencies

Acyclic Hypergraphs vs Symmetric Dependencies

A Symmetric Dependency (SD) is an AHG of size 2:

[ ab, bcd ] ≡ a⇒ b | cd

Page 18: A Formal Context for Closures of Acyclic Hypergraphs ...icfca2019/... · Two Views of RDBM Dependencies: Syntax Syntax answers the following question: Given a set of dependendencies

AHG’s and FCA

The closure of a set of Symmetric Dependencies has already beencharacterized in terms of FCA:

KSD = (SDU ,℘(U), I )

←− SOMETHING (with attributes) −→↑

DEPENDENCIES↓

Σ′′ = Σ+

Page 19: A Formal Context for Closures of Acyclic Hypergraphs ...icfca2019/... · Two Views of RDBM Dependencies: Syntax Syntax answers the following question: Given a set of dependendencies

Acyclic Hypergraphs

Symmetric Dependencies ⊂ Acyclic Hypergraphs ⊂ Hypergraphs

Page 20: A Formal Context for Closures of Acyclic Hypergraphs ...icfca2019/... · Two Views of RDBM Dependencies: Syntax Syntax answers the following question: Given a set of dependendencies

Acyclic Join Dependencies - Acyclic Hypergraphs

Join dependencies can’t be axiomatized.

Acyclic Join Dependencies can be axiomatized.

Acyclic Join Dependencies are equivalent to a set ofSymmetric dependencies.

Page 21: A Formal Context for Closures of Acyclic Hypergraphs ...icfca2019/... · Two Views of RDBM Dependencies: Syntax Syntax answers the following question: Given a set of dependendencies

Acyclic Join Dependencies - Acyclic Hypergraphs

Join dependencies can’t be axiomatized.

Acyclic Join Dependencies can be axiomatized.

Acyclic Join Dependencies are equivalent to a set ofSymmetric dependencies.

Page 22: A Formal Context for Closures of Acyclic Hypergraphs ...icfca2019/... · Two Views of RDBM Dependencies: Syntax Syntax answers the following question: Given a set of dependendencies

Symmetric Dependencies Axioms

(B1) Let [A,B] be a SD, X ⊆ U

[A,B]⇒ [A ∪ X ,B ∪ X ]

(B2) Let [A,E ] and [X ,Y ] be SD’s, such that Y = A ∩ E .

[A,E ], [X ,Y ]⇒ [A,E ∩ X ]

(Trivial axioms are ommited)

Page 23: A Formal Context for Closures of Acyclic Hypergraphs ...icfca2019/... · Two Views of RDBM Dependencies: Syntax Syntax answers the following question: Given a set of dependendencies

Acyclic Hypergraphs Axioms

(B1) Let [A,B] be an AHG, X ⊆ U

[A,B]⇒ [A ∪ X ,B ∪ X ]

(B2) Let [A,E ] and [X ,Y ] be AHG’s, such that Y = A ∩ E .

[A,E ], [X ,Y ]⇒ [A,E ∩ X ]

(A3) Let [E ,H1, . . . ,Hn] and [X ,Y ] be AHG such that X ∩ Y ⊆ Eand ∀Hi : Hi ∩ E ⊆ X Hi ∩ E ⊆ Y . LetH ′ = reduction([E ∩ X ,E ∩ Y ,H1, . . . ,Hn]).

[E ,H1, . . . ,Hn], [X ,Y ]⇒ [H ′]

(Trivial axioms are ommited)

Page 24: A Formal Context for Closures of Acyclic Hypergraphs ...icfca2019/... · Two Views of RDBM Dependencies: Syntax Syntax answers the following question: Given a set of dependendencies

AHG’s and FCA: Main Result

Key idea: An AHG is equivalent to a set of SD’s.

Therefore: we need to test all SD’s in the previously definedformal context.

Page 25: A Formal Context for Closures of Acyclic Hypergraphs ...icfca2019/... · Two Views of RDBM Dependencies: Syntax Syntax answers the following question: Given a set of dependendencies

AHG’s and FCA: Main Result

The main result in this paper is the corollary of two results:

1 The characterization of SD’s with a formal context.

2 The fact that an AHG is equivalent to a set of SD’s.

Page 26: A Formal Context for Closures of Acyclic Hypergraphs ...icfca2019/... · Two Views of RDBM Dependencies: Syntax Syntax answers the following question: Given a set of dependendencies

AHG’s and FCA: Main Result

Let ΣAHG be a set of AHG.

ΣAHG ⇒ ΣSD ⇒ Σ+SD ⇒ Σ+

AHGeq. SD-AHG (SDU ,℘(U), I ) eq. SD-AHG

Th. 1 & 2 Papers [*]Cor. 1 & Prop. 2

Papers [*]:

1 J. Baixeries. A Formal Context for Symmetric Dependencies,pages 90–105. Springer Berlin Heidelberg, Berlin, Heidelberg,2008.

2 J. Baixeries. A New Formal Context for SymmetricDependencies. Concept Lattices and Applications 2011.

Page 27: A Formal Context for Closures of Acyclic Hypergraphs ...icfca2019/... · Two Views of RDBM Dependencies: Syntax Syntax answers the following question: Given a set of dependendencies

Future Work

1 Can we (still) simplify this formal context?

2 Can we have a native formal context in terms of AHG?

3 FCA still has a long way to go...

Page 28: A Formal Context for Closures of Acyclic Hypergraphs ...icfca2019/... · Two Views of RDBM Dependencies: Syntax Syntax answers the following question: Given a set of dependendencies

Thanks

Vielen Dank!

Questions??