Function malk_core::bump_index [] [src]

pub fn bump_index(term: &Term, amount: usize, cutoff: usize) -> Term

Bump all the index of the variables in a term by amount, ignoring variables whose index is less than cutoff. This is hygenic when it recurses into subcontexts (ie. cutoff is adjusted appropriately).

Example

bump_index(`(Var(0), Var(1), Var(2))`, 1, 100) => `(Var(0), Var(101), Var(102))`
bump_index(`(Var(0), FuncTerm(Var(0))))`, 0, 100) => `(Var(100), FuncTerm(Var(0)))`