use crate::Primitives;
pub trait Partition<P: Primitives> {
type IrreducibleSet: IrreducibleSet<P>;
fn irreducibles(&self) -> &Self::IrreducibleSet;
type ReducibleSet: ReducibleSet<P>;
fn reducibles(&self) -> &Self::ReducibleSet;
type UnitGroup: UnitGroup<P>;
fn units(&self) -> &Self::UnitGroup;
type Complement: Complement<P>;
fn exterior(&self) -> &Self::Complement;
fn density(&self) -> P::Decimal;
type TypeDefinition: crate::user::type_::TypeDefinition<P>;
fn source_type(&self) -> &Self::TypeDefinition;
fn witt_length(&self) -> P::PositiveInteger;
type FreeRank: FreeRank<P>;
fn site_budget(&self) -> &Self::FreeRank;
fn is_exhaustive(&self) -> P::Boolean;
}
pub trait Component<P: Primitives> {
type Datum: crate::kernel::schema::Datum<P>;
fn member(&self) -> &[Self::Datum];
fn cardinality(&self) -> P::NonNegativeInteger;
}
pub trait IrreducibleSet<P: Primitives>: Component<P> {}
pub trait ReducibleSet<P: Primitives>: Component<P> {}
pub trait UnitGroup<P: Primitives>: Component<P> {}
pub trait Complement<P: Primitives>: Component<P> {
type TermExpression: crate::kernel::schema::TermExpression<P>;
fn exterior_criteria(&self) -> &Self::TermExpression;
}
pub trait SiteIndex<P: Primitives> {
fn site_position(&self) -> P::NonNegativeInteger;
fn site_state(&self) -> P::NonNegativeInteger;
type SiteIndexTarget: SiteIndex<P>;
fn ancilla_site(&self) -> &Self::SiteIndexTarget;
}
pub trait FreeRank<P: Primitives> {
fn total_sites(&self) -> P::NonNegativeInteger;
fn pinned_count(&self) -> P::NonNegativeInteger;
fn free_rank(&self) -> P::NonNegativeInteger;
fn is_closed(&self) -> P::Boolean;
type SiteIndex: SiteIndex<P>;
fn has_site(&self) -> &[Self::SiteIndex];
type SiteBinding: SiteBinding<P>;
fn has_binding(&self) -> &[Self::SiteBinding];
fn reversible_strategy(&self) -> P::Boolean;
}
pub trait SiteBinding<P: Primitives> {
type Constraint: crate::user::type_::Constraint<P>;
fn pinned_by(&self) -> &Self::Constraint;
type SiteIndex: SiteIndex<P>;
fn pins_coordinate(&self) -> &Self::SiteIndex;
}
pub trait PartitionProduct<P: Primitives> {
type Partition: Partition<P>;
fn left_factor(&self) -> &Self::Partition;
fn right_factor(&self) -> &Self::Partition;
}
pub trait PartitionCoproduct<P: Primitives> {
type Partition: Partition<P>;
fn left_summand(&self) -> &Self::Partition;
fn right_summand(&self) -> &Self::Partition;
}