pub(crate) struct LocalVarEnv {
local_var_gen: IndexGen<LocalVar>,
fvars: UnordMap<Name, LocalVar>,
layers: Vec<Vec<LocalVar>>,
pub(crate) reverse_map: UnordMap<LocalVar, Expr>,
pretty_var_map: PrettyMap<LocalVar>,
}Expand description
Environment used to map from rty::Var to a fixpoint::LocalVar.
Fields§
§local_var_gen: IndexGen<LocalVar>§fvars: UnordMap<Name, LocalVar>§layers: Vec<Vec<LocalVar>>Layers of late bound variables
reverse_map: UnordMap<LocalVar, Expr>While it might seem like the signature should be
[UnordMap<fixpoint::LocalVar, rty::Var>], we encode the arguments to
kvars (which can be arbitrary expressions) as local variables; thus we
need to keep the output as an rty::Expr to reflect this.
pretty_var_map: PrettyMap<LocalVar>Implementations§
Source§impl LocalVarEnv
impl LocalVarEnv
fn new() -> Self
pub(crate) fn fresh_name(&mut self) -> LocalVar
fn insert_fvar_map( &mut self, name: Name, provenance: NameProvenance, ) -> LocalVar
fn remove_fvar_map(&mut self, name: Name)
Sourcefn push_layer_with_fresh_names(&mut self, count: usize)
fn push_layer_with_fresh_names(&mut self, count: usize)
Push a layer of bound variables assigning a fresh fixpoint::LocalVar to each one
fn push_layer(&mut self, layer: Vec<LocalVar>)
fn pop_layer(&mut self) -> Vec<LocalVar>
fn get_fvar(&self, name: Name) -> Option<LocalVar>
fn get_late_bvar( &self, debruijn: DebruijnIndex, var: BoundVar, ) -> Option<LocalVar>
Auto Trait Implementations§
impl !Freeze for LocalVarEnv
impl DynSend for LocalVarEnv
impl DynSync for LocalVarEnv
impl RefUnwindSafe for LocalVarEnv
impl Send for LocalVarEnv
impl Sync for LocalVarEnv
impl Unpin for LocalVarEnv
impl UnsafeUnpin for LocalVarEnv
impl UnwindSafe for LocalVarEnv
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more