use crate::HostTypes;
pub trait Predicate<H: HostTypes> {
fn evaluates_over(&self) -> &H::HostString;
type Term: crate::kernel::schema::Term<H>;
fn evaluator_term(&self) -> &Self::Term;
fn termination_witness(&self) -> &H::HostString;
type DescentMeasure: crate::kernel::recursion::DescentMeasure<H>;
fn bounded_evaluator(&self) -> &[Self::DescentMeasure];
}
pub trait TypePredicate<H: HostTypes>: Predicate<H> {}
pub trait StatePredicate<H: HostTypes>: Predicate<H> {}
pub trait SitePredicate<H: HostTypes>: Predicate<H> {}
pub trait DispatchRule<H: HostTypes> {
type Predicate: Predicate<H>;
fn dispatch_predicate(&self) -> &Self::Predicate;
fn dispatch_target(&self) -> &H::HostString;
fn dispatch_priority(&self) -> u64;
fn dispatch_index(&self) -> u64;
}
pub trait DispatchTable<H: HostTypes> {
type DispatchRule: DispatchRule<H>;
fn dispatch_rules(&self) -> &[Self::DispatchRule];
fn is_exhaustive(&self) -> bool;
fn is_mutually_exclusive(&self) -> bool;
}
pub trait GuardedTransition<H: HostTypes> {
type StatePredicate: StatePredicate<H>;
fn guard_predicate(&self) -> &Self::StatePredicate;
type Effect: crate::kernel::effect::Effect<H>;
fn guard_effect(&self) -> &Self::Effect;
type ReductionStep: crate::kernel::reduction::ReductionStep<H>;
fn guard_target(&self) -> &Self::ReductionStep;
}
pub trait MatchArm<H: HostTypes> {
type Predicate: Predicate<H>;
fn arm_predicate(&self) -> &Self::Predicate;
type Term: crate::kernel::schema::Term<H>;
fn arm_result(&self) -> &Self::Term;
fn arm_index(&self) -> u64;
}
pub trait MatchExpression<H: HostTypes>: crate::kernel::schema::Term<H> {
type MatchArm: MatchArm<H>;
fn match_arms(&self) -> &[Self::MatchArm];
}
pub mod always {
pub const EVALUATES_OVER: &str = "https://uor.foundation/schema/Datum";
}
pub mod never {
pub const EVALUATES_OVER: &str = "https://uor.foundation/schema/Datum";
}
pub mod is_zero {
pub const EVALUATES_OVER: &str = "https://uor.foundation/schema/Datum";
}
pub mod is_unit {
pub const EVALUATES_OVER: &str = "https://uor.foundation/schema/Datum";
}
pub mod is_odd {
pub const EVALUATES_OVER: &str = "https://uor.foundation/schema/Datum";
}
pub mod is_even {
pub const EVALUATES_OVER: &str = "https://uor.foundation/schema/Datum";
}
pub mod is_involution {
pub const EVALUATES_OVER: &str = "https://uor.foundation/schema/Datum";
}
pub mod site_pinned {
pub const EVALUATES_OVER: &str = "https://uor.foundation/partition/SiteIndex";
}
pub mod site_free {
pub const EVALUATES_OVER: &str = "https://uor.foundation/partition/SiteIndex";
}
pub mod contradiction_reached {
pub const EVALUATES_OVER: &str = "https://uor.foundation/state/ContradictionBoundary";
}
pub mod budget_exhausted {
pub const EVALUATES_OVER: &str = "https://uor.foundation/partition/FreeRank";
}
pub mod reduction_converged {
pub const EVALUATES_OVER: &str = "https://uor.foundation/reduction/ReductionState";
}
pub mod is2_sat_shape {
pub const EVALUATES_OVER: &str = "https://uor.foundation/type/ConstrainedType";
}
pub mod is_horn_shape {
pub const EVALUATES_OVER: &str = "https://uor.foundation/type/ConstrainedType";
}
pub mod is_residual_fragment {
pub const EVALUATES_OVER: &str = "https://uor.foundation/type/ConstrainedType";
}
pub mod inhabitance_dispatch_table {
pub const IS_EXHAUSTIVE: bool = true;
pub const IS_MUTUALLY_EXCLUSIVE: bool = true;
}
pub mod inhabitance_rule_2sat {
pub const DISPATCH_PREDICATE: &str = "https://uor.foundation/predicate/Is2SatShape";
pub const DISPATCH_PRIORITY: i64 = 0;
pub const DISPATCH_TARGET: &str = "https://uor.foundation/resolver/TwoSatDecider";
}
pub mod inhabitance_rule_horn {
pub const DISPATCH_PREDICATE: &str = "https://uor.foundation/predicate/IsHornShape";
pub const DISPATCH_PRIORITY: i64 = 1;
pub const DISPATCH_TARGET: &str = "https://uor.foundation/resolver/HornSatDecider";
}
pub mod inhabitance_rule_residual {
pub const DISPATCH_PREDICATE: &str = "https://uor.foundation/predicate/IsResidualFragment";
pub const DISPATCH_PRIORITY: i64 = 2;
pub const DISPATCH_TARGET: &str = "https://uor.foundation/resolver/ResidualVerdictResolver";
}