use crate::enums::RewriteRule;
use crate::HostTypes;
pub trait Derivation<H: HostTypes> {
type Term: crate::kernel::schema::Term<H>;
fn original_term(&self) -> &Self::Term;
fn canonical_term(&self) -> &Self::Term;
type Datum: crate::kernel::schema::Datum<H>;
fn result(&self) -> &Self::Datum;
type RewriteStep: RewriteStep<H>;
fn step(&self) -> &[Self::RewriteStep];
type TermMetrics: TermMetrics<H>;
fn term_metrics(&self) -> &Self::TermMetrics;
}
pub trait DerivationStep<H: HostTypes> {}
pub trait RewriteStep<H: HostTypes>: DerivationStep<H> {
type Term: crate::kernel::schema::Term<H>;
fn from(&self) -> &Self::Term;
fn to(&self) -> &Self::Term;
fn has_rewrite_rule(&self) -> RewriteRule;
}
pub trait RefinementStep<H: HostTypes>: DerivationStep<H> {
type TypeDefinition: crate::user::type_::TypeDefinition<H>;
fn previous_type(&self) -> &Self::TypeDefinition;
type Constraint: crate::user::type_::Constraint<H>;
fn applied_constraint(&self) -> &Self::Constraint;
fn refined_type(&self) -> &Self::TypeDefinition;
fn sites_closed(&self) -> u64;
}
pub trait TermMetrics<H: HostTypes> {
fn step_count(&self) -> u64;
fn term_size(&self) -> u64;
}
pub trait SynthesisStep<H: HostTypes> {
fn step_index(&self) -> u64;
type Constraint: crate::user::type_::Constraint<H>;
fn added_constraint(&self) -> &Self::Constraint;
type SynthesisSignature: crate::bridge::observable::SynthesisSignature<H>;
fn signature_before(&self) -> &Self::SynthesisSignature;
fn signature_after(&self) -> &Self::SynthesisSignature;
}
pub trait SynthesisCheckpoint<H: HostTypes> {
type SynthesisStep: SynthesisStep<H>;
fn checkpoint_step(&self) -> &Self::SynthesisStep;
type ConstraintSearchState: crate::bridge::resolver::ConstraintSearchState<H>;
fn checkpoint_state(&self) -> &Self::ConstraintSearchState;
}
pub trait InhabitanceStep<H: HostTypes>: SynthesisStep<H> {
type ConstraintSearchState: crate::bridge::resolver::ConstraintSearchState<H>;
fn prior_state(&self) -> &Self::ConstraintSearchState;
fn successor_state(&self) -> &Self::ConstraintSearchState;
type DispatchRule: crate::kernel::predicate::DispatchRule<H>;
fn rule(&self) -> &Self::DispatchRule;
}
pub trait InhabitanceCheckpoint<H: HostTypes>: SynthesisCheckpoint<H> {
fn checkpoint_index(&self) -> i64;
}
pub trait DerivationDepthObservable<H: HostTypes>:
crate::bridge::observable::Observable<H>
{
}
pub trait DerivationTrace<H: HostTypes> {
fn trace_event_count(&self) -> u64;
}
pub mod critical_identity_rule {
pub const GROUNDED_IN: &str = "https://uor.foundation/op/criticalIdentity";
}
pub mod involution_rule {}
pub mod associativity_rule {}
pub mod commutativity_rule {}
pub mod identity_element_rule {}
pub mod normalization_rule {}