pub enum Level {
Zero,
Succ(Box<Level>),
Max(Box<Level>, Box<Level>),
IMax(Box<Level>, Box<Level>),
Param(Name),
MVar(LevelMVarId),
}Expand description
A universe level.
Levels form expressions over zero, successor, max, imax, parameters, and metavariables.
Variants§
Zero
Level 0 (Prop).
Succ(Box<Level>)
Successor: u + 1.
Max(Box<Level>, Box<Level>)
Maximum of two levels: max(u, v).
IMax(Box<Level>, Box<Level>)
Impredicative maximum: imax(u, v).
Semantics: imax(u, v) = 0 if v = 0, else max(u, v). This ensures Prop -> Prop : Prop (impredicativity).
Param(Name)
Universe parameter (for polymorphism).
MVar(LevelMVarId)
Universe metavariable (for unification).
Implementations§
Source§impl Level
impl Level
Sourcepub fn mvar(id: LevelMVarId) -> Self
pub fn mvar(id: LevelMVarId) -> Self
Create a level metavariable.
Sourcepub fn is_not_zero(&self) -> bool
pub fn is_not_zero(&self) -> bool
Check if this level is definitely not zero.
Returns true if we can statically determine this is >= 1.
Trait Implementations§
impl Eq for Level
impl StructuralPartialEq for Level
Auto Trait Implementations§
impl Freeze for Level
impl RefUnwindSafe for Level
impl Send for Level
impl Sync for Level
impl Unpin for Level
impl UnsafeUnpin for Level
impl UnwindSafe for Level
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