pub fn shift(e: Id, incr_by: i32, egraph: &mut crate::EGraph, cache: &mut Option<RecVarModCache>) -> Option<Id> {
    let empty = &mut RecVarModCache::new();
    let seen: &mut RecVarModCache = cache.as_mut().unwrap_or(empty);

    recursive_var_mod(
        |actual_idx, _depth, _which_upward_ref, egraph| {
            Some(egraph.add(Lambda::Var(actual_idx + incr_by)))
        },
        false, // operate on Vars not IVars
        e,egraph,seen
    )
}
// useful to inline since callsite can usually tell which Shift type is happening allowing further optimization
useful to inline since callsite can usually tell which Shift type is happening allowing further optimization
useful to inline since callsite can usually tell which Shift type is happening allowing further optimization
pub fn shift(e: Id, incr_by: i32, egraph: &mut crate::EGraph, cache: &mut Option<RecVarModCache>) -> Option<Id> {
    let empty = &mut RecVarModCache::new();
    let seen: &mut RecVarModCache = cache.as_mut().unwrap_or(empty);
    recursive_var_mod(
        |actual_idx, _depth, _which_upward_ref, egraph| {
            Some(egraph.add(Lambda::Var(actual_idx + incr_by)))
        },
        false, // operate on Vars not IVars
        e,egraph,seen
    )
}
pub fn shift ( e : Id , incr_by : i32 , egraph : & mut crate :: EGraph , cache : & mut Option < RecVarModCache > ) -> Option < Id > { let empty = & mut RecVarModCache :: new ( ) ; let seen : & mut RecVarModCache = cache . as_mut ( ) . unwrap_or ( empty ) ; recursive_var_mod ( | actual_idx , _depth , _which_upward_ref , egraph | { Some ( egraph . add ( Lambda :: Var ( actual_idx + incr_by ) ) ) } , false , // operate on Vars not IVars e , egraph , seen ) }
useful to inline since callsite can usually tell which Shift type is happening allowing further optimization
useful to inline since callsite can usually tell which Shift type is happening allowing further optimization
e
Id
incr_by
i32
egraph
&mut crate::EGraph
cache
&mut Option<RecVarModCache>
e
Id
incr_by
i32
egraph
&mut crate::EGraph
cache
&mut Option<RecVarModCache>