use crate::Primitives;
pub trait Transform<P: Primitives> {
fn source(&self) -> &P::String;
fn target(&self) -> &P::String;
fn preserves_count(&self) -> usize;
fn preserves_at(&self, index: usize) -> &P::String;
type ComputationTrace: crate::bridge::trace::ComputationTrace<P>;
fn trace(&self) -> &Self::ComputationTrace;
type TransformTarget: Transform<P>;
fn composes_with(&self) -> &[Self::TransformTarget];
type Identity: crate::kernel::op::Identity<P>;
fn preserved_invariant(&self) -> &Self::Identity;
fn input_class(&self) -> &P::String;
fn output_class(&self) -> &P::String;
type Witness: Witness<P>;
fn has_witness(&self) -> &[Self::Witness];
}
pub trait Isometry<P: Primitives>: Transform<P> {
type MetricObservable: crate::bridge::observable::MetricObservable<P>;
fn preserves_metric(&self) -> &[Self::MetricObservable];
}
pub trait Embedding<P: Primitives>: Transform<P> {
fn source_quantum(&self) -> P::PositiveInteger;
fn target_quantum(&self) -> P::PositiveInteger;
fn address_coherence(&self) -> &Self::Identity;
}
pub trait Action<P: Primitives> {
type Group: crate::kernel::op::Group<P>;
fn group(&self) -> &Self::Group;
fn acting_on(&self) -> &P::String;
fn action_isometry(&self) -> P::Boolean;
}
pub trait Composition<P: Primitives>: Transform<P> {
type Transform: Transform<P>;
fn composition_result(&self) -> &Self::Transform;
fn composition_components(&self) -> &[Self::Transform];
}
pub trait Identity<P: Primitives>: Transform<P> {
type TypeDefinition: crate::user::type_::TypeDefinition<P>;
fn identity_on(&self) -> &Self::TypeDefinition;
}
pub trait CompositionLaw<P: Primitives> {
fn is_associative(&self) -> P::Boolean;
fn is_commutative(&self) -> P::Boolean;
type Operation: crate::kernel::op::Operation<P>;
fn law_components(&self) -> &[Self::Operation];
fn law_result(&self) -> &Self::Operation;
}
pub trait GroundingMap<P: Primitives>: Transform<P> {
type Derivation: crate::bridge::derivation::Derivation<P>;
fn grounding_derivation(&self) -> &Self::Derivation;
type Constraint: crate::user::type_::Constraint<P>;
fn symbol_constraints(&self) -> &[Self::Constraint];
}
pub trait ProjectionMap<P: Primitives>: Transform<P> {
type Frame: crate::user::state::Frame<P>;
fn projection_frame(&self) -> &Self::Frame;
type CompositeConstraint: crate::user::type_::CompositeConstraint<P>;
fn projection_order(&self) -> &Self::CompositeConstraint;
fn round_trip_coherence(&self) -> P::Boolean;
fn output_element_class(&self) -> &P::String;
}
pub trait GroundingCertificate<P: Primitives>: crate::bridge::cert::Certificate<P> {
type GroundingMap: GroundingMap<P>;
fn grounding_cert_map(&self) -> &Self::GroundingMap;
type ProjectionMap: ProjectionMap<P>;
fn grounding_cert_projection(&self) -> &Self::ProjectionMap;
type Literal: crate::kernel::schema::Literal<P>;
fn grounding_cert_source_symbol(&self) -> &Self::Literal;
type Address: crate::kernel::address::Address<P>;
fn grounding_cert_address(&self) -> &Self::Address;
}
pub trait TopologicalDelta<P: Primitives> {
type BettiNumber: crate::bridge::observable::BettiNumber<P>;
fn bettis_before(&self) -> &Self::BettiNumber;
fn bettis_after(&self) -> &Self::BettiNumber;
fn euler_before(&self) -> P::Integer;
fn euler_after(&self) -> P::Integer;
type SimplicialComplex: crate::bridge::homology::SimplicialComplex<P>;
fn nerve_before(&self) -> &Self::SimplicialComplex;
fn nerve_after(&self) -> &Self::SimplicialComplex;
}
pub trait ComputationDatum<P: Primitives>: crate::kernel::schema::Datum<P> {
type TransformCertificate: crate::bridge::cert::TransformCertificate<P>;
fn referenced_certificate(&self) -> &Self::TransformCertificate;
fn computation_address(&self) -> &Self::Address;
}
pub trait ApplicationMorphism<P: Primitives>: Transform<P> {
type ComputationDatum: ComputationDatum<P>;
fn application_target(&self) -> &Self::ComputationDatum;
type Datum: crate::kernel::schema::Datum<P>;
fn application_input(&self) -> &Self::Datum;
}
pub trait PartialApplication<P: Primitives>: ComputationDatum<P> {
type ComputationDatum: ComputationDatum<P>;
fn partial_base(&self) -> &Self::ComputationDatum;
type Datum: crate::kernel::schema::Datum<P>;
fn bound_arguments(&self) -> &[Self::Datum];
fn remaining_arity(&self) -> P::PositiveInteger;
}
pub trait TransformComposition<P: Primitives>: ComputationDatum<P> {
type ComputationDatum: ComputationDatum<P>;
fn composition_left(&self) -> &Self::ComputationDatum;
fn composition_right(&self) -> &Self::ComputationDatum;
}
pub trait Witness<P: Primitives> {}
pub trait GroundingWitness<P: Primitives>: Witness<P> {
type SurfaceSymbol: crate::kernel::schema::SurfaceSymbol<P>;
fn surface_symbol(&self) -> &Self::SurfaceSymbol;
type Address: crate::kernel::address::Address<P>;
fn grounded_address(&self) -> &Self::Address;
}
pub trait ProjectionWitness<P: Primitives>: Witness<P> {
type Partition: crate::bridge::partition::Partition<P>;
fn projection_source(&self) -> &Self::Partition;
type SymbolSequence: SymbolSequence<P>;
fn projection_output(&self) -> &Self::SymbolSequence;
}
pub trait SymbolSequence<P: Primitives> {
type SequenceElement: SequenceElement<P>;
fn has_element(&self) -> &[Self::SequenceElement];
}
pub trait SequenceElement<P: Primitives> {
type SurfaceSymbol: crate::kernel::schema::SurfaceSymbol<P>;
fn element_value(&self) -> &Self::SurfaceSymbol;
fn element_index(&self) -> P::NonNegativeInteger;
}
pub mod critical_composition {
pub const IS_ASSOCIATIVE: bool = false;
pub const IS_COMMUTATIVE: bool = false;
pub const LAW_COMPONENTS: &[&str] = &[
"https://uor.foundation/op/neg",
"https://uor.foundation/op/bnot",
];
pub const LAW_RESULT: &str = "https://uor.foundation/op/succ";
}
pub mod integer_grounding_map {
pub const INPUT_CLASS: &str = "https://uor.foundation/schema/Literal";
pub const OUTPUT_CLASS: &str = "https://uor.foundation/u/Address";
}
pub mod utf8_grounding_map {
pub const INPUT_CLASS: &str = "https://uor.foundation/schema/HostStringLiteral";
pub const OUTPUT_CLASS: &str = "https://uor.foundation/u/Address";
}
pub mod json_grounding_map {
pub const INPUT_CLASS: &str = "https://uor.foundation/schema/HostStringLiteral";
pub const OUTPUT_CLASS: &str = "https://uor.foundation/u/Address";
}
pub mod integer_projection_map {
pub const INPUT_CLASS: &str = "https://uor.foundation/partition/Partition";
pub const OUTPUT_CLASS: &str = "https://uor.foundation/morphism/SymbolSequence";
pub const OUTPUT_ELEMENT_CLASS: &str = "https://uor.foundation/schema/Literal";
}
pub mod utf8_projection_map {
pub const INPUT_CLASS: &str = "https://uor.foundation/partition/Partition";
pub const OUTPUT_CLASS: &str = "https://uor.foundation/morphism/SymbolSequence";
pub const OUTPUT_ELEMENT_CLASS: &str = "https://uor.foundation/schema/HostStringLiteral";
}
pub mod json_projection_map {
pub const INPUT_CLASS: &str = "https://uor.foundation/partition/Partition";
pub const OUTPUT_CLASS: &str = "https://uor.foundation/morphism/SymbolSequence";
pub const OUTPUT_ELEMENT_CLASS: &str = "https://uor.foundation/schema/HostStringLiteral";
}