Trait CoreFold

Source
pub trait CoreFold<L: Language>: Sized + CoreVisit<L> {
    // Required method
    fn substitute(&self, substitution_fn: SubstitutionFn<'_, L>) -> Self;

    // Provided methods
    fn shift_in(&self) -> Self { ... }
    fn replace_free_var(
        &self,
        v: impl Upcast<CoreVariable<L>>,
        p: impl Upcast<CoreParameter<L>>,
    ) -> Self { ... }
}

Required Methods§

Source

fn substitute(&self, substitution_fn: SubstitutionFn<'_, L>) -> Self

Replace uses of variables with values from the substitution.

Provided Methods§

Source

fn shift_in(&self) -> Self

Produce a version of this term where any debruijn indices which appear free are incremented by one.

Source

fn replace_free_var( &self, v: impl Upcast<CoreVariable<L>>, p: impl Upcast<CoreParameter<L>>, ) -> Self

Replace all appearances of free variable v with p.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<L: Language> CoreFold<L> for u32

Source§

fn substitute(&self, _substitution_fn: SubstitutionFn<'_, L>) -> Self

Source§

impl<L: Language> CoreFold<L> for ()

Source§

fn substitute(&self, _substitution_fn: SubstitutionFn<'_, L>) -> Self

Source§

impl<L: Language> CoreFold<L> for usize

Source§

fn substitute(&self, _substitution_fn: SubstitutionFn<'_, L>) -> Self

Source§

impl<L: Language, A: CoreFold<L>, B: CoreFold<L>> CoreFold<L> for (A, B)

Source§

fn substitute(&self, substitution_fn: SubstitutionFn<'_, L>) -> Self

Source§

impl<L: Language, A: CoreFold<L>, B: CoreFold<L>, C: CoreFold<L>> CoreFold<L> for (A, B, C)

Source§

fn substitute(&self, substitution_fn: SubstitutionFn<'_, L>) -> Self

Source§

impl<L: Language, T: CoreFold<L>> CoreFold<L> for Option<T>

Source§

fn substitute(&self, substitution_fn: SubstitutionFn<'_, L>) -> Self

Source§

impl<L: Language, T: CoreFold<L>> CoreFold<L> for Arc<T>

Source§

fn substitute(&self, substitution_fn: SubstitutionFn<'_, L>) -> Self

Source§

impl<L: Language, T: CoreFold<L>> CoreFold<L> for Vec<T>

Source§

fn substitute(&self, substitution_fn: SubstitutionFn<'_, L>) -> Self

Implementors§

Source§

impl<L: Language> CoreFold<L> for CoreSubstitution<L>

Source§

impl<L: Language, T: CoreFold<L> + Ord> CoreFold<L> for Set<T>

Source§

impl<L: Language, T: CoreFold<L>> CoreFold<L> for CoreBinder<L, T>