yield_concepts_simple.lp 591 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
% Generate formal concepts mined in an input context.
%
% This is one method. For more methods,
%  reach https://github.com/aluriak/concept-generation
%
% 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)


% Generate the concept.
ext(X):- rel(X,_) ; rel(X,Y): int(Y).
int(Y):- rel(_,Y) ; rel(X,Y): ext(X).

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