The equational theory of the natural join and of the inner union is - - PowerPoint PPT Presentation

the equational theory of the natural join and of the
SMART_READER_LITE
LIVE PREVIEW

The equational theory of the natural join and of the inner union is - - PowerPoint PPT Presentation

The equational theory of the natural join and of the inner union is decidable 1 Luigi Santocanale LIF, Aix-Marseille Universit e Meeting TICAMORE@Marseille, November 15-17, 2017 1 Preprint available on HAL:


slide-1
SLIDE 1

The equational theory of the natural join and of the inner union is decidable1

Luigi Santocanale LIF, Aix-Marseille Universit´ e Meeting TICAMORE@Marseille, November 15-17, 2017

1Preprint available on HAL:

https://hal.archives-ouvertes.fr/hal-01625134/

1/26

slide-2
SLIDE 2

Plan

Algebra from databases Some undecidable theories The structure of relational lattices Decidability of the equational theory of the relational lattices

2/26

slide-3
SLIDE 3

Plan

Algebra from databases Some undecidable theories The structure of relational lattices Decidability of the equational theory of the relational lattices

3/26

slide-4
SLIDE 4

Databases, tables, sqls . . .

4/26

slide-5
SLIDE 5

Databases, tables, sqls . . .

4/26

slide-6
SLIDE 6

Operations on tables: the natural join

Name Surname Item Luigi Santocanale 33 Alan Turing 21 ⊲ ⊳ Item Description 33 Book 33 Livre 21 Machine = Name Surname Item Description Luigi Santocanale 33 Book Luigi Santocanale 33 Livre Alan Turing 21 Machine

5/26

slide-7
SLIDE 7

Operations on tables: the inner union

Name Surname Item Luigi Santocanale 33 Alan Turing 21 ∪ Name Surname Sport Diego Maradona Football Usain Bolt Athletics = Name Surname Luigi Santocanale Alan Turing Diego Maradona Usain Bolt

6/26

slide-8
SLIDE 8

Lattices from databases

  • Proposition. [Spight & Tropashko, 2006] The set of tables, whose

columns are indexed by a subset of A and values are from a set D, is a lattice, with natural join as meet and inner union as join. R(D, A) shall denote the lattice whose elements are tables, with columns indexed a subset of A and cells’ values are from a set D. A project (Tropashko). Rebuild Codd’s relational algebra out of lattice theoretic building blocks.

7/26

slide-9
SLIDE 9

Plan

Algebra from databases Some undecidable theories The structure of relational lattices Decidability of the equational theory of the relational lattices

8/26

slide-10
SLIDE 10

A family of undecidable theories and problems

Theorem (Maddux)

The equational theory of 3-dimensional diagonal free cylindric algebras is undecidable.

Theorem (Hirsch and Hodkinson)

It is not decidable whether a finite simple relation algebra embeds into a concrete one (a powerset of a binary product).

Theorem (Hirsch, Hodkinson and Kurucz)

It is not decidable whether a finite mutimodal frame has a surjective p-morphism from a universal product frame.

9/26

slide-11
SLIDE 11

n-dimensional diagonal free cylindric algebras, aka the multidimensional modal logic S5n

◮ n-dimensional cylindric algebras:

algebraic modelling of first order logic with no more than n variables. Diagonal free: no equality.

◮ n-multimodal logic S5: we have n modal operators i, i = 1, . . . , n,

each one is S5.

◮ S5n is the n-multimodal logic determined by the universal product

  • frames. These are product sets

X1 × . . . × Xn with accessibility given by: (x1, . . . , xn)Ri(y1, . . . , yn) iff xj = yj, for all j = i.

◮ For n ≥ 3, S5n has the finite model property, it is recursively

enumerable, yet it is not decidable.

10/26

slide-12
SLIDE 12

Quasiequations, equations

◮ A quasiequation (definite Horn clause) is the universal closure

  • f a formula of the form

s1 = t1 ∧ . . . ∧ sn = tn = ⇒ s0 = t0 , with si, ti, i = 0, . . . , n, terms build over a fixed signature.

◮ The quasiequational theory of a class K: the set of

