Relation Algebra, Allegories, and Logic Programming
Emilio Jesús Gallego Arias
[joint work with J. Lipton, J. Mariño]
CRI-Mines ParisTech
Deducteam Seminar 17/10/2014 — Paris
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 1 / 35
Relation Algebra, Allegories, and Logic Programming Emilio Jess - - PowerPoint PPT Presentation
Relation Algebra, Allegories, and Logic Programming Emilio Jess Gallego Arias [joint work with J. Lipton, J. Mario] CRI-Mines ParisTech Deducteam Seminar 17/10/2014 Paris EJGA (CRI-Mines) Allegories and CLP 09/22/2013 1 / 35
[joint work with J. Lipton, J. Mariño]
CRI-Mines ParisTech
Deducteam Seminar 17/10/2014 — Paris
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 1 / 35
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 2 / 35
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 2 / 35
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 2 / 35
add(0, X, X). (∀X) add(X+1, Y, Z+1) <- add(X, Y, Z). (∀XYZ)
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 2 / 35
add(0, X, X). (∀X) add(X+1, Y, Z+1) <- add(X, Y, Z). (∀XYZ) ?- add(3, X, 4). {X = 1} ? ; no more
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 2 / 35
add(0, X, X). (∀X) add(X+1, Y, Z+1) <- add(X, Y, Z). (∀XYZ) ?- add(3, X, 4). {X = 1} ? ; no more ?- add(X, Y, Z). {X = o, Z = Y ?} ; {X = s(o), Z = s(Y) ? } [more]
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 2 / 35
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 3 / 35
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 3 / 35
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 3 / 35
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 3 / 35
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 3 / 35
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 3 / 35
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 3 / 35
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 3 / 35
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 4 / 35
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 4 / 35
p(s(Y)). %% p(X) :- ∃ Y, X = s(Y) ? p(X).
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 4 / 35
p(s(Y)). %% p(X) :- ∃ Y, X = s(Y) ? p(X). { X = s(_X13) }
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 4 / 35
p(s(Y)). %% p(X) :- ∃ Y, X = s(Y) ? p(X). { X = s(_X13) }
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 4 / 35
p(s(Y)). %% p(X) :- ∃ Y, X = s(Y) ? p(X). { X = s(_X13) }
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 4 / 35
p(s(Y)). %% p(X) :- ∃ Y, X = s(Y) ? p(X). { X = s(_X13) }
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 4 / 35
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 5 / 35
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 5 / 35
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 5 / 35
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 5 / 35
QRAΣ. Σ-allegories.
Program to theory between ground terms. Program to allegory. Sharing and memory is captured.
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 6 / 35
QRAΣ. Σ-allegories.
Program to theory between ground terms. Program to allegory. Sharing and memory is captured.
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 6 / 35
QRAΣ. Σ-allegories.
Program to theory between ground terms. Program to allegory. Sharing and memory is captured.
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 6 / 35
QRAΣ. Σ-allegories.
Program to theory between ground terms. Program to allegory. Sharing and memory is captured.
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 6 / 35
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 7 / 35
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 7 / 35
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 7 / 35
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 7 / 35
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 7 / 35
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 8 / 35
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 8 / 35
i−private forR···S
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 8 / 35
i−private forR···S
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 8 / 35
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 9 / 35
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 9 / 35
i
i K(ti)
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 9 / 35
i
i K(ti)
1 ; P◦ 1 ∩ f 2 1 ; (g3 1; P◦ 2 ∩ g2 1; (a, a); 1 ∩ g3 3; h; P◦ 1)
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 9 / 35
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 10 / 35
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 10 / 35
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 10 / 35
˙ K(∃x1x2.s(x1) ≤ x2) = Q1Q2; (P◦
1; s◦; P1 ∩ P◦ 2; P2); ≤; (P1; s; P◦ 1 ∩ P2; P◦ 2); Q1Q2
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 10 / 35
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 11 / 35
P
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 11 / 35
P
1 Purify clause’ heads, canonical renaming, Clark completion. 2 The Relational Step!
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 11 / 35
P
1 Purify clause’ heads, canonical renaming, Clark completion. 2 The Relational Step!
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 11 / 35
P
1 Purify clause’ heads, canonical renaming, Clark completion. 2 The Relational Step!
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 11 / 35
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 12 / 35
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 12 / 35
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 12 / 35
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 12 / 35
P
P
P
P
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 13 / 35
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 14 / 35
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 14 / 35
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 14 / 35
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 14 / 35
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 14 / 35
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 15 / 35
Σ ∪ (T ∗ Σ )∗ ∪ . . . is a hell of a
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 15 / 35
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 16 / 35
Σ ∪ (T ∗ Σ )∗ ∪ . . . .
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 16 / 35
Σ ∪ (T ∗ Σ )∗ ∪ . . . .
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 16 / 35
Σ ∪ (T ∗ Σ )∗ ∪ . . . .
i : N → 1 for untyped
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 16 / 35
For every constant a ∈ TΣ, we freely adjoin an arrow a : 0 → 1. For every function symbol f ∈ TΣ with arity α(f) = N, we freely adjoin an arrow f : N → 1.
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 17 / 35
✛
✲
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 18 / 35
✲
✲
✲ ✛
✲
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 19 / 35
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 20 / 35
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 20 / 35
❄ ✛
❄
❄ ✛
❄
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 21 / 35
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 22 / 35
✛
y
y
✲
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 23 / 35
✲
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 24 / 35
1 ∩ · · · ∩ Wn; pn; W ◦ n
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 25 / 35
1 ∩ · · · ∩ Wn; pn; W ◦ n
1 ∩ · · · ∩ Wn; pn; W ◦ n ); I◦ MN
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 25 / 35
1)◦ : 1 → 2 is the canonical “new”
✲ ✛
1
2
3
✲
✲ ✛
1
1
1
1
2
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 26 / 35
NK; W ◦ i : N → N is not in general a coreflexive relation, so
1 ; . . . ; Wn; (idAn × pn); W ◦ n ); I◦ MN
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 27 / 35
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 28 / 35
35
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 28 / 35
35
35
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 28 / 35
✛
✛
✲
✲
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 29 / 35
✛
✲
✛
✛
✲
✲
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 29 / 35
✛
✛
✲ ✲
✛
✛
✲
✲
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 29 / 35
✛
✛
✲ ✲
✛
✛
✲
✲
✛
✲
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 29 / 35
✛
✛
✲ ✲
✛
✛
✲
✲
✛
✲
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 29 / 35
R for the associated normalizing relation based on →R:
✲ M
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 30 / 35
✲ N + N′
✲
✲ M
1} ∪ · · · ∪ {gn ≈ g′ n} ∪ S′ | h)
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 31 / 35
(h,h′)
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 32 / 35
π1s, π2, π3; add ⇒
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 33 / 35
π1s, π2, π3; add ⇒ (π1s, π2, π3; o, π1, π1) ∪ . . . ⇒
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 33 / 35
π1s, π2, π3; add ⇒ (π1s, π2, π3; o, π1, π1) ∪ . . . ⇒ 0 ∪ π1s, π2, π3; I35; π1s, π2, π3s, π1, π3; W; (id2 × add); W ◦; I◦
35
⇒
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 33 / 35
π1s, π2, π3; add ⇒ (π1s, π2, π3; o, π1, π1) ∪ . . . ⇒ 0 ∪ π1s, π2, π3; I35; π1s, π2, π3s, π1, π3; W; (id2 × add); W ◦; I◦
35
⇒ π1s, π2, π3; I35; π1s, π2, π3s, π1, π3; W; (id2 × add); W ◦; I◦
35
⇒
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 33 / 35
π1s, π2, π3; add ⇒ (π1s, π2, π3; o, π1, π1) ∪ . . . ⇒ 0 ∪ π1s, π2, π3; I35; π1s, π2, π3s, π1, π3; W; (id2 × add); W ◦; I◦
35
⇒ π1s, π2, π3; I35; π1s, π2, π3s, π1, π3; W; (id2 × add); W ◦; I◦
35
⇒ (π1s, π2, π3 | π1s, π2, π3, π4, π5); π1s, π2, π3s, π1, π3; W; (id2 × add); W ◦; I◦
35
⇒
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 33 / 35
π1s, π2, π3; add ⇒ (π1s, π2, π3; o, π1, π1) ∪ . . . ⇒ 0 ∪ π1s, π2, π3; I35; π1s, π2, π3s, π1, π3; W; (id2 × add); W ◦; I◦
35
⇒ π1s, π2, π3; I35; π1s, π2, π3s, π1, π3; W; (id2 × add); W ◦; I◦
35
⇒ (π1s, π2, π3 | π1s, π2, π3, π4, π5); π1s, π2, π3s, π1, π3; W; (id2 × add); W ◦; I◦
35
⇒ (π1s, π2, π3s | π1s, π2, π3s, π1, π3); W; (id2 × add); W ◦; I◦
35
⇒
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 33 / 35
π1s, π2, π3; add ⇒ (π1s, π2, π3; o, π1, π1) ∪ . . . ⇒ 0 ∪ π1s, π2, π3; I35; π1s, π2, π3s, π1, π3; W; (id2 × add); W ◦; I◦
35
⇒ π1s, π2, π3; I35; π1s, π2, π3s, π1, π3; W; (id2 × add); W ◦; I◦
35
⇒ (π1s, π2, π3 | π1s, π2, π3, π4, π5); π1s, π2, π3s, π1, π3; W; (id2 × add); W ◦; I◦
35
⇒ (π1s, π2, π3s | π1s, π2, π3s, π1, π3); W; (id2 × add); W ◦; I◦
35
⇒ (π1s, π2, π3s | π1s, π3s, π1, π2, π3); (id2 × add); W ◦; I◦
35
⇒
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 33 / 35
π1s, π2, π3; add ⇒ (π1s, π2, π3; o, π1, π1) ∪ . . . ⇒ 0 ∪ π1s, π2, π3; I35; π1s, π2, π3s, π1, π3; W; (id2 × add); W ◦; I◦
35
⇒ π1s, π2, π3; I35; π1s, π2, π3s, π1, π3; W; (id2 × add); W ◦; I◦
35
⇒ (π1s, π2, π3 | π1s, π2, π3, π4, π5); π1s, π2, π3s, π1, π3; W; (id2 × add); W ◦; I◦
35
⇒ (π1s, π2, π3s | π1s, π2, π3s, π1, π3); W; (id2 × add); W ◦; I◦
35
⇒ (π1s, π2, π3s | π1s, π3s, π1, π2, π3); (id2 × add); W ◦; I◦
35
⇒ (π1s, π2, π3s | π1s, π3s, [π1, π2, π3; o, π1, π1]; W ◦; I◦
35 ∪ . . .
⇒
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 33 / 35
π1s, π2, π3; add ⇒ (π1s, π2, π3; o, π1, π1) ∪ . . . ⇒ 0 ∪ π1s, π2, π3; I35; π1s, π2, π3s, π1, π3; W; (id2 × add); W ◦; I◦
35
⇒ π1s, π2, π3; I35; π1s, π2, π3s, π1, π3; W; (id2 × add); W ◦; I◦
35
⇒ (π1s, π2, π3 | π1s, π2, π3, π4, π5); π1s, π2, π3s, π1, π3; W; (id2 × add); W ◦; I◦
35
⇒ (π1s, π2, π3s | π1s, π2, π3s, π1, π3); W; (id2 × add); W ◦; I◦
35
⇒ (π1s, π2, π3s | π1s, π3s, π1, π2, π3); (id2 × add); W ◦; I◦
35
⇒ (π1s, π2, π3s | π1s, π3s, [π1, π2, π3; o, π1, π1]; W ◦; I◦
35 ∪ . . .
⇒ (os, π1, π1s | os, π1s, [o, π1, π1]; W ◦; I◦
35 ∪ . . .
⇒
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 33 / 35
π1s, π2, π3; add ⇒ (π1s, π2, π3; o, π1, π1) ∪ . . . ⇒ 0 ∪ π1s, π2, π3; I35; π1s, π2, π3s, π1, π3; W; (id2 × add); W ◦; I◦
35
⇒ π1s, π2, π3; I35; π1s, π2, π3s, π1, π3; W; (id2 × add); W ◦; I◦
35
⇒ (π1s, π2, π3 | π1s, π2, π3, π4, π5); π1s, π2, π3s, π1, π3; W; (id2 × add); W ◦; I◦
35
⇒ (π1s, π2, π3s | π1s, π2, π3s, π1, π3); W; (id2 × add); W ◦; I◦
35
⇒ (π1s, π2, π3s | π1s, π3s, π1, π2, π3); (id2 × add); W ◦; I◦
35
⇒ (π1s, π2, π3s | π1s, π3s, [π1, π2, π3; o, π1, π1]; W ◦; I◦
35 ∪ . . .
⇒ (os, π1, π1s | os, π1s, [o, π1, π1]; W ◦; I◦
35 ∪ . . .
⇒ (os, π1, π1s | os, π1s, o, π1, π1); W ◦; I◦
35 ∪ . . .
⇒
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 33 / 35
π1s, π2, π3; add ⇒ (π1s, π2, π3; o, π1, π1) ∪ . . . ⇒ 0 ∪ π1s, π2, π3; I35; π1s, π2, π3s, π1, π3; W; (id2 × add); W ◦; I◦
35
⇒ π1s, π2, π3; I35; π1s, π2, π3s, π1, π3; W; (id2 × add); W ◦; I◦
35
⇒ (π1s, π2, π3 | π1s, π2, π3, π4, π5); π1s, π2, π3s, π1, π3; W; (id2 × add); W ◦; I◦
35
⇒ (π1s, π2, π3s | π1s, π2, π3s, π1, π3); W; (id2 × add); W ◦; I◦
35
⇒ (π1s, π2, π3s | π1s, π3s, π1, π2, π3); (id2 × add); W ◦; I◦
35
⇒ (π1s, π2, π3s | π1s, π3s, [π1, π2, π3; o, π1, π1]; W ◦; I◦
35 ∪ . . .
⇒ (os, π1, π1s | os, π1s, [o, π1, π1]; W ◦; I◦
35 ∪ . . .
⇒ (os, π1, π1s | os, π1s, o, π1, π1); W ◦; I◦
35 ∪ . . .
⇒ (os, π1, π1s | os, π1, π1s, o, π1); I◦
35 ∪ . . .
⇒
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 33 / 35
π1s, π2, π3; add ⇒ (π1s, π2, π3; o, π1, π1) ∪ . . . ⇒ 0 ∪ π1s, π2, π3; I35; π1s, π2, π3s, π1, π3; W; (id2 × add); W ◦; I◦
35
⇒ π1s, π2, π3; I35; π1s, π2, π3s, π1, π3; W; (id2 × add); W ◦; I◦
35
⇒ (π1s, π2, π3 | π1s, π2, π3, π4, π5); π1s, π2, π3s, π1, π3; W; (id2 × add); W ◦; I◦
35
⇒ (π1s, π2, π3s | π1s, π2, π3s, π1, π3); W; (id2 × add); W ◦; I◦
35
⇒ (π1s, π2, π3s | π1s, π3s, π1, π2, π3); (id2 × add); W ◦; I◦
35
⇒ (π1s, π2, π3s | π1s, π3s, [π1, π2, π3; o, π1, π1]; W ◦; I◦
35 ∪ . . .
⇒ (os, π1, π1s | os, π1s, [o, π1, π1]; W ◦; I◦
35 ∪ . . .
⇒ (os, π1, π1s | os, π1s, o, π1, π1); W ◦; I◦
35 ∪ . . .
⇒ (os, π1, π1s | os, π1, π1s, o, π1); I◦
35 ∪ . . .
⇒
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 33 / 35
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 34 / 35
EJGA (CRI-Mines) Allegories and CLP 09/22/2013 35 / 35