Skip to main content

module analysis::formalconcepts::FCA

rascal-Not specified

Library for Formal Concept Analysis

Usage​

import analysis::formalconcepts::FCA;

Dependencies​

import Set;
import Map;
import Relation;
import lang::dot::Dot;

Description​

Formal Concept Analysis is a somewhat ubiquitous tool in software analysis projects. It can be used to find latent groups of objects that share the same attributes in a dataset. Typically, we apply FCA to a relation rel[&O objects, &A attributes], which represents extracted source code artifacts and their attributes.

alias FormalContext​

rel[&Object, &Attribute]

alias Concept​

tuple[set[&Object] objects, set[&Attribute] attributes]

alias ConceptLattice​

rel[Concept[&Object, &Attribute], Concept[&Object, &Attribute]]

alias Object2Attributes​

map[&Object, set[&Attribute]]

alias Attribute2Objects​

map[&Attribute, set[&Object]]

function fca​

Computes Concept Lattice given the Object Attribute Relation.

ConceptLattice[&Object, &Attribute] fca (FormalContext[&Object, &Attribute] fc)

function toDot​

Computes Dot Graph from Concept Lattice.

DotGraph toDot(ConceptLattice[&Object, &Attribute] cl)

DotGraph toDot(ConceptLattice[&Object, &Attribute] cl, bool lab)

function toDotline​

Dotline toDotline(ConceptLattice[&Object, &Attribute] cl)

function toOutline​

Outline toOutline(ConceptLattice[&Object, &Attribute] cl)

function toFormalContext​

FormalContext[&Object, &Attribute] toFormalContext(Object2Attributes[&Object, &Attribute] objects)

FormalContext[&Object, &Attribute] toFormalContext(Attribute2Objects[&Object, &Attribute] attributes)

function intersection​

set[&T] intersection(set[set[&T]] st)

function union​

set[&T] union(set[set[&T]] st)

function isSubset​

bool isSubset(set[set[&T]] candidate, set[&T] s )

function sigma​

set[&Attribute] sigma(FormalContext[&Object, &Attribute] fc, set[&Object] objects)

function tau​

set[&Object] tau(FormalContext[&Object, &Attribute] fc, set[&Attributes] attributes)

function maxincl​

set[set[&T]] maxincl(set[set[&T]] c)

function createAttributeLattice​

rel[set[&Attribute], set[&Attribute]] createAttributeLattice(FormalContext[&Object, &Attribute] fc)

function makeNodes​

map[Concept[&Object, &Attribute], int] makeNodes(ConceptLattice[&Object, &Attribute] q)

function addConcept​

set[&Attribute] addConcept(ConceptLattice[&Object, &Attribute] q,  Concept[&Object, &Attribute] c)

function compose​

Stm compose(Concept[&Object, &Attribute] c, map[Concept[&Object, &Attribute], int] z, bool lab)

function toDotString​

Write relation in .dot format.

str toDotString(ConceptLattice[&Object, &Attribute]  q)