quasiequations holding in all elements of K.

11/26

slide-13
SLIDE 13

Quasiequations, equations

◮ A quasiequation (definite Horn clause) is the universal closure

  • f a formula of the form

s1 = t1 ∧ . . . ∧ sn = tn = ⇒ s0 = t0 , with si, ti, i = 0, . . . , n, terms build over a fixed signature.

◮ The quasiequational theory of a class K: the set of

quasiequations holding in all elements of K.

◮ An equation is a quasiequation as above with n = 0. ◮ The equational theory of a class K: the set of equations

holding in all elements of K. See the standard Birkhoff’s theorem.

11/26

slide-14
SLIDE 14

Undecidable quasiequational theories of relational lattices

Theorem (Litak, Mikul´ as and Hidders, 2015)

The set of quasiequations in the signature (∧, ∨, H) that are valid

  • n relational lattices is undecidable.

12/26

slide-15
SLIDE 15

Undecidable quasiequational theories of relational lattices

Theorem (Litak, Mikul´ as and Hidders, 2015)

The set of quasiequations in the signature (∧, ∨, H) that are valid

  • n relational lattices is undecidable.

This was refined to:

Theorem (Santocanale, RAMICS 2017)

The set of quasiequations in the signature (∧, ∨) that are valid on relational lattices is undecidable. where we actually proved a stronger result:

Theorem (Santocanale 2017)

It is undecidable whether a finite subdirectly irreducible lattice embeds into some R(D, A).

12/26

slide-16
SLIDE 16

Plan

Algebra from databases Some undecidable theories The structure of relational lattices Decidability of the equational theory of the relational lattices

13/26

slide-17
SLIDE 17

The relational lattices R(D, A)

A a set of attributes, D a set of values. An element of R(D, A):

◮ a pair (α, Y ) with α ⊆ A and Y ⊆ Dα.

We have (α1, Y1) ≤ (α2, Y2) iff α2 ⊆ α1 and Y1↾ ↾α2⊆ Y2 . NB :

◮ ↾

↾ is restriction: Y↾ ↾α = { f↾α | f ∈ Y } .

14/26

slide-18
SLIDE 18

Meet and join

(α1, Y1) ∧ (α2, Y2) := (α1 ∪ α2, Y ) where Y = { f | f↾αi ∈ Yi, i = 1, 2 } = iα1∪α2(Y1) ∩ iα1∪α2(Y2) , (α1, Y1) ∨ (α2, Y2) := (α1 ∩ α2, Y ) where Y = { f | ∃i ∈ { 1, 2 }, ∃g ∈ Yi s.t. g↾α1∩α2 = f } = Y1↾ ↾α1∩α2 ∪ Y2↾ ↾α1∩α2 . NB :

◮ i is cylindrification:

iα(Y ) = { f | f↾α ∈ Y } .

15/26

slide-19
SLIDE 19

Representation via closure operators

The Hamming/Priess Crampe-Ribenboim ultrametric distance on DA: δ(f , g) := { x ∈ A | f (x) = g(x) } . NB: this distance takes values in the join-semilattice (P(A), ∅, ∪).

16/26

slide-20
SLIDE 20

Representation via closure operators

The Hamming/Priess Crampe-Ribenboim ultrametric distance on DA: δ(f , g) := { x ∈ A | f (x) = g(x) } . NB: this distance takes values in the join-semilattice (P(A), ∅, ∪). A subset Z of A + DA is closed if δ(f , g) ⊆ A ∩ Z g ∈ DA ∩ Z

  • implies f ∈ Z .

16/26

slide-21
SLIDE 21

Representation via closure operators

The Hamming/Priess Crampe-Ribenboim ultrametric distance on DA: δ(f , g) := { x ∈ A | f (x) = g(x) } . NB: this distance takes values in the join-semilattice (P(A), ∅, ∪). A subset Z of A + DA is closed if δ(f , g) ⊆ A ∩ Z g ∈ DA ∩ Z

  • implies f ∈ Z .
  • Proposition. [Litak, Mikul´

as and Hidders 2015] R(D, A) is isomorphic to the lattice of closed subsets of A + DA.

