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§fn clone(&self) -> Substitution
fn clone(&self) -> Substitution
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Substitution
impl Debug for Substitution
Source§impl Default for Substitution
impl Default for Substitution
Source§fn default() -> Substitution
fn default() -> Substitution
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for Substitution
impl RefUnwindSafe for Substitution
impl Send for Substitution
impl Sync 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