genhdc 0.1.0

Hyperdimensional Computing (HDC/VSA) engine with genetic operators — extracted from the production Mimer agent
Documentation
//! # GenHDC — Genetic Hyperdimensional Computing
//!
//! GenHDC is a Rust crate for **Hyperdimensional Computing (HDC) / Vector
//! Symbolic Architectures (VSA)** plus **genetic operators** on concept
//! genomes.
//!
//! The HDC engine (`HdcEngine`) was **extracted from Mimer**, a continuously
//! running production Rust agent. It provides 10 000-dimensional bipolar
//! vectors with bind, bundle, unbind, and permutation.
//!
//! The genetic layer (`ConceptGenome`) adds inheritance, mutation,
//! CRISPR-like targeted editing, and epigenetic expression — sitting on top
//! of any HDC representation.
//!
//! ## Quick start (HDC)
//!
//! ```rust
//! use genhdc::{HdcEngine, DIMENSIONS};
//!
//! let mut hdc = HdcEngine::with_seed(DIMENSIONS, 42);
//! let a = hdc.encode("apple");
//! let b = hdc.encode("color");
//! let bound = hdc.bind(&a, &b);
//! let recovered = hdc.unbind(&bound, &b);
//! assert!(hdc.similarity(&recovered, &a) > 0.9);
//! ```
//!
//! ## Quick start (genetic layer)
//!
//! ```rust
//! use genhdc::ConceptGenome;
//!
//! let apple = ConceptGenome::primordial("apple", 0);
//! let snake = ConceptGenome::primordial("snake", 0);
//! let eats = ConceptGenome::inherit(&snake, &apple, "eats", 1);
//! assert_eq!(eats.generation, 1);
//! ```

pub mod genome;
pub mod hdc;
pub mod seeds;

pub use genome::{ConceptGenome, GenomeFeature};
pub use hdc::{
    is_hdc_sentinel, is_vocab_rejected, pack_bipolar, unpack_bipolar, vocab_reject_reason,
    vocab_rejected_totals, HdcEngine, VocabRejectReason, VocabRejectTotals, DIMENSIONS,
};