use crate::enums::AchievabilityStatus;
use crate::enums::MeasurementUnit;
use crate::enums::PhaseBoundaryType;
use crate::enums::WittLevel;
use crate::Primitives;
pub trait Observable<P: Primitives> {
fn value(&self) -> P::Decimal;
fn source(&self) -> &P::String;
fn target(&self) -> &P::String;
fn has_unit(&self) -> MeasurementUnit;
}
pub trait StratumObservable<P: Primitives>: Observable<P> {}
pub trait MetricObservable<P: Primitives>: Observable<P> {}
pub trait PathObservable<P: Primitives>: Observable<P> {}
pub trait ReductionObservable<P: Primitives>: Observable<P> {}
pub trait CatastropheObservable<P: Primitives>: Observable<P> {
fn phase_n(&self) -> P::PositiveInteger;
fn phase_g(&self) -> P::PositiveInteger;
fn on_resonance_line(&self) -> P::Boolean;
fn phase_boundary_type(&self) -> PhaseBoundaryType;
}
pub trait CurvatureObservable<P: Primitives>: Observable<P> {}
pub trait HolonomyObservable<P: Primitives>: Observable<P> {}
pub trait RingMetric<P: Primitives>: MetricObservable<P> {}
pub trait HammingMetric<P: Primitives>: MetricObservable<P> {}
pub trait IncompatibilityMetric<P: Primitives>: MetricObservable<P> {}
pub trait StratumValue<P: Primitives>: StratumObservable<P> {}
pub trait StratumDelta<P: Primitives>: StratumObservable<P> {}
pub trait StratumTrajectory<P: Primitives>: StratumObservable<P> {}
pub trait PathLength<P: Primitives>: PathObservable<P> {}
pub trait TotalVariation<P: Primitives>: PathObservable<P> {}
pub trait WindingNumber<P: Primitives>: PathObservable<P> {}
pub trait ReductionLength<P: Primitives>: ReductionObservable<P> {}
pub trait ReductionCount<P: Primitives>: ReductionObservable<P> {}
pub trait CatastropheThreshold<P: Primitives>: CatastropheObservable<P> {}
pub trait CatastropheCount<P: Primitives>: CatastropheObservable<P> {}
pub trait Commutator<P: Primitives>: CurvatureObservable<P> {}
pub trait CurvatureFlux<P: Primitives>: CurvatureObservable<P> {}
pub trait Monodromy<P: Primitives>: HolonomyObservable<P> {
type ClosedConstraintPath: ClosedConstraintPath<P>;
fn monodromy_loop(&self) -> &Self::ClosedConstraintPath;
type DihedralElement: DihedralElement<P>;
fn monodromy_element(&self) -> &Self::DihedralElement;
fn is_trivial_monodromy(&self) -> P::Boolean;
}
pub trait ParallelTransport<P: Primitives>: HolonomyObservable<P> {}
pub trait DihedralElement<P: Primitives>: HolonomyObservable<P> {
type Operation: crate::kernel::op::Operation<P>;
fn dihedral_element_value(&self) -> &[Self::Operation];
fn is_identity_element(&self) -> P::Boolean;
fn element_order(&self) -> P::PositiveInteger;
fn rotation_exponent(&self) -> P::NonNegativeInteger;
fn reflection_bit(&self) -> P::Boolean;
}
pub trait Jacobian<P: Primitives>: CurvatureObservable<P> {
fn site_position(&self) -> P::NonNegativeInteger;
fn derivative_value(&self) -> P::Decimal;
}
pub trait TopologicalObservable<P: Primitives>: Observable<P> {
fn dimension(&self) -> P::NonNegativeInteger;
}
pub trait BettiNumber<P: Primitives>: TopologicalObservable<P> {}
pub trait SpectralGap<P: Primitives>: TopologicalObservable<P> {}
pub trait ThermoObservable<P: Primitives>: Observable<P> {
fn hardness_estimate(&self) -> P::Decimal;
}
pub trait ResidualEntropy<P: Primitives>: ThermoObservable<P> {}
pub trait LandauerCost<P: Primitives>: ThermoObservable<P> {}
pub trait ReductionEntropy<P: Primitives>: ThermoObservable<P> {}
pub trait SynthesisSignature<P: Primitives> {
fn realised_euler(&self) -> P::Integer;
fn realised_betti(&self) -> &[P::NonNegativeInteger];
fn achievability_status(&self) -> AchievabilityStatus;
fn is_achievable(&self) -> P::Boolean;
fn is_forbidden(&self) -> P::Boolean;
type Proof: crate::bridge::proof::Proof<P>;
fn achievability_witness(&self) -> &Self::Proof;
}
pub trait SpectralSequencePage<P: Primitives> {
fn page_index(&self) -> P::NonNegativeInteger;
fn differential_is_zero(&self) -> P::Boolean;
fn converged_at(&self) -> P::NonNegativeInteger;
type PostnikovTruncation: crate::bridge::homology::PostnikovTruncation<P>;
fn postnikov_truncation(&self) -> &Self::PostnikovTruncation;
}
pub trait LiftObstructionClass<P: Primitives> {
type CohomologyGroup: crate::bridge::cohomology::CohomologyGroup<P>;
fn obstruction_class(&self) -> &Self::CohomologyGroup;
}
pub trait MonodromyClass<P: Primitives> {}
pub trait HolonomyGroup<P: Primitives> {
type DihedralElement: DihedralElement<P>;
fn holonomy_group(&self) -> &[Self::DihedralElement];
fn holonomy_group_order(&self) -> P::PositiveInteger;
}
pub trait ClosedConstraintPath<P: Primitives> {
fn path_length(&self) -> P::NonNegativeInteger;
type Constraint: crate::user::type_::Constraint<P>;
fn path_constraints(&self) -> &[Self::Constraint];
}
pub trait HomotopyGroup<P: Primitives> {
fn homotopy_dimension(&self) -> P::NonNegativeInteger;
fn homotopy_rank(&self) -> P::NonNegativeInteger;
type Constraint: crate::user::type_::Constraint<P>;
fn homotopy_basepoint(&self) -> &Self::Constraint;
}
pub trait HigherMonodromy<P: Primitives> {
fn higher_monodromy_dimension(&self) -> P::NonNegativeInteger;
}
pub trait WhiteheadProduct<P: Primitives> {
fn whitehead_trivial(&self) -> P::Boolean;
}
pub trait StratificationRecord<P: Primitives> {
fn stratification_level(&self) -> WittLevel;
type HolonomyStratum: crate::user::type_::HolonomyStratum<P>;
fn stratification_stratum(&self) -> &[Self::HolonomyStratum];
}
pub trait BaseMetric<P: Primitives>: Observable<P> {
fn metric_domain(&self) -> &P::String;
fn metric_range(&self) -> &P::String;
type TermExpression: crate::kernel::schema::TermExpression<P>;
fn metric_composition(&self) -> &Self::TermExpression;
type Observable: Observable<P>;
fn references_class(&self) -> &Self::Observable;
type Identity: crate::kernel::op::Identity<P>;
fn references_identity(&self) -> &Self::Identity;
fn metric_unit(&self) -> MeasurementUnit;
fn metric_precision(&self) -> P::NonNegativeInteger;
fn metric_monotonicity(&self) -> &Self::TermExpression;
fn metric_decomposition(&self) -> &Self::TermExpression;
fn metric_tower_position(&self) -> P::NonNegativeInteger;
fn metric_computation_cost(&self) -> &Self::TermExpression;
fn metric_bound(&self) -> &Self::TermExpression;
}
pub trait GroundingObservable<P: Primitives>: Observable<P> {
fn saturation_numerator(&self) -> P::NonNegativeInteger;
fn saturation_denominator(&self) -> P::PositiveInteger;
}
pub trait EulerCharacteristicObservable<P: Primitives>: Observable<P> {
type TermExpression: crate::kernel::schema::TermExpression<P>;
fn alternating_sum(&self) -> &Self::TermExpression;
}
pub mod bits {}
pub mod ring_steps {}
pub mod dimensionless {}
pub mod nats {}
pub mod period_boundary {}
pub mod power_of_two_boundary {}
pub mod achievable {}
pub mod forbidden {}
pub mod d_delta_metric {
pub const METRIC_DOMAIN: &str = "pair of ring elements";
pub const METRIC_RANGE: &str = "non-negative integer";
pub const REFERENCES_CLASS: &str = "https://uor.foundation/observable/IncompatibilityMetric";
}
pub mod sigma_metric {
pub const METRIC_DOMAIN: &str = "computation state";
pub const METRIC_RANGE: &str = "decimal in [0, 1]";
pub const REFERENCES_IDENTITY: &str = "https://uor.foundation/op/GS_2";
}
pub mod jacobian_metric {
pub const METRIC_DOMAIN: &str = "computation state × site index";
pub const METRIC_RANGE: &str = "decimal";
pub const REFERENCES_CLASS: &str = "https://uor.foundation/observable/Jacobian";
pub const REFERENCES_IDENTITY: &str = "https://uor.foundation/op/DC_6";
}
pub mod betti_metric {
pub const METRIC_DOMAIN: &str = "simplicial complex × dimension";
pub const METRIC_RANGE: &str = "non-negative integer";
pub const REFERENCES_CLASS: &str = "https://uor.foundation/observable/BettiNumber";
}
pub mod euler_metric {
pub const METRIC_DOMAIN: &str = "simplicial complex";
pub const METRIC_RANGE: &str = "integer";
pub const REFERENCES_IDENTITY: &str = "https://uor.foundation/op/IT_2";
}
pub mod residual_metric {
pub const METRIC_DOMAIN: &str = "computation state";
pub const METRIC_RANGE: &str = "non-negative integer";
pub const REFERENCES_CLASS: &str = "https://uor.foundation/observable/ResidualEntropy";
}