use crate::HostTypes;
pub trait ProductiveStream<H: HostTypes> {
fn is_productive(&self) -> bool;
type Term: crate::kernel::schema::Term<H>;
fn step_term(&self) -> &Self::Term;
fn productivity_witness(&self) -> &H::HostString;
}
pub trait Epoch<H: HostTypes> {
type EulerReduction: crate::kernel::reduction::EulerReduction<H>;
fn epoch_reduction(&self) -> &Self::EulerReduction;
type Datum: crate::kernel::schema::Datum<H>;
fn epoch_output(&self) -> &Self::Datum;
type Context: crate::user::state::Context<H>;
fn epoch_context(&self) -> &Self::Context;
fn epoch_index(&self) -> u64;
}
pub trait EpochBoundary<H: HostTypes> {
type Epoch: Epoch<H>;
fn boundary_from(&self) -> &Self::Epoch;
fn boundary_to(&self) -> &Self::Epoch;
type Context: crate::user::state::Context<H>;
fn continuation_context(&self) -> &Self::Context;
}
pub trait StreamPrefix<H: HostTypes> {
type Epoch: Epoch<H>;
fn prefix_epochs(&self) -> &[Self::Epoch];
fn prefix_length(&self) -> u64;
}
pub trait StreamMorphism<H: HostTypes>: crate::user::morphism::Transform<H> {}
pub trait Unfold<H: HostTypes> {
type Context: crate::user::state::Context<H>;
fn unfold_seed(&self) -> &Self::Context;
type ComputationDatum: crate::user::morphism::ComputationDatum<H>;
fn unfold_step(&self) -> &Self::ComputationDatum;
type ProductiveStream: ProductiveStream<H>;
fn unfold_result(&self) -> &Self::ProductiveStream;
}
#[doc(hidden)]
#[doc = "THEORY-DEFERRED \u{2014} not a valid implementation; see [docs/theory_deferred.md]. Exists only to satisfy downstream trait-bound references."]
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct NullProductiveStream<H: HostTypes> {
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Default for NullProductiveStream<H> {
fn default() -> Self {
Self {
_phantom: core::marker::PhantomData,
}
}
}
impl<H: HostTypes> NullProductiveStream<H> {
pub const ABSENT: NullProductiveStream<H> = NullProductiveStream {
_phantom: core::marker::PhantomData,
};
}
impl<H: HostTypes> ProductiveStream<H> for NullProductiveStream<H> {
fn is_productive(&self) -> bool {
false
}
type Term = crate::kernel::schema::NullTerm<H>;
fn step_term(&self) -> &Self::Term {
&<crate::kernel::schema::NullTerm<H>>::ABSENT
}
fn productivity_witness(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
}
#[doc(hidden)]
#[doc = "THEORY-DEFERRED \u{2014} not a valid implementation; see [docs/theory_deferred.md]. Exists only to satisfy downstream trait-bound references."]
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct NullEpoch<H: HostTypes> {
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Default for NullEpoch<H> {
fn default() -> Self {
Self {
_phantom: core::marker::PhantomData,
}
}
}
impl<H: HostTypes> NullEpoch<H> {
pub const ABSENT: NullEpoch<H> = NullEpoch {
_phantom: core::marker::PhantomData,
};
}
impl<H: HostTypes> Epoch<H> for NullEpoch<H> {
type EulerReduction = crate::kernel::reduction::NullEulerReduction<H>;
fn epoch_reduction(&self) -> &Self::EulerReduction {
&<crate::kernel::reduction::NullEulerReduction<H>>::ABSENT
}
type Datum = crate::kernel::schema::NullDatum<H>;
fn epoch_output(&self) -> &Self::Datum {
&<crate::kernel::schema::NullDatum<H>>::ABSENT
}
type Context = crate::user::state::NullContext<H>;
fn epoch_context(&self) -> &Self::Context {
&<crate::user::state::NullContext<H>>::ABSENT
}
fn epoch_index(&self) -> u64 {
0
}
}
#[doc(hidden)]
#[doc = "THEORY-DEFERRED \u{2014} not a valid implementation; see [docs/theory_deferred.md]. Exists only to satisfy downstream trait-bound references."]
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct NullEpochBoundary<H: HostTypes> {
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Default for NullEpochBoundary<H> {
fn default() -> Self {
Self {
_phantom: core::marker::PhantomData,
}
}
}
impl<H: HostTypes> NullEpochBoundary<H> {
pub const ABSENT: NullEpochBoundary<H> = NullEpochBoundary {
_phantom: core::marker::PhantomData,
};
}
impl<H: HostTypes> EpochBoundary<H> for NullEpochBoundary<H> {
type Epoch = NullEpoch<H>;
fn boundary_from(&self) -> &Self::Epoch {
&<NullEpoch<H>>::ABSENT
}
fn boundary_to(&self) -> &Self::Epoch {
&<NullEpoch<H>>::ABSENT
}
type Context = crate::user::state::NullContext<H>;
fn continuation_context(&self) -> &Self::Context {
&<crate::user::state::NullContext<H>>::ABSENT
}
}
#[doc(hidden)]
#[doc = "THEORY-DEFERRED \u{2014} not a valid implementation; see [docs/theory_deferred.md]. Exists only to satisfy downstream trait-bound references."]
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct NullStreamPrefix<H: HostTypes> {
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Default for NullStreamPrefix<H> {
fn default() -> Self {
Self {
_phantom: core::marker::PhantomData,
}
}
}
impl<H: HostTypes> NullStreamPrefix<H> {
pub const ABSENT: NullStreamPrefix<H> = NullStreamPrefix {
_phantom: core::marker::PhantomData,
};
}
impl<H: HostTypes> StreamPrefix<H> for NullStreamPrefix<H> {
type Epoch = NullEpoch<H>;
fn prefix_epochs(&self) -> &[Self::Epoch] {
&[]
}
fn prefix_length(&self) -> u64 {
0
}
}
#[doc(hidden)]
#[doc = "THEORY-DEFERRED \u{2014} not a valid implementation; see [docs/theory_deferred.md]. Exists only to satisfy downstream trait-bound references."]
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct NullStreamMorphism<H: HostTypes> {
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Default for NullStreamMorphism<H> {
fn default() -> Self {
Self {
_phantom: core::marker::PhantomData,
}
}
}
impl<H: HostTypes> NullStreamMorphism<H> {
pub const ABSENT: NullStreamMorphism<H> = NullStreamMorphism {
_phantom: core::marker::PhantomData,
};
}
impl<H: HostTypes> crate::user::morphism::Transform<H> for NullStreamMorphism<H> {
fn source(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
fn target(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
fn preserves_count(&self) -> usize {
0
}
fn preserves_at(&self, _index: usize) -> &H::HostString {
H::EMPTY_HOST_STRING
}
type ComputationTrace = crate::bridge::trace::NullComputationTrace<H>;
fn trace(&self) -> &Self::ComputationTrace {
&<crate::bridge::trace::NullComputationTrace<H>>::ABSENT
}
type TransformTarget = crate::user::morphism::NullTransform<H>;
fn composes_with(&self) -> &[Self::TransformTarget] {
&[]
}
type Identity = crate::kernel::op::NullIdentity<H>;
fn preserved_invariant(&self) -> &Self::Identity {
&<crate::kernel::op::NullIdentity<H>>::ABSENT
}
fn input_class(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
fn output_class(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
type Witness = crate::user::morphism::NullWitness<H>;
fn has_witness(&self) -> &[Self::Witness] {
&[]
}
}
impl<H: HostTypes> StreamMorphism<H> for NullStreamMorphism<H> {}
#[doc(hidden)]
#[doc = "THEORY-DEFERRED \u{2014} not a valid implementation; see [docs/theory_deferred.md]. Exists only to satisfy downstream trait-bound references."]
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct NullUnfold<H: HostTypes> {
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Default for NullUnfold<H> {
fn default() -> Self {
Self {
_phantom: core::marker::PhantomData,
}
}
}
impl<H: HostTypes> NullUnfold<H> {
pub const ABSENT: NullUnfold<H> = NullUnfold {
_phantom: core::marker::PhantomData,
};
}
impl<H: HostTypes> Unfold<H> for NullUnfold<H> {
type Context = crate::user::state::NullContext<H>;
fn unfold_seed(&self) -> &Self::Context {
&<crate::user::state::NullContext<H>>::ABSENT
}
type ComputationDatum = crate::user::morphism::NullComputationDatum<H>;
fn unfold_step(&self) -> &Self::ComputationDatum {
&<crate::user::morphism::NullComputationDatum<H>>::ABSENT
}
type ProductiveStream = NullProductiveStream<H>;
fn unfold_result(&self) -> &Self::ProductiveStream {
&<NullProductiveStream<H>>::ABSENT
}
}