Cached hash code, cached results, and other data for Level
.
hash : 32-bits
hasMVar : 1-bit
hasParam : 1-bit
depth : 24-bits
Equations
Instances For
Equations
Equations
- c.hash = (UInt64.toUInt32 c).toUInt64
Instances For
Equations
- Lean.instBEqData = { beq := fun (a b : UInt64) => a == b }
Equations
- c.depth = (UInt64.shiftRight c 40).toUInt32
Instances For
Equations
- c.hasMVar = ((UInt64.shiftRight c 32).land 1 == 1)
Instances For
Equations
- c.hasParam = ((UInt64.shiftRight c 33).land 1 == 1)
Instances For
Equations
- One or more equations did not get rendered due to their size.
Equations
- Lean.instInhabitedLevelMVarId = { default := { name := default } }
Equations
- Lean.instBEqLevelMVarId = { beq := Lean.beqLevelMVarId✝ }
Equations
- Lean.instHashableLevelMVarId = { hash := Lean.hashLevelMVarId✝ }
Equations
- Lean.instReprLevelMVarId = { reprPrec := Lean.reprLevelMVarId✝ }
Equations
- Lean.instReprLMVarId = { reprPrec := fun (n : Lean.LMVarId) (p : Nat) => reprPrec n.name p }
Equations
- Lean.LMVarIdSet = Lean.RBTree Lean.LMVarId fun (x x_1 : Lean.LMVarId) => x.name.quickCmp x_1.name
Instances For
Equations
- Lean.instForInLMVarIdSetLMVarId = inferInstanceAs (ForIn m (Lean.RBTree Lean.LMVarId fun (x x_1 : Lean.LMVarId) => x.name.quickCmp x_1.name) Lean.LMVarId)
Equations
- Lean.LMVarIdMap α = Lean.RBMap Lean.LMVarId α fun (x x_1 : Lean.LMVarId) => x.name.quickCmp x_1.name
Instances For
Equations
- Lean.instEmptyCollectionLMVarIdMap = inferInstanceAs (EmptyCollection (Lean.RBMap Lean.LMVarId α fun (x x_1 : Lean.LMVarId) => x.name.quickCmp x_1.name))
instance
Lean.instForInLMVarIdMapProdLMVarId
{m : Type u_1 → Type u_2}
{α : Type}
:
ForIn m (Lean.LMVarIdMap α) (Lean.LMVarId × α)
Equations
- Lean.instForInLMVarIdMapProdLMVarId = inferInstanceAs (ForIn m (Lean.RBMap Lean.LMVarId α fun (x x_1 : Lean.LMVarId) => x.name.quickCmp x_1.name) (Lean.LMVarId × α))
- zero: Lean.Level
- succ: Lean.Level → Lean.Level
- max: Lean.Level → Lean.Level → Lean.Level
- imax: Lean.Level → Lean.Level → Lean.Level
- param: Lake.Name → Lean.Level
- mvar: Lean.LMVarId → Lean.Level
Instances For
@[implemented_by Lean.Level.data._override]
Equations
- One or more equations did not get rendered due to their size.
- Lean.Level.zero.data = Lean.Level.mkData 2221
- (Lean.Level.mvar mvarId).data = Lean.Level.mkData (mixHash 2237 (hash mvarId)) 0 true
- (Lean.Level.param name).data = Lean.Level.mkData (mixHash 2239 (hash name)) 0 false true
- u.succ.data = Lean.Level.mkData (mixHash 2243 u.data.hash) (u.data.depth.toNat + 1) u.data.hasMVar u.data.hasParam
Instances For
Equations
- Lean.instInhabitedLevel = { default := Lean.Level.zero }
Equations
- Lean.instReprLevel = { reprPrec := Lean.reprLevel✝ }
Equations
- Lean.Level.instHashable = { hash := Lean.Level.hash }
Equations
- u.hasParam = u.data.hasParam
Instances For
@[export lean_level_hash]
Instances For
@[export lean_level_has_mvar]
Equations
Instances For
@[export lean_level_has_param]
Equations
Instances For
Equations
- Lean.mkLevelMVar mvarId = Lean.Level.mvar mvarId
Instances For
Equations
- Lean.mkLevelParam name = Lean.Level.param name
Instances For
Equations
- Lean.mkLevelSucc u = u.succ
Instances For
Equations
- Lean.mkLevelMax u v = u.max v
Instances For
Equations
- Lean.mkLevelIMax u v = u.imax v
Instances For
Equations
Instances For
@[export lean_level_mk_zero]
Equations
Instances For
@[export lean_level_mk_succ]
Equations
Instances For
@[export lean_level_mk_mvar]
Equations
Instances For
@[export lean_level_mk_param]
Equations
Instances For
@[export lean_level_mk_max]
Equations
Instances For
@[export lean_level_mk_imax]
Equations
Instances For
Equations
- x.isZero = match x with | Lean.Level.zero => true | x => false
Instances For
Instances For
Instances For
Instances For
Instances For
Equations
- x.isParam = match x with | Lean.Level.param a => true | x => false
Instances For
Equations
- x.isMVar = match x with | Lean.Level.mvar a => true | x => false
Instances For
Equations
- x.mvarId! = match x with | Lean.Level.mvar mvarId => mvarId | x => panicWithPosWithDecl "Lean.Level" "Lean.Level.mvarId!" 194 19 "metavariable expected"
Instances For
If result is true, then forall assignments A
which assigns all parameters and metavariables occurring
in l
, l[A] != zero
Equations
- Lean.Level.zero.isNeverZero = false
- (Lean.Level.param a).isNeverZero = false
- (Lean.Level.mvar a).isNeverZero = false
- a.succ.isNeverZero = true
- (l₁.max l₂).isNeverZero = (l₁.isNeverZero || l₂.isNeverZero)
- (a.imax l₂).isNeverZero = l₂.isNeverZero
Instances For
Equations
Instances For
Equations
- Lean.Level.instOfNat n = { ofNat := Lean.Level.ofNat n }
Equations
- Lean.Level.addOffsetAux 0 x = x
- Lean.Level.addOffsetAux n.succ x = Lean.Level.addOffsetAux n (Lean.mkLevelSucc x)
Instances For
Equations
- u.addOffset n = Lean.Level.addOffsetAux n u
Instances For
Equations
Instances For
Instances For
Equations
- lvl.getOffset = lvl.getOffsetAux 0
Instances For
Instances For
Equations
- lvl.toNat = match lvl.getLevelOffset with | Lean.Level.zero => some lvl.getOffset | x => none
Instances For
Equations
- Lean.Level.instBEq = { beq := Lean.Level.beq }
Equations
- x.ctorToNat = match x with | Lean.Level.zero => 0 | Lean.Level.param a => 1 | Lean.Level.mvar a => 2 | a.succ => 3 | a.max a_1 => 4 | a.imax a_1 => 5
Instances For
@[irreducible]
Instances For
Return true if u
and v
denote the same level.
Check is currently incomplete.
Instances For
Reduce (if possible) universe level by 1
Equations
- Lean.Level.zero.dec = none
- (Lean.Level.param a).dec = none
- (Lean.Level.mvar a).dec = none
- a.succ.dec = some a
- (l₁.max l₂).dec = do let __do_lift ← l₁.dec let __do_lift_1 ← l₂.dec pure (Lean.mkLevelMax __do_lift __do_lift_1)
- (a.imax l₂).dec = do let __do_lift ← a.dec let __do_lift_1 ← l₂.dec pure (Lean.mkLevelMax __do_lift __do_lift_1)
Instances For
- leaf: Lake.Name → Lean.Level.PP.Result
- num: Nat → Lean.Level.PP.Result
- offset: Lean.Level.PP.Result → Nat → Lean.Level.PP.Result
- maxNode: List Lean.Level.PP.Result → Lean.Level.PP.Result
- imaxNode: List Lean.Level.PP.Result → Lean.Level.PP.Result
Instances For
Equations
- x.succ = match x with | f.offset k => f.offset (k + 1) | Lean.Level.PP.Result.num k => Lean.Level.PP.Result.num (k + 1) | f => f.offset 1
Instances For
Equations
- x✝.max x = match x✝, x with | f, Lean.Level.PP.Result.maxNode Fs => Lean.Level.PP.Result.maxNode (f :: Fs) | f₁, f₂ => Lean.Level.PP.Result.maxNode [f₁, f₂]
Instances For
Equations
- x✝.imax x = match x✝, x with | f, Lean.Level.PP.Result.imaxNode Fs => Lean.Level.PP.Result.imaxNode (f :: Fs) | f₁, f₂ => Lean.Level.PP.Result.imaxNode [f₁, f₂]
Instances For
Equations
- Lean.Level.PP.toResult Lean.Level.zero mvars = Lean.Level.PP.Result.num 0
- Lean.Level.PP.toResult a.succ mvars = (Lean.Level.PP.toResult a mvars).succ
- Lean.Level.PP.toResult (a.max a_1) mvars = (Lean.Level.PP.toResult a mvars).max (Lean.Level.PP.toResult a_1 mvars)
- Lean.Level.PP.toResult (a.imax a_1) mvars = (Lean.Level.PP.toResult a mvars).imax (Lean.Level.PP.toResult a_1 mvars)
- Lean.Level.PP.toResult (Lean.Level.param a) mvars = Lean.Level.PP.Result.leaf a
- Lean.Level.PP.toResult (Lean.Level.mvar a) mvars = if mvars = true then Lean.Level.PP.Result.leaf (a.name.replacePrefix `_uniq (Lean.Name.mkSimple "?u")) else Lean.Level.PP.Result.leaf `_
Instances For
Equations
- u.format mvars = (Lean.Level.PP.toResult u mvars).format true
Instances For
Equations
- Lean.Level.instToFormat = { format := fun (u : Lean.Level) => u.format true }
Equations
- Lean.Level.instToString = { toString := fun (u : Lean.Level) => (Std.format u).pretty }
Equations
- u.quote prec mvars = (Lean.Level.PP.toResult u mvars).quote prec
Instances For
Equations
- Lean.Level.instQuoteMkStr1 = { quote := fun (u : Lean.Level) => u.quote }
Equations
- Lean.mkLevelMax' u v = Lean.mkLevelMaxCore u v fun (x : Unit) => Lean.mkLevelMax u v
Instances For
Equations
- Lean.simpLevelMax' u v d = Lean.mkLevelMaxCore u v fun (x : Unit) => d
Instances For
Equations
- Lean.mkLevelIMax' u v = Lean.mkLevelIMaxCore u v fun (x : Unit) => Lean.mkLevelIMax u v
Instances For
Equations
- Lean.simpLevelIMax' u v d = Lean.mkLevelIMaxCore u v fun (x : Unit) => d
Instances For
The update functions try to avoid allocating new values using pointer equality.
Note that if the update*!
functions are used under a match-expression,
the compiler will eliminate the double-match.
@[implemented_by _private.Lean.Level.0.Lean.Level.updateSucc!Impl]
Equations
- lvl.updateSucc! newLvl = match lvl with | a.succ => Lean.mkLevelSucc newLvl | x => panicWithPosWithDecl "Lean.Level" "Lean.Level.updateSucc!" 547 14 "succ level expected"
Instances For
@[implemented_by _private.Lean.Level.0.Lean.Level.updateMax!Impl]
Equations
- lvl.updateMax! newLhs newRhs = match lvl with | a.max a_1 => Lean.mkLevelMax' newLhs newRhs | x => panicWithPosWithDecl "Lean.Level" "Lean.Level.updateMax!" 558 15 "max level expected"
Instances For
@[implemented_by _private.Lean.Level.0.Lean.Level.updateIMax!Impl]
Equations
- lvl.updateIMax! newLhs newRhs = match lvl with | a.imax a_1 => Lean.mkLevelIMax' newLhs newRhs | x => panicWithPosWithDecl "Lean.Level" "Lean.Level.updateIMax!" 569 16 "imax level expected"
Instances For
Equations
- Lean.Level.mkNaryMax [] = Lean.levelZero
- Lean.Level.mkNaryMax [u] = u
- Lean.Level.mkNaryMax (u :: us) = Lean.mkLevelMax' u (Lean.Level.mkNaryMax us)
Instances For
Instances For
Equations
- Lean.Level.getParamSubst (p :: ps) (u :: us) x = if (p == x) = true then some u else Lean.Level.getParamSubst ps us x
- Lean.Level.getParamSubst x✝¹ x✝ x = none
Instances For
def
Lean.Level.instantiateParams
(u : Lean.Level)
(paramNames : List Lake.Name)
(vs : List Lean.Level)
:
Equations
- u.instantiateParams paramNames vs = u.substParams (Lean.Level.getParamSubst paramNames vs)
Instances For
Equations
- u.geq v = Lean.Level.geq.go u.normalize v.normalize
Instances For
@[irreducible]
Equations
- Lean.Level.geq.go u Lean.Level.zero = (u == Lean.Level.zero || true)
- Lean.Level.geq.go u (v₁.max v₂) = (u == v₁.max v₂ || Lean.Level.geq.go u v₁ && Lean.Level.geq.go u v₂)
- Lean.Level.geq.go (u₁.max u₂) v = (u₁.max u₂ == v || (Lean.Level.geq.go u₁ v || Lean.Level.geq.go u₂ v))
- Lean.Level.geq.go u (v₁.imax v₂) = (u == v₁.imax v₂ || Lean.Level.geq.go u v₁ && Lean.Level.geq.go u v₂)
- Lean.Level.geq.go (a.imax u₂) v = (a.imax u₂ == v || Lean.Level.geq.go u₂ v)
- Lean.Level.geq.go u_2.succ v_2.succ = (u_2.succ == v_2.succ || Lean.Level.geq.go u_2 v_2)
- Lean.Level.geq.go u v = (u == v || let v' := v.getLevelOffset; (u.getLevelOffset == v' || v'.isZero) && decide (u.getOffset ≥ v.getOffset))
Instances For
@[reducible, inline]
Equations
Instances For
@[reducible, inline]
Equations
Instances For
@[reducible, inline]
Equations
Instances For
@[reducible, inline]
Equations
Instances For
@[reducible, inline]
Equations
Instances For
Equations
- v.succ.collectMVars s = v.collectMVars s
- (u_2.max v).collectMVars s = u_2.collectMVars (v.collectMVars s)
- (u_2.imax v).collectMVars s = u_2.collectMVars (v.collectMVars s)
- (Lean.Level.mvar n).collectMVars s = Lean.RBTree.insert s n
- u.collectMVars s = s
Instances For
Equations
- u.find? p = Lean.Level.find?.visit p u
Instances For
Equations
- Lean.Level.find?.visit p v.succ = if p v.succ = true then pure v.succ else Lean.Level.find?.visit p v
- Lean.Level.find?.visit p (u_2.max v) = if p (u_2.max v) = true then pure (u_2.max v) else HOrElse.hOrElse (Lean.Level.find?.visit p u_2) fun (x : Unit) => Lean.Level.find?.visit p v
- Lean.Level.find?.visit p (u_2.imax v) = if p (u_2.imax v) = true then pure (u_2.imax v) else HOrElse.hOrElse (Lean.Level.find?.visit p u_2) fun (x : Unit) => Lean.Level.find?.visit p v
- Lean.Level.find?.visit p u = if p u = true then pure u else failure
Instances For
Equations
- u.any p = (u.find? p).isSome