16/26

slide-22
SLIDE 22

Lattices from generalized ultrametric spaces

In a similar way, we can construct a lattice from any generalized ultrametric space (X, δ) over some P(A). A subset Z ∈ P(A + X) is closed if δ(f , g) ⊆ A ∩ Z g ∈ X ∩ Z

  • implies f ∈ Z .

17/26

slide-23
SLIDE 23

Lattices from generalized ultrametric spaces

In a similar way, we can construct a lattice from any generalized ultrametric space (X, δ) over some P(A). A pair (α, Y ) ∈ P(A) × P(Y ) is closed if δ(f , g) ⊆ α g ∈ Y

  • implies f ∈ Z .

17/26

slide-24
SLIDE 24

Lattices from generalized ultrametric spaces

In a similar way, we can construct a lattice from any generalized ultrametric space (X, δ) over some P(A). A pair (α, Y ) ∈ P(A) × P(Y ) is closed if δ(f , g) ⊆ α g ∈ Y

  • implies f ∈ Z .

Thus we put L(X, δ) := { (α, Y ) | αY ⊆ Y } , where αY = { f ∈ X | ∃g ∈ Y s.t. δ(f , g) ⊆ α } .

17/26

slide-25
SLIDE 25

Lattices from generalized ultrametric spaces

In a similar way, we can construct a lattice from any generalized ultrametric space (X, δ) over some P(A). A pair (α, Y ) ∈ P(A) × P(Y ) is closed if δ(f , g) ⊆ α g ∈ Y

  • implies f ∈ Z .

Thus we put L(X, δ) := { (α, Y ) | αY ⊆ Y } , where αY = { f ∈ X | ∃g ∈ Y s.t. δ(f , g) ⊆ α } . Clearly R(D, A) = L(DA, δ).

17/26

slide-26
SLIDE 26

Universal product spaces as injective generalized ultrametric spaces

Lemma

TFAE :

◮ (X, δ) is injective in the category of generalized ultrametric

spaces over P(A),

◮ (X, δ) is, up to isomorphism, a universal product space:

X =

  • a∈A

Xa , δ(x, y) = { a ∈ A | xa = ya } . Remark : intuitively, injective means complete.

18/26

slide-27
SLIDE 27

Relational lattices as modal logic

We can interpret the theory of the lattices L(X, δ) in a sort of multidimensional S5n modal logic. Modal operators are indexed by subsets of A: αY := { f ∈ DA | ∃g ∈ Y s.t. δ(f , g) ⊆ α } . If (X, δ) is injective, then we have the following logical equivalence: α1 ∪ α2Y = α1α2Y . Meet is conjunction, where the join is: (α1, Y1) ∨ (α2, Y2) = (α1 ∪ α2, α1 ∪ α2(Y1 ∪ Y2)) = (α1 ∪ α2, α1 ∪ α2Y1 ∪ α1 ∪ α2Y2) = (α1 ∪ α2, α2α1Y1 ∪ α1α2Y2) = (α1 ∪ α2, α2Y1 ∪ α1Y2) .

19/26

slide-28
SLIDE 28

Plan

Algebra from databases Some undecidable theories The structure of relational lattices Decidability of the equational theory of the relational lattices

20/26

slide-29
SLIDE 29

Strategy

◮ Every lattice equation t = s is equivalent to a pair of

“inclusions”, t ≤ s and s ≤ t.

21/26

slide-30
SLIDE 30

Strategy

◮ Every lattice equation t = s is equivalent to a pair of

“inclusions”, t ≤ s and s ≤ t.

◮ We show that if an inclusion t ≤ s fails in a lattice R(D, A),

then it fails in a lattice R(E, B) of size O(222n ), with n = size(t, s).

21/26

slide-31
SLIDE 31

Strategy

◮ Every lattice equation t = s is equivalent to a pair of

“inclusions”, t ≤ s and s ≤ t.

◮ We show that if an inclusion t ≤ s fails in a lattice R(D, A),

then it fails in a lattice R(E, B) of size O(222n ), with n = size(t, s).

◮ The method is reminiscent of Gabbay’s selective filtration in

modal logic.

