pub struct Substitution { /* private fields */ }Expand description
A substitution mapping: a list of (FVarId, Expr) pairs.
Used to represent simultaneous substitution of free variables.
Implementations§
Source§impl Substitution
impl Substitution
Sourcepub fn insert(&mut self, fvar: FVarId, expr: Expr)
pub fn insert(&mut self, fvar: FVarId, expr: Expr)
Add a mapping fvar → expr to the substitution.
Sourcepub fn apply(&self, expr: &Expr) -> Expr
pub fn apply(&self, expr: &Expr) -> Expr
Apply this substitution to an expression.
Replaces each FVar(id) found in expr with the corresponding image.
Sourcepub fn compose(&self, other: &Substitution) -> Substitution
pub fn compose(&self, other: &Substitution) -> Substitution
Compose self with other: apply other to all images in self,
then merge. Maps in self override other for the same variable.
Sourcepub fn restrict(&self, keep: &[FVarId]) -> Substitution
pub fn restrict(&self, keep: &[FVarId]) -> Substitution
Restrict the substitution to only those fvars in keep.
Trait Implementations§
Source§impl Clone for Substitution
impl Clone for Substitution
Source§impl Debug for Substitution
impl Debug for Substitution
Auto Trait Implementations§
impl !Send for Substitution
impl !Sync for Substitution
impl Forget for Substitution
impl Freeze for Substitution
impl Move for Substitution
impl RefUnwindSafe for Substitution
impl Unpin for Substitution
impl UnsafeUnpin for Substitution
impl UnwindSafe for Substitution
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more