Ordered direct basis of a finite closure system

Ordered direct basis of a finite closure system
joint work with J.B.Nation, University of Hawaii
R. Rand, Yeshiva College
K. Adaricheva
Yeshiva University
August 8, 2011 / AAB workshop
Yeshiva University, New York
K.Adaricheva (Yeshiva University)
Ordered basis
Algebra and AI seminar
1 / 38
Outline
1
Closure spaces, lattices and implications
2
Propositional Horn logic
3
Connections to computer science field
4
Canonical direct unit basis
5
Ordered direct basis
6
D-basis
7
Main Theorem
8
Canonical basis
9
Three bases comparison
K.Adaricheva (Yeshiva University)
Ordered basis
Algebra and AI seminar
2 / 38
Closure spaces, lattices and implications
Closure spaces
hX , φi is a closure space, if
X is non-empty set (finite in this talk);
φ is a closure operator on X , i.e. φ : B(X ) → B(X ) with
(1) Y ⊆ φ(Y );
(2) Y ⊆ Z implies φ(Y ) ⊆ φ(Z );
(3) φ(φ(Y )) = φ(Y ), for all Y , Z ⊆ X .
Closed set: A = φ(A);
Lattice of closed sets: Cl(X , φ).
K.Adaricheva (Yeshiva University)
Ordered basis
Algebra and AI seminar
3 / 38
Closure spaces, lattices and implications
Closure spaces
hX , φi is a closure space, if
X is non-empty set (finite in this talk);
φ is a closure operator on X , i.e. φ : B(X ) → B(X ) with
(1) Y ⊆ φ(Y );
(2) Y ⊆ Z implies φ(Y ) ⊆ φ(Z );
(3) φ(φ(Y )) = φ(Y ), for all Y , Z ⊆ X .
Closed set: A = φ(A);
Lattice of closed sets: Cl(X , φ).
K.Adaricheva (Yeshiva University)
Ordered basis
Algebra and AI seminar
3 / 38
Closure spaces, lattices and implications
Lattices and closure spaces
Proposition. Every finite lattice L is the lattice of closed sets of some
closure space hX , φi.
Take X = J(L), the set of join-irreducible elements: j ∈ J(L), if
j 6= 0, and j = a ∨ b implies j = a or j = b;
W
define φ(Y ) = {j ∈ J(L) : j ≤ Y }, Y ⊆ X .
K.Adaricheva (Yeshiva University)
Ordered basis
Algebra and AI seminar
4 / 38
Closure spaces, lattices and implications
1
2
3
4
5
Example: Building a closure space associated with lattice A12 .
X = J(A12 ) = {1, 2, 3, 4, 5, 6}. φ({4, 6}) = {1, 3, 4, 6}, φ({2, 4}) = X
Figure 1. Example 9
etc.
2
6
5
3
4
1
Figure 2. Example 16
Figure: A12
K.Adaricheva (Yeshiva University)
Ordered basis
Algebra and AI seminar
5 / 38
Closure spaces, lattices and implications
Closure spaces and implications
An implication σ on X :
σ-closed subset A of X :
Y → Z , for Y , Z ⊆ X , Z 6= ∅.
if Y ⊆ A, then Z ⊆ A.
Closure space hX , φΣ i defined by set Σ of implications on X : A is
closed, if it is σ-closed, for each σ ∈ Σ
Every closure space hX , φi can be presented as hX , ψΣ i, for some
set Σ of implications on X .
Example: Σ = {A → φ(A) : A ⊆ X , A 6= φ(A)}.
K.Adaricheva (Yeshiva University)
Ordered basis
Algebra and AI seminar
6 / 38
Propositional Horn logic
Implications and propositional Horn logic
Unit implication σ on X :
Y → z, Y ⊆ X , z ∈ X .
Every implication Y → Z is equivalent to the set of unit
implications {Y → z, z ∈ Z }: unit expansion.
Logical interpretation of unit implication σ:
X = {x1 , . . . , xn }, Y = {x1 , . . . , xk }, z = xk +1
σ ≡ x1 ∧ x2 · · · ∧ xk → xk +1 .
Equivalent form without implication (a definite Horn clause):
σ ≡ ¬x1 ∨ ¬x2 · · · ∨ ¬xk ∨ xk +1
Equivalent form for the set of implications Σ = {s1 , . . . , sm } (a
definite Horn formula):
V
ΣH ≡ s≤m σs
K.Adaricheva (Yeshiva University)
Ordered basis
Algebra and AI seminar
7 / 38
Propositional Horn logic
Summarizing:
Three equivalent ways to look at closure system hX , φi:
lattice of closed sets Cl(X , φ);
set of implications Σ(X , φ);
definite Horn formula ΣH (X , φ).
K.Adaricheva (Yeshiva University)
Ordered basis
Algebra and AI seminar
8 / 38
Connections to computer science field
Connections to computer science fields
Closure operators appear: relational data bases, data-mining,
knowledge structures, data analysis etc.
Horn formulas appear: logic programming.
K.Adaricheva (Yeshiva University)
Ordered basis
Algebra and AI seminar
9 / 38
Connections to computer science field
Logic programming
Horn fragment of propositional logic is a centerpiece of logic
programming:
Satisfiability problem H |= ψ can be solved in O(s(H ∪ ψ)), when
H is a Horn formula, ψ is an arbitrary clause; fast linear algorithm
is known as forward chaining.
Satisfiability problem S |= ψ is NP-complete, in general case.
K.Adaricheva (Yeshiva University)
Ordered basis
Algebra and AI seminar
10 / 38
Connections to computer science field
“Efficient" bases
Every closure space hX , φi can be presented as hX , ψΣ i, for some
set Σ of implications on X .
Example: Σ = {A → φ(A) : A ⊆ X , A 6= φ(A)}.
Term a base or a basis is used when the set of implications Σ0 that
defines the same closure system satisfies some condition of
minimality.
K.Adaricheva (Yeshiva University)
Ordered basis
Algebra and AI seminar
11 / 38
Connections to computer science field
“Efficient" bases
A basis Σ0 is minimum, if it has the minimal number of implications
among all the set of implications for the same closure system.
A basis Σ0 = {Xi → Yi : i ≤ n} is called optimum, if number
s(Σ0 ) = |X1 | + · · · + |Xn | + |Y1 | + · · · + |Yn | is smallest among all
sets of implications for the same closure system.
A basis is called minimum unit basis, if the number
|Y1 | + · · · + |Yn | is smallest among all sets of implications for the
same closure system.
The last form of the “efficient" basis is connected to the problem of
the shortest (i.e. with the minimal number of clauses)
CNF-representation of a Horn function, also, minimal
representations of the directed hypergraphs.
K.Adaricheva (Yeshiva University)
Ordered basis
Algebra and AI seminar
12 / 38
Canonical direct unit basis
K.Bertet-B.Monjardet
K.Bertet, B.Monjardet, The multiple facets of the canonical direct unit
implicational basis, Theoretical Computer Science 411 (2010),
2155-2166.
Given unit basis
S Σ and Y ⊂ X , define
πΣ (Y ) = Y ∪ {b : (A → b) ∈ Σ, A ⊆ Y }.
2 (Y ) ∪ π 3 (Y ) ∪ . . .
Then φΣ (Y ) = πΣ (Y ) ∪ πΣ
Σ
A unit implicational basis is called direct, if
φΣ (Y ) = πΣ (Y ), for all Y ⊆ X .
K.Adaricheva (Yeshiva University)
Ordered basis
Algebra and AI seminar
13 / 38
Canonical direct unit basis
Example
Take ΣC , the basis of 8 implications
for hJ(A
), φi:
1
2
3
4
5 12
2 → 1, 6 → 13, 3 → 1, 5 → 4, 14 → 3, 123 → 6, 1345 → 6, 12346 → 5.
Consider Y = {2, 4}.
Figure 1. Example 9
2
6
5
3
4
1
Figure 2. Example 16
Figure: A12
K.Adaricheva (Yeshiva University)
Ordered basis
Algebra and AI seminar
14 / 38
Canonical direct unit basis
Example: continued
Another set of implications Σ
for hJ(A
), φi:
12
1 U 2
3
4
5
2 → 1, 6 → 1, 6 → 3, 3 → 1, 5 → 4, 14 → 3, 24 → 3, 15 → 3,
23 → 6, 15 → 6, 25 → 6, 24 →Figure
5, 24
→ 6.
1. Example 9
2
6
5
3
4
1
Figure 2. Example 16
Figure: A12
K.Adaricheva (Yeshiva University)
Ordered basis
Algebra and AI seminar
15 / 38
Canonical direct unit basis
Types of direct bases
Various unit direct bases surveyed in B-M:
Left-minimal basis: D. Maier, The theory of relational databases,
1983
and T. Ibaraki, A. Kogan, K. Makino, Art. Intell. 1999;
Dependence relation basis: B. Monjardet, Math. Soc. Sci. 1990;
Canonical iteration-free basis: M. Wild, Adv. Math. 1994;
Weak-implication basis: A. Rusch and R. Wille, Data analysis and
Information systems, 1995;
Direct optimal basis: K. Bertet and M. Nebut, DMTCS 2004.
K.Adaricheva (Yeshiva University)
Ordered basis
Algebra and AI seminar
16 / 38
Canonical direct unit basis
Theorem on unity
Theorem (B-M, 2010). For every finite closure system (X , φ), its
left-minimal basis,
dependence relation basis,
canonical iteration-free basis,
direct optimal basis and
weak-implication basis
are the same.
K.Adaricheva (Yeshiva University)
Ordered basis
Algebra and AI seminar
17 / 38
Canonical direct unit basis
Minimality
Corollary. Canonical unit basis is
minimum
optimum
among all unit direct bases for closure system (X , φ), ordered by
inclusion.
K.Adaricheva (Yeshiva University)
Ordered basis
Algebra and AI seminar
18 / 38
Ordered direct basis
Ordered iteration
Suppose the set of implications Σ are put into some linear order:
Σ = hs1 , s2 , . . . , sn i.
A mapping ρΣ : P(X ) → P(X ) associated with this ordering is called an
ordered iteration of Σ:
For any Y ⊆ S, let Y0 = Y .
If Yk is computed and implication sk +1 is A → b, then
Yk ∪ {b}, if A ⊆ Yk ,
Yk +1 =
Yk ,
otherwise.
Finally, ρΣ (Y ) = Yn .
Such iteration is utilized in forward chaining algorithm in logic
programming.
K.Adaricheva (Yeshiva University)
Ordered basis
Algebra and AI seminar
19 / 38
Ordered direct basis
Example
Take ΣC , the set of implications for hJ(A12 ), φi, in its original order:
2 → 1, 6 → 13, 3 → 1, 5 → 4, 14 → 3, 123 → 6, 1345 → 6, 12346 → 5.
Consider Y = {2, 4}.
K.Adaricheva (Yeshiva University)
Ordered basis
Algebra and AI seminar
20 / 38
Ordered direct basis
Ordered direct basis
An implicational basis of hX , φi, together with its order: Σ = hs1 , . . . , sn i
is called ordered direct, if ρ(Y ) = φ(Y ), for every Y ⊆ X .
K.Adaricheva (Yeshiva University)
Ordered basis
Algebra and AI seminar
21 / 38
Ordered direct basis
Examples
Every direct basis is ordered direct, for arbitrary ordering.
Indeed, φ(Y ) = π(Y ) ⊆ ρ(Y ) ⊆ φ(Y ).
Basis ΣC for hJ(A12 ), φi is not direct, but it is ordered direct, in its
original order.
K.Adaricheva (Yeshiva University)
Ordered basis
Algebra and AI seminar
22 / 38
D-basis
D-basis
OD-graph of a finite lattice:
J.B.Nation An approach to lattice varieties of finite height, Algebra
Universalis 27 (1990), 521–543.
The full information about a finite lattice L can be compactly recorded
in
partially ordered set of join-irreducible elements hJ(L), ≤i;
the minimal join-covers of join-irreducible elements.
K.Adaricheva (Yeshiva University)
Ordered basis
Algebra and AI seminar
23 / 38
D-basis
Example
1
2
3
4
5
Figure 1. Example 9
2
6
5
3
4
1
Figure 2. Example 16
Figure: A12
For lattice A12 , the poset of join-irreducible elements is:
hJ(A12 ), ≤i = h{1, 2, 3, 4, 5, 6, }, 1 ≤ 2, 1 ≤ 3 ≤ 6, 4 ≤ 5i.
K.Adaricheva (Yeshiva University)
Ordered basis
Algebra and AI seminar
24 / 38
D-basis
Example:continued
A join-cover is an expression j ≤ j1 ∨ · · · ∨ jk , j 6≤ ji , i ≤ k , for some
join-irreducible elements j, j1 , . . . , jk .
For example, 6 ≤ 2 ∨ 5, A join-cover j ≤ j1 ∨ · · · ∨ jk is called minimal, if
none of j1 , . . . , jk can be replaced by smaller join-irreducibles or 0 to
obtain another join-cover.
2
3
4
5
For example, 3 ≤ 1 ∨ 4 is a 1minimal
cover.
6 ≤ 2 ∨ 5 is not minimal cover,
Figure 1. Example 9
5 ≤ 2 ∨ 4 ∨ 6 is not minimal cover,
2
6
5
3
4
1
K.Adaricheva (Yeshiva University)
Ordered
basis 16
Figure
2. Example
Algebra and AI seminar
25 / 38
D-basis
D-basis
Definition. Let hX , φi be a canonical closure system with L = Cl(X , φ).
The set of implications ΣD is called a D-basis of hX , φi, if it is made of
two parts:
{a → b : b ∈ φ({a})}; equivalently, b ≤ a in hJ(L), ≤i.
{j1 . . . jk → j : j ≤ j1 ∨ · · · ∨ jk is a minimal join cover in L}.
K.Adaricheva (Yeshiva University)
Ordered basis
Algebra and AI seminar
26 / 38
Main Theorem
Main Theorem
Theorem.
ΣD generates hX , φi, i.e., D-basis is indeed a basis of this closure
system.
ΣD is a subset of the canonical unit basis.
ΣD is an ordered direct basis, associated with any order, where
the binary part precedes the rest of implications.
K.Adaricheva (Yeshiva University)
Ordered basis
Algebra and AI seminar
27 / 38
Main Theorem
Algorithmic aspects
If Σ is a any unit direct basis of hX , φi of size S with m implications,
then
it takes time O(S 2 ) to extract D-basis from Σ;
it takes time O(m) to put extracted D-basis into a proper order.
K.Adaricheva (Yeshiva University)
Ordered basis
Algebra and AI seminar
28 / 38
Main Theorem
Comparison
Unit canonical basis ΣU for hJ(A12 ), φi has 13 implications.
2 → 1, 6 → 1, 6 → 3, 3 → 1, 5 → 4, 14 → 3, 24 → 3, 15 → 3,
23 → 6, 15 → 6, 25 → 6, 24 → 5, 24 → 6.
D-basis has 9 implications.
2 → 1, 6 → 3, 3 → 1, 5 → 4, 14 → 3, 23 → 6, 15 → 6, 24 → 5, 24 → 6.
ΣC , or canonical basis of Guiques-Duquenne, has 8 implications.
2 → 1, 6 → 13, 3 → 1, 5 → 4, 14 → 3, 123 → 6, 1345 → 6, 12346 → 5.
K.Adaricheva (Yeshiva University)
Ordered basis
Algebra and AI seminar
29 / 38
Canonical basis
Canonical basis
J.L. Guiques, V. Duquenne, Familles minimales d’implications
informatives résultant d’une tables de données binares, Math. Sci.
Hum. 95 (1986), 5–18.
Defined critical subsets of X for any given closure system hX , φi.
Canonical basis ΣC is {A → B : A is critical, B = φ(A) \ A}.
ΣC is the minimum basis among all the bases generating hX , φi.
K.Adaricheva (Yeshiva University)
Ordered basis
Algebra and AI seminar
30 / 38
Canonical basis
Computer testing
Proposition. There is no possibility, in general, to establish the order
on canonical basis that would turn it into ordered direct.
Example. Canonical basis of Guiques-Duquenne on 6-element set
that cannot be ordered:
4 → 1, 15 → 3, 35 → 1, 25 → 6, 56 → 2, 26 → 5, 36 → 14, 134 → 6,
146 → 3.
K.Adaricheva (Yeshiva University)
Ordered basis
Algebra and AI seminar
31 / 38
Canonical basis
Lattice of the counterexample
4
1
2
3
5
6
Figure 1. Example 67
Figure: Lattice for D-G non-orderable
K.Adaricheva (Yeshiva University)
Ordered basis
Algebra and AI seminar
32 / 38
Three bases comparison
Three bases comparison
60
Implications Checked
50
40
30
20
10
0
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
Number of Closed Sets
G-D Unit Basis
K.Adaricheva (Yeshiva University)
Direct Optimal Basis
Ordered basis
D-Basis
Algebra and AI seminar
33 / 38
Three bases comparison
More results are obtained this summer ...
further optimizations of D-basis;
extension of the idea of ordered basis to the ordered sequence
produced from the set of implications;
comparison of existing forward chaining algorithm with ordered
direct basis algorithm.
K.Adaricheva (Yeshiva University)
Ordered basis
Algebra and AI seminar
34 / 38
Three bases comparison
What will be in JB’s talk (maybe?)
Finding the canonical (minimum) D-G basis from any given Σ is
efficient as O(s(Σ)2 ).
Finding optimum basis or minimum unit basis is NP-complete in
general.
Still, in some classes of closure systems this can be solved
effectively: M.Wild finds polynomial algorithm for the optimum
basis in closure systems with modular closure lattice.
Can it be done in other classes of closure systems?
K.Adaricheva (Yeshiva University)
Ordered basis
Algebra and AI seminar
35 / 38
Three bases comparison
The last slide
This is the work in progress:
Exploring types of bases that are not necessarily minimal or
optimal, but pretty short and efficiently produced.
The idea works best in the class of closure systems with
join-semidistributive lattice of closed sets. This class includes
convex geometries and lower bounded lattices.
In lower bounded lattices we can polynomially produce the
ordered direct basis whose size is smaller than D-G canonical.
Paradoxically, the optimum basis there is still NP-complete
problem.
producing the D-basis from any given in a decent algorithm (say,
polynomial in size of the output) is still an open problem.
K.Adaricheva (Yeshiva University)
Ordered basis
Algebra and AI seminar
36 / 38
Three bases comparison
Regards from Yeshiva College, New York
Figure: Yeshiva college graduating students, 2011
K.Adaricheva (Yeshiva University)
Ordered basis
Algebra and AI seminar
37 / 38
Three bases comparison
Regards from across America: New York-Hawai’i
Figure: Hiking in Catskill mountains, New York State
K.Adaricheva (Yeshiva University)
Ordered basis
Algebra and AI seminar
38 / 38