use crate::Primitives;
pub trait Predicate<P: Primitives> {
fn evaluates_over(&self) -> &P::String;
type DescentMeasure: crate::kernel::recursion::DescentMeasure<P>;
fn bounded_evaluator(&self) -> &[Self::DescentMeasure];
}
pub trait TypePredicate<P: Primitives>: Predicate<P> {}
pub trait StatePredicate<P: Primitives>: Predicate<P> {}
pub trait FiberPredicate<P: Primitives>: Predicate<P> {}
pub trait DispatchRule<P: Primitives> {
type Predicate: Predicate<P>;
fn dispatch_predicate(&self) -> &Self::Predicate;
type Resolver: crate::bridge::resolver::Resolver<P>;
fn dispatch_target(&self) -> &Self::Resolver;
fn dispatch_index(&self) -> P::NonNegativeInteger;
}
pub trait DispatchTable<P: Primitives> {
type DispatchRule: DispatchRule<P>;
fn dispatch_rules(&self) -> &[Self::DispatchRule];
fn is_exhaustive(&self) -> P::Boolean;
fn is_mutually_exclusive(&self) -> P::Boolean;
}
pub trait GuardedTransition<P: Primitives> {
type StatePredicate: StatePredicate<P>;
fn guard_predicate(&self) -> &Self::StatePredicate;
type Effect: crate::kernel::effect::Effect<P>;
fn guard_effect(&self) -> &Self::Effect;
type CascadeStage: crate::kernel::cascade::CascadeStage<P>;
fn guard_target(&self) -> &Self::CascadeStage;
}
pub trait MatchArm<P: Primitives> {
type Predicate: Predicate<P>;
fn arm_predicate(&self) -> &Self::Predicate;
type Term: crate::kernel::schema::Term<P>;
fn arm_result(&self) -> &Self::Term;
fn arm_index(&self) -> P::NonNegativeInteger;
}
pub trait MatchExpression<P: Primitives>: crate::kernel::schema::Term<P> {
type MatchArm: MatchArm<P>;
fn match_arms(&self) -> &[Self::MatchArm];
}