use crate::HostTypes;
pub trait ComputationResult<H: HostTypes> {}
pub trait Success<H: HostTypes>: ComputationResult<H> {
type Datum: crate::kernel::schema::Datum<H>;
fn result_datum(&self) -> &Self::Datum;
type ComputationCertificate: crate::bridge::proof::ComputationCertificate<H>;
fn result_certificate(&self) -> &Self::ComputationCertificate;
}
pub trait Failure<H: HostTypes>: ComputationResult<H> {
type FailureReason: FailureReason<H>;
fn failure_reason(&self) -> &Self::FailureReason;
type ReductionState: crate::kernel::reduction::ReductionState<H>;
fn failure_state(&self) -> &Self::ReductionState;
type ReductionStep: crate::kernel::reduction::ReductionStep<H>;
fn failure_stage(&self) -> &Self::ReductionStep;
type Recovery: Recovery<H>;
fn recovery_strategy(&self) -> &[Self::Recovery];
fn failure_depth(&self) -> u64;
}
pub trait FailureReason<H: HostTypes> {}
pub trait GuardFailure<H: HostTypes>: FailureReason<H> {}
pub trait ConstraintContradiction<H: HostTypes>: FailureReason<H> {}
pub trait SiteExhaustion<H: HostTypes>: FailureReason<H> {}
pub trait LiftObstructionFailure<H: HostTypes>: FailureReason<H> {}
pub trait PartialComputation<H: HostTypes> {
fn is_total(&self) -> bool;
}
pub trait TotalComputation<H: HostTypes>: PartialComputation<H> {}
pub trait Recovery<H: HostTypes> {
type Effect: crate::kernel::effect::Effect<H>;
fn recovery_effect(&self) -> &Self::Effect;
type ReductionStep: crate::kernel::reduction::ReductionStep<H>;
fn recovery_target(&self) -> &Self::ReductionStep;
}
pub trait FailurePropagation<H: HostTypes> {
type FailureReason: FailureReason<H>;
fn propagation_rule(&self) -> &[Self::FailureReason];
}