use crate::enums::RewriteRule;
use crate::Primitives;
pub trait Derivation<P: Primitives> {
type Term: crate::kernel::schema::Term<P>;
fn original_term(&self) -> &Self::Term;
fn canonical_term(&self) -> &Self::Term;
type Datum: crate::kernel::schema::Datum<P>;
fn result(&self) -> &Self::Datum;
type RewriteStep: RewriteStep<P>;
fn step(&self) -> &[Self::RewriteStep];
type TermMetrics: TermMetrics<P>;
fn term_metrics(&self) -> &Self::TermMetrics;
}
pub trait DerivationStep<P: Primitives> {}
pub trait RewriteStep<P: Primitives>: DerivationStep<P> {
type Term: crate::kernel::schema::Term<P>;
fn from(&self) -> &Self::Term;
fn to(&self) -> &Self::Term;
fn has_rewrite_rule(&self) -> RewriteRule;
}
pub trait RefinementStep<P: Primitives>: DerivationStep<P> {
type TypeDefinition: crate::user::type_::TypeDefinition<P>;
fn previous_type(&self) -> &Self::TypeDefinition;
type Constraint: crate::user::type_::Constraint<P>;
fn applied_constraint(&self) -> &Self::Constraint;
fn refined_type(&self) -> &Self::TypeDefinition;
fn sites_closed(&self) -> P::NonNegativeInteger;
}
pub trait TermMetrics<P: Primitives> {
fn step_count(&self) -> P::NonNegativeInteger;
fn term_size(&self) -> P::NonNegativeInteger;
}
pub trait SynthesisStep<P: Primitives> {
fn step_index(&self) -> P::NonNegativeInteger;
type Constraint: crate::user::type_::Constraint<P>;
fn added_constraint(&self) -> &Self::Constraint;
type SynthesisSignature: crate::bridge::observable::SynthesisSignature<P>;
fn signature_before(&self) -> &Self::SynthesisSignature;
fn signature_after(&self) -> &Self::SynthesisSignature;
}
pub trait SynthesisCheckpoint<P: Primitives> {
type SynthesisStep: SynthesisStep<P>;
fn checkpoint_step(&self) -> &Self::SynthesisStep;
type ConstraintSearchState: crate::bridge::resolver::ConstraintSearchState<P>;
fn checkpoint_state(&self) -> &Self::ConstraintSearchState;
}
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 {}