# diracdeltafunk/smallcategories architecture

> Architecture diagram of the GitHub repository diracdeltafunk/smallcategories, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/diracdeltafunk/smallcategories
- Repository: https://github.com/diracdeltafunk/smallcategories

## Overview

SmallCategories is a Rust tool and data repository for enumerating isomorphism classes of small finite categories. A user requests morphism/object-size cells; the generator resolves smaller-cell dependencies, searches connected categories by shape, reconstructs disconnected categories from stored components, and writes multiplication tables plus proposition masks. Separate verification canonicalizes stored tables and can compare databases by isomorphism class. The graph follows README-described orchestration and the sampled Rust modules; the CLI implementation itself was not sampled.

Main entry points: [`smallcats/src/cell.rs`](https://github.com/diracdeltafunk/smallcategories/blob/master/smallcats/src/cell.rs) (Cell planning), [`smallcats/src/io.rs`](https://github.com/diracdeltafunk/smallcategories/blob/master/smallcats/src/io.rs) (Database verification), [`smallcats/src/search.rs`](https://github.com/diracdeltafunk/smallcategories/blob/master/smallcats/src/search.rs) (Table search), [`smallcats/src/propositions.rs`](https://github.com/diracdeltafunk/smallcategories/blob/master/smallcats/src/propositions.rs) (Category properties)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Generation workflow"]
  node_generator["Generator API<br/>[lib.rs]"]
  node_planner["Cell planning<br/>[cell.rs]"]
end

subgraph group_enumeration["Category enumeration"]
  node_connected["Connected search<br/>[cell.rs]"]
  node_shapes["Shape enumeration<br/>[shape.rs]"]
  node_tablesearch["Table search<br/>[search.rs]"]
  node_tablemodel["Table model<br/>[table.rs]"]
  node_assembly["Component assembly<br/>[components.rs]"]
end

subgraph group_data["Database and properties"]
  node_database[("Cell database")]
  node_tableio["Compressed cell I/O<br/>[io.rs]"]
  node_properties["Category properties<br/>[propositions.rs]"]
  node_propertyfiles[("Property masks")]
end

subgraph group_validation["Verification"]
  node_verifier["Database verification<br/>[io.rs]"]
  node_canonical["Canonicalization<br/>[canonical.rs]"]
end

node_user(("User"))

node_user -->|"requests cells"| node_generator
node_generator -->|"plans dependencies"| node_planner
node_planner -->|"builds connected"| node_connected
node_connected -->|"enumerates shapes"| node_shapes
node_connected -->|"searches shapes"| node_tablesearch
node_tablesearch -->|"uses shape domains"| node_shapes
node_tablesearch -.->|"builds tables"| node_tablemodel
node_planner -->|"reconstructs components"| node_assembly
node_assembly -->|"reads smaller cells"| node_database
node_planner -->|"writes cell files"| node_tableio
node_tableio -->|"stores tables"| node_database
node_planner -->|"computes masks"| node_properties
node_properties -->|"derives from table"| node_tablemodel
node_planner -->|"writes masks"| node_tableio
node_tableio -->|"stores masks"| node_propertyfiles
node_user -->|"requests verification"| node_verifier
node_verifier -->|"reads stored tables"| node_database
node_verifier -->|"checks isomorphism"| node_canonical
node_verifier -->|"recomputes masks"| node_properties

click node_generator "https://github.com/diracdeltafunk/smallcategories/blob/master/smallcats/src/lib.rs"
click node_planner "https://github.com/diracdeltafunk/smallcategories/blob/master/smallcats/src/cell.rs"
click node_connected "https://github.com/diracdeltafunk/smallcategories/blob/master/smallcats/src/cell.rs"
click node_shapes "https://github.com/diracdeltafunk/smallcategories/blob/master/smallcats/src/shape.rs"
click node_tablesearch "https://github.com/diracdeltafunk/smallcategories/blob/master/smallcats/src/search.rs"
click node_tablemodel "https://github.com/diracdeltafunk/smallcategories/blob/master/smallcats/src/table.rs"
click node_assembly "https://github.com/diracdeltafunk/smallcategories/blob/master/smallcats/src/components.rs"
click node_database "https://github.com/diracdeltafunk/smallcategories/tree/master/database"
click node_tableio "https://github.com/diracdeltafunk/smallcategories/blob/master/smallcats/src/io.rs"
click node_properties "https://github.com/diracdeltafunk/smallcategories/blob/master/smallcats/src/propositions.rs"
click node_propertyfiles "https://github.com/diracdeltafunk/smallcategories/tree/master/database"
click node_verifier "https://github.com/diracdeltafunk/smallcategories/blob/master/smallcats/src/io.rs"
click node_canonical "https://github.com/diracdeltafunk/smallcategories/blob/master/smallcats/src/canonical.rs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_generator,node_planner,node_user toneBlue
class node_connected,node_shapes,node_tablesearch,node_tablemodel,node_assembly toneAmber
class node_database,node_tableio,node_properties,node_propertyfiles toneMint
class node_verifier,node_canonical toneRose
```

## Components

### Generation workflow

- [Generator API](https://github.com/diracdeltafunk/smallcategories/blob/master/smallcats/src/lib.rs): `smallcats/src/lib.rs`
- [Cell planning](https://github.com/diracdeltafunk/smallcategories/blob/master/smallcats/src/cell.rs): `smallcats/src/cell.rs`

### Category enumeration

- [Connected search](https://github.com/diracdeltafunk/smallcategories/blob/master/smallcats/src/cell.rs): `smallcats/src/cell.rs`
- [Shape enumeration](https://github.com/diracdeltafunk/smallcategories/blob/master/smallcats/src/shape.rs): `smallcats/src/shape.rs`
- [Table search](https://github.com/diracdeltafunk/smallcategories/blob/master/smallcats/src/search.rs): `smallcats/src/search.rs`
- [Table model](https://github.com/diracdeltafunk/smallcategories/blob/master/smallcats/src/table.rs): `smallcats/src/table.rs`
- [Component assembly](https://github.com/diracdeltafunk/smallcategories/blob/master/smallcats/src/components.rs): `smallcats/src/components.rs`

### Database and properties

- [Cell database](https://github.com/diracdeltafunk/smallcategories/tree/master/database): `database`
- [Compressed cell I/O](https://github.com/diracdeltafunk/smallcategories/blob/master/smallcats/src/io.rs): `smallcats/src/io.rs`
- [Category properties](https://github.com/diracdeltafunk/smallcategories/blob/master/smallcats/src/propositions.rs): `smallcats/src/propositions.rs`
- [Property masks](https://github.com/diracdeltafunk/smallcategories/tree/master/database): `database`

### Verification

- [Database verification](https://github.com/diracdeltafunk/smallcategories/blob/master/smallcats/src/io.rs): `smallcats/src/io.rs`
- [Canonicalization](https://github.com/diracdeltafunk/smallcategories/blob/master/smallcats/src/canonical.rs): `smallcats/src/canonical.rs`

### Other components

- **User**

## Connections

- User → Generator API: requests cells (evidence: `Readme.md`)
- Generator API → Cell planning: plans dependencies (evidence: `Readme.md`)
- Cell planning → Connected search: builds connected (evidence: `smallcats/src/cell.rs`)
- Connected search → Shape enumeration: enumerates shapes (evidence: `smallcats/src/cell.rs`)
- Connected search → Table search: searches shapes (evidence: `smallcats/src/cell.rs`)
- Table search → Shape enumeration: uses shape domains (evidence: `smallcats/src/search.rs`)
- Table search → Table model: builds tables
- Cell planning → Component assembly: reconstructs components (evidence: `Readme.md`)
- Component assembly → Cell database: reads smaller cells (evidence: `smallcats/src/components.rs`)
- Cell planning → Compressed cell I/O: writes cell files (evidence: `Readme.md`)
- Compressed cell I/O → Cell database: stores tables (evidence: `Readme.md`)
- Cell planning → Category properties: computes masks (evidence: `Readme.md`)
- Category properties → Table model: derives from table (evidence: `smallcats/src/propositions.rs`)
- Cell planning → Compressed cell I/O: writes masks (evidence: `Readme.md`)
- Compressed cell I/O → Property masks: stores masks (evidence: `Readme.md`)
- User → Database verification: requests verification (evidence: `Readme.md`)
- Database verification → Cell database: reads stored tables (evidence: `Readme.md`)
- Database verification → Canonicalization: checks isomorphism (evidence: `Readme.md`)
- Database verification → Category properties: recomputes masks (evidence: `Readme.md`)
