use crate::enums::AchievabilityStatus;
use crate::enums::MeasurementUnit;
use crate::enums::PhaseBoundaryType;
use crate::enums::WittLevel;
use crate::HostTypes;
pub trait Observable<H: HostTypes> {
fn value(&self) -> H::Decimal;
fn source(&self) -> &H::HostString;
fn target(&self) -> &H::HostString;
fn has_unit(&self) -> MeasurementUnit;
}
pub trait StratumObservable<H: HostTypes>: Observable<H> {}
pub trait MetricObservable<H: HostTypes>: Observable<H> {}
pub trait PathObservable<H: HostTypes>: Observable<H> {}
pub trait ReductionObservable<H: HostTypes>: Observable<H> {}
pub trait CatastropheObservable<H: HostTypes>: Observable<H> {
fn phase_n(&self) -> u64;
fn phase_g(&self) -> u64;
fn on_resonance_line(&self) -> bool;
fn phase_boundary_type(&self) -> PhaseBoundaryType;
}
pub trait CurvatureObservable<H: HostTypes>: Observable<H> {}
pub trait HolonomyObservable<H: HostTypes>: Observable<H> {}
pub trait RingMetric<H: HostTypes>: MetricObservable<H> {}
pub trait HammingMetric<H: HostTypes>: MetricObservable<H> {}
pub trait IncompatibilityMetric<H: HostTypes>: MetricObservable<H> {}
pub trait ValueModObservable<H: HostTypes>: MetricObservable<H> {}
pub trait GroundingSigma<H: HostTypes>: Observable<H> {}
pub trait JacobianObservable<H: HostTypes>: Observable<H> {}
pub trait StratumValue<H: HostTypes>: StratumObservable<H> {}
pub trait StratumDelta<H: HostTypes>: StratumObservable<H> {}
pub trait StratumTrajectory<H: HostTypes>: StratumObservable<H> {}
pub trait PathLength<H: HostTypes>: PathObservable<H> {}
pub trait TotalVariation<H: HostTypes>: PathObservable<H> {}
pub trait WindingNumber<H: HostTypes>: PathObservable<H> {}
pub trait ReductionLength<H: HostTypes>: ReductionObservable<H> {}
pub trait ReductionCount<H: HostTypes>: ReductionObservable<H> {}
pub trait CatastropheThreshold<H: HostTypes>: CatastropheObservable<H> {}
pub trait CatastropheCount<H: HostTypes>: CatastropheObservable<H> {}
pub trait Commutator<H: HostTypes>: CurvatureObservable<H> {}
pub trait CurvatureFlux<H: HostTypes>: CurvatureObservable<H> {}
pub trait Monodromy<H: HostTypes>: HolonomyObservable<H> {
type ClosedConstraintPath: ClosedConstraintPath<H>;
fn monodromy_loop(&self) -> &Self::ClosedConstraintPath;
type DihedralElement: DihedralElement<H>;
fn monodromy_element(&self) -> &Self::DihedralElement;
fn is_trivial_monodromy(&self) -> bool;
}
pub trait ParallelTransport<H: HostTypes>: HolonomyObservable<H> {}
pub trait DihedralElement<H: HostTypes>: HolonomyObservable<H> {
type Operation: crate::kernel::op::Operation<H>;
fn dihedral_element_value(&self) -> &[Self::Operation];
fn is_identity_element(&self) -> bool;
fn element_order(&self) -> u64;
fn rotation_exponent(&self) -> u64;
fn reflection_bit(&self) -> bool;
}
pub trait Jacobian<H: HostTypes>: CurvatureObservable<H> {
fn site_position(&self) -> u64;
fn derivative_value(&self) -> H::Decimal;
}
pub trait TopologicalObservable<H: HostTypes>: Observable<H> {
fn dimension(&self) -> u64;
}
pub trait BettiNumber<H: HostTypes>: TopologicalObservable<H> {}
pub trait SpectralGap<H: HostTypes>: TopologicalObservable<H> {}
pub trait ThermoObservable<H: HostTypes>: Observable<H> {
fn hardness_estimate(&self) -> H::Decimal;
}
pub trait ResidualEntropy<H: HostTypes>: ThermoObservable<H> {}
pub trait LandauerCost<H: HostTypes>: ThermoObservable<H> {}
pub trait LandauerBudget<H: HostTypes>: ThermoObservable<H> {
fn landauer_nats(&self) -> H::Decimal;
}
pub trait ReductionEntropy<H: HostTypes>: ThermoObservable<H> {}
pub trait SynthesisSignature<H: HostTypes> {
fn realised_euler(&self) -> i64;
fn realised_betti(&self) -> &[u64];
fn achievability_status(&self) -> AchievabilityStatus;
fn is_achievable(&self) -> bool;
fn is_forbidden(&self) -> bool;
type Proof: crate::bridge::proof::Proof<H>;
fn achievability_witness(&self) -> &Self::Proof;
}
pub trait SpectralSequencePage<H: HostTypes> {
fn page_index(&self) -> u64;
fn differential_is_zero(&self) -> bool;
fn converged_at(&self) -> u64;
type PostnikovTruncation: crate::bridge::homology::PostnikovTruncation<H>;
fn postnikov_truncation(&self) -> &Self::PostnikovTruncation;
}
pub trait LiftObstructionClass<H: HostTypes> {
type CohomologyGroup: crate::bridge::cohomology::CohomologyGroup<H>;
fn obstruction_class(&self) -> &Self::CohomologyGroup;
}
pub trait MonodromyClass<H: HostTypes> {}
pub trait HolonomyGroup<H: HostTypes> {
type DihedralElement: DihedralElement<H>;
fn holonomy_group(&self) -> &[Self::DihedralElement];
fn holonomy_group_order(&self) -> u64;
}
pub trait ClosedConstraintPath<H: HostTypes> {
fn path_length(&self) -> u64;
type Constraint: crate::user::type_::Constraint<H>;
fn path_constraints(&self) -> &[Self::Constraint];
}
pub trait HomotopyGroup<H: HostTypes> {
fn homotopy_dimension(&self) -> u64;
fn homotopy_rank(&self) -> u64;
type Constraint: crate::user::type_::Constraint<H>;
fn homotopy_basepoint(&self) -> &Self::Constraint;
}
pub trait HigherMonodromy<H: HostTypes> {
fn higher_monodromy_dimension(&self) -> u64;
}
pub trait WhiteheadProduct<H: HostTypes> {
fn whitehead_trivial(&self) -> bool;
}
pub trait StratificationRecord<H: HostTypes> {
fn stratification_level(&self) -> WittLevel;
type HolonomyStratum: crate::user::type_::HolonomyStratum<H>;
fn stratification_stratum(&self) -> &[Self::HolonomyStratum];
}
pub trait BaseMetric<H: HostTypes>: Observable<H> {
fn metric_domain(&self) -> &H::HostString;
fn metric_range(&self) -> &H::HostString;
type TermExpression: crate::kernel::schema::TermExpression<H>;
fn metric_composition(&self) -> &Self::TermExpression;
type Identity: crate::kernel::op::Identity<H>;
fn references_identity(&self) -> &Self::Identity;
fn metric_unit(&self) -> MeasurementUnit;
fn metric_precision(&self) -> u64;
fn metric_monotonicity(&self) -> &Self::TermExpression;
fn metric_decomposition(&self) -> &Self::TermExpression;
fn metric_tower_position(&self) -> u64;
fn metric_computation_cost(&self) -> &Self::TermExpression;
fn metric_bound(&self) -> &Self::TermExpression;
}
pub trait GroundingObservable<H: HostTypes>: Observable<H> {
fn saturation_numerator(&self) -> u64;
fn saturation_denominator(&self) -> u64;
}
pub trait EulerCharacteristicObservable<H: HostTypes>: Observable<H> {
type TermExpression: crate::kernel::schema::TermExpression<H>;
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";
}