use crate::HostTypes;
pub trait Transform<H: HostTypes> {
fn source(&self) -> &H::HostString;
fn target(&self) -> &H::HostString;
fn preserves_count(&self) -> usize;
fn preserves_at(&self, index: usize) -> &H::HostString;
type ComputationTrace: crate::bridge::trace::ComputationTrace<H>;
fn trace(&self) -> &Self::ComputationTrace;
type TransformTarget: Transform<H>;
fn composes_with(&self) -> &[Self::TransformTarget];
type Identity: crate::kernel::op::Identity<H>;
fn preserved_invariant(&self) -> &Self::Identity;
fn input_class(&self) -> &H::HostString;
fn output_class(&self) -> &H::HostString;
type Witness: Witness<H>;
fn has_witness(&self) -> &[Self::Witness];
}
pub trait Isometry<H: HostTypes>: Transform<H> {
type MetricObservable: crate::bridge::observable::MetricObservable<H>;
fn preserves_metric(&self) -> &[Self::MetricObservable];
}
pub trait Embedding<H: HostTypes>: Transform<H> {
fn source_quantum(&self) -> u64;
fn target_quantum(&self) -> u64;
fn address_coherence(&self) -> &Self::Identity;
}
pub trait Action<H: HostTypes> {
type Group: crate::kernel::op::Group<H>;
fn group(&self) -> &Self::Group;
fn acting_on(&self) -> &H::HostString;
fn action_isometry(&self) -> bool;
}
pub trait Composition<H: HostTypes>: Transform<H> {
type Transform: Transform<H>;
fn composition_result(&self) -> &Self::Transform;
fn composition_components(&self) -> &[Self::Transform];
}
pub trait Identity<H: HostTypes>: Transform<H> {
type TypeDefinition: crate::user::type_::TypeDefinition<H>;
fn identity_on(&self) -> &Self::TypeDefinition;
}
pub trait CompositionLaw<H: HostTypes> {
fn is_associative(&self) -> bool;
fn is_commutative(&self) -> bool;
type Operation: crate::kernel::op::Operation<H>;
fn law_components(&self) -> &[Self::Operation];
fn law_result(&self) -> &Self::Operation;
}
pub trait GroundingMap<H: HostTypes>: Transform<H> {
type Derivation: crate::bridge::derivation::Derivation<H>;
fn grounding_derivation(&self) -> &Self::Derivation;
type Constraint: crate::user::type_::Constraint<H>;
fn symbol_constraints(&self) -> &[Self::Constraint];
}
pub trait ProjectionMap<H: HostTypes>: Transform<H> {
type Frame: crate::user::state::Frame<H>;
fn projection_frame(&self) -> &Self::Frame;
type Conjunction: crate::user::type_::Conjunction<H>;
fn projection_order(&self) -> &Self::Conjunction;
fn round_trip_coherence(&self) -> bool;
fn output_element_class(&self) -> &H::HostString;
}
pub trait GroundingCertificate<H: HostTypes>: crate::bridge::cert::Certificate<H> {
type GroundingMap: GroundingMap<H>;
fn grounding_cert_map(&self) -> &Self::GroundingMap;
type ProjectionMap: ProjectionMap<H>;
fn grounding_cert_projection(&self) -> &Self::ProjectionMap;
type Literal: crate::kernel::schema::Literal<H>;
fn grounding_cert_source_symbol(&self) -> &Self::Literal;
type Element: crate::kernel::address::Element<H>;
fn grounding_cert_address(&self) -> &Self::Element;
}
pub trait TopologicalDelta<H: HostTypes> {
type BettiNumber: crate::bridge::observable::BettiNumber<H>;
fn bettis_before(&self) -> &Self::BettiNumber;
fn bettis_after(&self) -> &Self::BettiNumber;
fn euler_before(&self) -> i64;
fn euler_after(&self) -> i64;
type SimplicialComplex: crate::bridge::homology::SimplicialComplex<H>;
fn nerve_before(&self) -> &Self::SimplicialComplex;
fn nerve_after(&self) -> &Self::SimplicialComplex;
}
pub trait ComputationDatum<H: HostTypes>: crate::kernel::schema::Datum<H> {
type TransformCertificate: crate::bridge::cert::TransformCertificate<H>;
fn referenced_certificate(&self) -> &Self::TransformCertificate;
fn computation_address(&self) -> &Self::Element;
}
pub trait ApplicationMorphism<H: HostTypes>: Transform<H> {
type ComputationDatum: ComputationDatum<H>;
fn application_target(&self) -> &Self::ComputationDatum;
type Datum: crate::kernel::schema::Datum<H>;
fn application_input(&self) -> &Self::Datum;
}
pub trait PartialApplication<H: HostTypes>: ComputationDatum<H> {
type ComputationDatum: ComputationDatum<H>;
fn partial_base(&self) -> &Self::ComputationDatum;
type Datum: crate::kernel::schema::Datum<H>;
fn bound_arguments(&self) -> &[Self::Datum];
fn remaining_arity(&self) -> u64;
}
pub trait TransformComposition<H: HostTypes>: ComputationDatum<H> {
type ComputationDatum: ComputationDatum<H>;
fn composition_left(&self) -> &Self::ComputationDatum;
fn composition_right(&self) -> &Self::ComputationDatum;
}
pub trait Witness<H: HostTypes> {}
pub trait GroundingWitness<H: HostTypes>: Witness<H> {
type SurfaceSymbol: crate::kernel::schema::SurfaceSymbol<H>;
fn surface_symbol(&self) -> &Self::SurfaceSymbol;
type Element: crate::kernel::address::Element<H>;
fn grounded_address(&self) -> &Self::Element;
}
pub trait ProjectionWitness<H: HostTypes>: Witness<H> {
type Partition: crate::bridge::partition::Partition<H>;
fn projection_source(&self) -> &Self::Partition;
type SymbolSequence: SymbolSequence<H>;
fn projection_output(&self) -> &Self::SymbolSequence;
}
pub trait SymbolSequence<H: HostTypes> {
type SequenceElement: SequenceElement<H>;
fn has_element(&self) -> &[Self::SequenceElement];
}
pub trait SequenceElement<H: HostTypes> {
type SurfaceSymbol: crate::kernel::schema::SurfaceSymbol<H>;
fn element_value(&self) -> &Self::SurfaceSymbol;
fn element_index(&self) -> u64;
}
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/Element";
}
pub mod utf8_grounding_map {
pub const INPUT_CLASS: &str = "https://uor.foundation/schema/HostStringLiteral";
pub const OUTPUT_CLASS: &str = "https://uor.foundation/u/Element";
}
pub mod json_grounding_map {
pub const INPUT_CLASS: &str = "https://uor.foundation/schema/HostStringLiteral";
pub const OUTPUT_CLASS: &str = "https://uor.foundation/u/Element";
}
pub mod digest_grounding_map {
pub const INPUT_CLASS: &str = "https://uor.foundation/schema/HostStringLiteral";
pub const OUTPUT_CLASS: &str = "https://uor.foundation/u/Element";
}
pub mod binary_grounding_map {
pub const INPUT_CLASS: &str = "https://uor.foundation/schema/HostStringLiteral";
pub const OUTPUT_CLASS: &str = "https://uor.foundation/u/Element";
}
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";
}
pub mod digest_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 binary_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";
}