[][src]Enum nar::syntax::core::subst::PrimSubst

pub enum PrimSubst<T> {
    IdS,
    Cons(T, Rc<Self>),
    Succ(Rc<Self>),
    Weak(DBIRc<Self>),
    Lift(DBIRc<Self>),
}

Substitution type. Agda.

Variants

IdS

The identity substitution. $$ \Gamma \vdash \text{IdS} : \Gamma $$

Cons(T, Rc<Self>)

The "add one more" substitution, or "substitution extension". $$ \cfrac{\Gamma \vdash u : A \rho \quad \Gamma \vdash \rho : \Delta} {\Gamma \vdash \text{Cons}(u, \rho) : \Delta, A} $$

Succ(Rc<Self>)

Strengthening substitution. Apply this to a term which does not contain variable 0 to lower all de Bruijn indices by one. $$ \cfrac{\Gamma \vdash \rho : \Delta} {\Gamma \vdash \text{Succ} \rho : \Delta, A} $$

Weak(DBIRc<Self>)

Weakening substitution, lifts to an extended context. $$ \cfrac{\Gamma \vdash \rho : \Delta} {\Gamma, \Psi \vdash \text{Weak}_\Psi \rho : \Delta} $$

Lift(DBIRc<Self>)

Lifting substitution. Use this to go under a binder. $\text{Lift}_1 \rho := \text{Cons}(\texttt{Term::form\_dbi(0)}, \text{Weak}_1 \rho)$. $$ \cfrac{\Gamma \vdash \rho : \Delta} {\Gamma, \Psi \rho \vdash \text{Lift}_\Psi \rho : \Delta, \Psi} $$

Methods

impl<T: DeBruijn> PrimSubst<T>[src]

pub fn concat(ts: impl DoubleEndedIterator<Item = T>, to: Rc<Self>) -> Rc<Self>[src]

pub fn parallel(ts: impl DoubleEndedIterator<Item = T>) -> Rc<Self>[src]

pub fn cons(self: Rc<Self>, t: T) -> Rc<Self>[src]

impl<Term: DeBruijn + RedEx<Term, Term> + Clone> PrimSubst<Term>[src]

pub fn lookup(&self, dbi: DBI) -> Term[src]

pub fn raise_term(k: DBI, term: Term) -> Term[src]

pub fn raise_from(n: DBI, k: DBI, term: Term) -> Term[src]

pub fn compose(self: Rc<Self>, sgm: Rc<Self>) -> Rc<Self>[src]

pub fn lookup_impl(&self, dbi: DBI) -> Either<&Term, Term>[src]

If lookup failed, return the DBI. Agda.

impl<T> PrimSubst<T>[src]

pub fn raise(by: DBI) -> Rc<Self>[src]

pub fn drop_by(self: Rc<Self>, drop_by: DBI) -> Rc<Self>[src]

Lift a substitution under k binders. Agda.

pub fn lift_by(self: Rc<Self>, lift_by: DBI) -> Rc<Self>[src]

Lift a substitution under k binders. Agda.

pub fn weaken(self: Rc<Self>, weaken_by: DBI) -> Rc<Self>[src]

pub fn one(t: T) -> Rc<Self>[src]

Trait Implementations

impl<T: Clone> Clone for PrimSubst<T>[src]

impl<T> Default for PrimSubst<T>[src]

Auto Trait Implementations

impl<T> !RefUnwindSafe for PrimSubst<T>

impl<T> !Send for PrimSubst<T>

impl<T> !Sync for PrimSubst<T>

impl<T> Unpin for PrimSubst<T> where
    T: Unpin

impl<T> !UnwindSafe for PrimSubst<T>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.