21/26

slide-32
SLIDE 32

Strategy

◮ Every lattice equation t = s is equivalent to a pair of

“inclusions”, t ≤ s and s ≤ t.

◮ We show that if an inclusion t ≤ s fails in a lattice R(D, A),

then it fails in a lattice R(E, B) of size O(222n ), with n = size(t, s).

◮ The method is reminiscent of Gabbay’s selective filtration in

modal logic.

◮ Thanks to TICAMORE: I would have not found this, if had

not wondered about semantics vs syntactic methods for decidability in modal logic.

21/26

slide-33
SLIDE 33

The tableau of a failure

Suppose t ≤ s is not vaild in all the R(D, A)s.

◮ For some A, D and v : X −

→ R(D, A), tv ⊆ sv.

◮ We can suppose that f ∈ tv \ sv for some f ∈ DA.

Lemma (preservation of failures)

There is a finite subset T(f , t) ⊆ DA such that, if T(f , t) ⊆ T ⊆ DA, then L(T, δ) | = t ≤ s .

◮ Above, (T, δ) is the subspace of (DA, δ) induced by T.

22/26

slide-34
SLIDE 34

Failures in a finite lattice

◮ The lattice L(T, δ) might still be infinite, even if T is finite. ◮ This is because we have a copy of P(A) inside it.

23/26

slide-35
SLIDE 35

Failures in a finite lattice

◮ The lattice L(T, δ) might still be infinite, even if T is finite. ◮ This is because we have a copy of P(A) inside it.

Let T be finite.

◮ If BT is the Boolean algebra generated by

{ δ(g, h) | g, h ∈ T } ∪ { A ∩ v(x) | x ∈ Vars(t, s) } , then BT ≃ P(BT) for some finite subset BT.

◮ We consider T as a generalized ultrametric space (T, δBT ) over

P(BT).

23/26

slide-36
SLIDE 36

Failures in a finite lattice

◮ The lattice L(T, δ) might still be infinite, even if T is finite. ◮ This is because we have a copy of P(A) inside it.

Let T be finite.

◮ If BT is the Boolean algebra generated by

{ δ(g, h) | g, h ∈ T } ∪ { A ∩ v(x) | x ∈ Vars(t, s) } , then BT ≃ P(BT) for some finite subset BT.

◮ We consider T as a generalized ultrametric space (T, δBT ) over

P(BT).

Lemma (preservation of failures in the finite)

There is a finite subset T(f , t) ⊆ DA such that, if T(f , t) ⊆ T ⊆ DA and T is finite, then L(T, δBT ) | = t ≤ s .

23/26

slide-37
SLIDE 37

Failures in a universal product frame

◮ The L(T, δBT ) is finite lattice. ◮ Yet, it does not need to be in the variety of the R(D, A)s.

Lemma

For each finite T there is a finite G(T) ⊆ DA such that

◮ T ⊆ G(T), ◮ BT = BG(T), ◮ (G(T), δBG(T)) is injective relative to P(BT).

  • Corollary. Let T0 := T(f , t). Then the lattice L(G(T0), δBT0) is

finite and L(G(T0), δBT0) | = t ≤ s .

24/26

slide-38
SLIDE 38

Summing up

◮ If (G(T0), δBT0 ) is injective then (up to isomorphism)

G(T0) =

  • b∈BT0

Xb .

◮ Taking b0 so Xb0 is of maximal cardinality, we can embed G(T0)

into Xb0

BT0 :

  • b∈BT0

Xb ⊆

  • b∈BT0

Xb0 = Xb0

BT0 .

◮ Using injectivity, functoriality, and a bit of lattice theoretic tricks,

we can show L(G(T0), δBT0 ) is a homomorphic image of a sublattice

  • f R(Xb0, BT0).

◮ Then

R(Xb0, BT0) | = t ≤ s

  • therwise we would have L(G(T0), δBT0 ) |

= t ≤ s.

25/26

slide-39
SLIDE 39

TICAMORE challenges

◮ complexity issues ; ◮ axiomatizations and automated tools ; ◮ completeness ; ◮ from labeled calculi to pure equational axioms ?

26/26