uor-foundation 0.2.0

UOR Foundation — typed Rust traits for the complete ontology. Import and implement.
Documentation
// @generated by uor-crate from uor-ontology — do not edit manually

//! `operad/` namespace — Structural type nesting via operad composition. Governs how types compose: Table(Tuple(Sequence(Symbol(...))))..
//!
//! Space: Kernel

use crate::Primitives;

/// The composition structure on the eight structural types. Governs how types nest.
pub trait StructuralOperad<P: Primitives> {
    /// Associated type for `StructuralOperad`.
    type StructuralOperadTarget: StructuralOperad<P>;
    /// The structural operad defining this composition.
    fn operad_structure(&self) -> &Self::StructuralOperadTarget;
}

/// A specific nesting: outer type F applied to inner type G.
pub trait OperadComposition<P: Primitives> {
    /// Associated type for `TypeDefinition`.
    type TypeDefinition: crate::user::type_::TypeDefinition<P>;
    /// The outer type F in the nesting F(G).
    fn outer_type(&self) -> &Self::TypeDefinition;
    /// The inner type G in the nesting F(G).
    fn inner_type(&self) -> &Self::TypeDefinition;
    /// The resulting composed type F(G).
    fn composed_type(&self) -> &Self::TypeDefinition;
    /// Site count of the composed type F(G).
    fn composed_site_count(&self) -> P::NonNegativeInteger;
    /// Associated type for `GroundingMap`.
    type GroundingMap: crate::user::morphism::GroundingMap<P>;
    /// Grounding of the composed type F(G).
    fn composed_grounding(&self) -> &Self::GroundingMap;
}