pub enum CoreVariable<L: Language> {
UniversalVar(CoreUniversalVar<L>),
ExistentialVar(CoreExistentialVar<L>),
BoundVar(CoreBoundVar<L>),
}Expand description
A term representing a variable.
Variants§
UniversalVar(CoreUniversalVar<L>)
A “universal free variable” is a variable that appears free in all terms because it is bound in the environment. Universal means that it arose from a “forall” binder. Universal variables are a kind of placeholder meant to represent “some value” about which you know nothing except what you are told to assume.
ExistentialVar(CoreExistentialVar<L>)
An “existential free variable” is a variable that appears free in all terms because it is bound in the environment. Existential means that it arose from a “exists” binder. Existential variables are a kind of placeholder for which you will eventually find some specific value, so the rules typically accumulate constraints.
BoundVar(CoreBoundVar<L>)
A bound variable is one that is bound by some enclosing Binder
in this term (or a binder about to be constructex; see fresh_bound_var).
Implementations§
Source§impl<L: Language> CoreVariable<L>
impl<L: Language> CoreVariable<L>
pub fn kind(&self) -> CoreKind<L>
Sourcepub fn shift_in(&self) -> Self
pub fn shift_in(&self) -> Self
Shift a variable in through binders binding levels.
Only affects bound variables.
Sourcepub fn shift_out(&self) -> Option<Self>
pub fn shift_out(&self) -> Option<Self>
Shift a variable out through binders binding levels.
Only affects bound variables. Returns None if the variable
is bound within those binding levels.
Sourcepub fn is_free(&self) -> bool
pub fn is_free(&self) -> bool
A variable is free (i.e., not bound by any internal binder)
if it is an existential variable, a universal, or has a debruijn
index of None. The latter occurs when you open a binder (and before
you close it back up again).
pub fn is_universal(&self) -> bool
Trait Implementations§
Source§impl<L: Clone + Language> Clone for CoreVariable<L>
impl<L: Clone + Language> Clone for CoreVariable<L>
Source§fn clone(&self) -> CoreVariable<L>
fn clone(&self) -> CoreVariable<L>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl<L: Copy + Language> Copy for CoreVariable<L>
Source§impl<L: Language> CoreVisit<L> for CoreVariable<L>
impl<L: Language> CoreVisit<L> for CoreVariable<L>
Source§fn free_variables(&self) -> Vec<CoreVariable<L>>
fn free_variables(&self) -> Vec<CoreVariable<L>>
Variable::is_free).
The list may contain duplicates and must be in a determinstic order (though the order itself isn’t important).Source§fn size(&self) -> usize
fn size(&self) -> usize
Source§fn assert_valid(&self)
fn assert_valid(&self)
Source§fn references_only_universal_variables(&self) -> bool
fn references_only_universal_variables(&self) -> bool
Source§impl<L: Language> Debug for CoreVariable<L>
impl<L: Language> Debug for CoreVariable<L>
Source§impl<L: Language> DowncastTo<CoreBoundVar<L>> for CoreVariable<L>
impl<L: Language> DowncastTo<CoreBoundVar<L>> for CoreVariable<L>
fn downcast_to(&self) -> Option<CoreBoundVar<L>>
Source§impl<L: Language> DowncastTo<CoreExistentialVar<L>> for CoreVariable<L>
impl<L: Language> DowncastTo<CoreExistentialVar<L>> for CoreVariable<L>
fn downcast_to(&self) -> Option<CoreExistentialVar<L>>
Source§impl<L: Language> DowncastTo<CoreUniversalVar<L>> for CoreVariable<L>
impl<L: Language> DowncastTo<CoreUniversalVar<L>> for CoreVariable<L>
fn downcast_to(&self) -> Option<CoreUniversalVar<L>>
Source§impl<L: Language> DowncastTo<CoreVariable<L>> for CoreVariable<L>
impl<L: Language> DowncastTo<CoreVariable<L>> for CoreVariable<L>
fn downcast_to(&self) -> Option<CoreVariable<L>>
impl<L: Eq + Language> Eq for CoreVariable<L>
Source§impl<L: Language> Index<CoreVariable<L>> for CoreSubstitution<L>
impl<L: Language> Index<CoreVariable<L>> for CoreSubstitution<L>
Source§impl<L: Ord + Language> Ord for CoreVariable<L>
impl<L: Ord + Language> Ord for CoreVariable<L>
Source§fn cmp(&self, other: &CoreVariable<L>) -> Ordering
fn cmp(&self, other: &CoreVariable<L>) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl<L: PartialEq + Language> PartialEq for CoreVariable<L>
impl<L: PartialEq + Language> PartialEq for CoreVariable<L>
Source§fn eq(&self, other: &CoreVariable<L>) -> bool
fn eq(&self, other: &CoreVariable<L>) -> bool
self and other values to be equal, and is used by ==.