Skip to main content

Crate odis

Crate odis 

Source
Expand description

§odis — Formal Concept Analysis in Rust

odis is a library for Formal Concept Analysis. It operates on formal contexts (objects × attributes incidence tables) and provides concept enumeration, implication bases, lattice drawing, and attribute exploration.

§Quick start

use odis::{FormalContext, algorithms::NextClosure};
use odis::traits::ConceptEnumerator;

// Burmeister (.cxt) format: 2 objects, 2 attributes
let bytes = b"B\n\n2\n2\n\nbird\nfish\nflies\nlives_in_water\nX.\n.X\n";
let ctx = FormalContext::<String>::from(bytes).unwrap();

let concepts: Vec<_> = NextClosure.enumerate_concepts(&ctx).collect();
assert_eq!(concepts.len(), 4); // ∅, {bird}, {fish}, {bird, fish}

§Modules

§Key types

  • FormalContext — objects, attributes, incidence relation
  • Lattice / Poset — concept lattice and partially ordered set
  • Drawing — 2-D coordinate output from a layout algorithm
  • IcebergLattice — concept lattice filtered by minimum support

Re-exports§

pub use traits::ConceptEnumerator;
pub use traits::DrawingAlgorithm;
pub use traits::IcebergConceptEnumerator;
pub use traits::ImplicationEngine;

Modules§

algorithms
Algorithms for Formal Concept Analysis.
traits
Traits for the algorithm types in crate::algorithms.

Structs§

DiNode
A node in a directed graph.
Digraph
A directed graph.
Drawing
A positional layout: maps each node (by Vec index) to a 2D coordinate.
FormalContext
Formal context: a set of objects, a set of attributes, and a binary incidence relation. Operations (extent, intent, closure) are available in labelled form (on T values) and index-based form (on bit_set::BitSet indices).
IcebergLattice
An iceberg concept lattice: a concept lattice restricted to concepts whose extent size (support) meets a minimum threshold.
Lattice
A complete lattice: a poset with a unique top (⊤) and bottom (⊥) element, closed under binary join (∨) and meet (∧).
Poset
A partially ordered set (poset).

Enums§

FormatError
Error returned when parsing a formal context from bytes fails.
PosetError
Error returned when constructing a Poset from invalid input.