yield_object_oriented_concepts.lp 871 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
% Generate object-oriented formal concepts mined in an input context.
%
% INPUT:
%   - rel(X,Y):- object X is in relation with attribute Y.
% CONST:
%   - allow_non_concept: set it to ¬0 to get also the infinum and supremum.
% OUTPUT (one model == one concept):
%   - ext(X):- X is an object of the concept (extent)
%   - int(Y):- Y is an attribute of the concept (intent)
#const allow_non_concept=0.

% Generate the object-oriented concepts.
ext(X):- rel(X,Y) ; int(Y).                      % object is linked to any attribute.
not_ext(Nx):- rel(Nx,_) ; not ext(Nx).           % object is either in extent or not.
int(Y):- rel(_,Y) ; not rel(Nx,Y): not_ext(Nx).  % attribute is only linked to objects in extent.

% Avoid non-concept (no object or no attribute)
:- not ext(_) ; allow_non_concept=0.
:- not int(_) ; allow_non_concept=0.

#show.
#show ext/1.
#show int/1.