Skip to content

Latest commit

 

History

History
78 lines (59 loc) · 3.72 KB

Concept-Lattices.org

File metadata and controls

78 lines (59 loc) · 3.72 KB

Concept Lattices in fca-clj

fca-clj provides functionality to compute the concept lattice of a formal context, render it, and perform some operations on it.

Computing Formal Concepts

To compute the concepts of a formal context, the concepts function is available:

java -jar builds/uberjar/fca-clj-0.1.0-SNAPSHOT-standalone.jar -f concepts testing-data/bodiesofwater.ctx
([#{river stream reservoir puddle sea lagoon rivulet maar pond runnel tarn canal pool trickle channel lake torrent} #{}] 
[#{river stream rivulet runnel canal trickle channel torrent} #{running constant}] 
[#{} #{running maritime constant natural stagnant}] 
[#{river stream rivulet runnel trickle torrent} #{running constant natural}] 
[#{sea lagoon} #{maritime constant natural stagnant}] 
[#{river stream reservoir sea lagoon rivulet maar pond runnel tarn canal pool trickle channel lake torrent} #{constant}] 
[#{river stream sea lagoon rivulet maar pond runnel tarn pool trickle lake torrent} #{constant natural}] 
[#{sea lagoon maar pond tarn pool lake} #{constant natural stagnant}] 
[#{reservoir sea lagoon maar pond tarn pool lake} #{constant stagnant}] 
[#{river stream puddle sea lagoon rivulet maar pond runnel tarn pool trickle lake torrent} #{natural}] 
[#{puddle sea lagoon maar pond tarn pool lake} #{natural stagnant}] 
[#{reservoir puddle sea lagoon maar pond tarn pool lake} #{stagnant}])

To save the corresponding concept lattice, call the concept-lattice function:

java -jar builds/uberjar/fca-clj-0.1.0-SNAPSHOT-standalone.jar -f concept-lattice testing-data/bodiesofwater.ctx lattice.json

This lattice can be drawn using the draw-context-lattice method:

java -jar builds/uberjar/fca-clj-0.1.0-SNAPSHOT-standalone.jar -f draw-lattice lattice.json

./images/lattice.png

Alternatively, the lattice can be drawn from the context directly:

java -jar builds/uberjar/fca-clj-0.1.0-SNAPSHOT-standalone.jar -f draw-context-lattice testing-data/bodiesofwater.ctx

Linear extensions

A linear extension of a concept lattice is linear order of all elements such that the partial order of the lattice is not violated. Each lattice has at least one linear extension. The function minimals-plus allows to sample from the set of all linear extensions given the concept lattice and the number of samples.

java -jar builds/uberjar/fca-clj-0.1.0-SNAPSHOT-standalone.jar -f minimals-plus lattice.json 1
([[#{} #{running maritime constant natural stagnant}] 
[#{river stream rivulet runnel trickle torrent} #{running constant natural}] 
[#{sea lagoon} #{maritime constant natural stagnant}] 
[#{river stream rivulet runnel canal trickle channel torrent} #{running constant}] 
[#{sea lagoon maar pond tarn pool lake} #{constant natural stagnant}] 
[#{puddle sea lagoon maar pond tarn pool lake} #{natural stagnant}] 
[#{river stream sea lagoon rivulet maar pond runnel tarn pool trickle lake torrent} #{constant natural}] 
[#{reservoir sea lagoon maar pond tarn pool lake} #{constant stagnant}] 
[#{river stream puddle sea lagoon rivulet maar pond runnel tarn pool trickle lake torrent} #{natural}] 
[#{reservoir puddle sea lagoon maar pond tarn pool lake} #{stagnant}] 
[#{river stream reservoir sea lagoon rivulet maar pond runnel tarn canal pool trickle channel lake torrent} #{constant}] 
[#{river stream reservoir puddle sea lagoon rivulet maar pond runnel tarn canal pool trickle channel lake torrent} #{}]])