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.
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 (x1 x2 : Lean.LMVarId) => x1.name.quickCmp x2.name
Instances For
Equations
- Lean.instLMVarIdSetInhabited = Lean.instInhabitedRBTree
Equations
- Lean.instLMVarIdSetEmptyCollection = Lean.instEmptyCollectionRBTree Lean.LMVarId fun (x1 x2 : Lean.LMVarId) => x1.name.quickCmp x2.name
Equations
- Lean.instForInLMVarIdSetLMVarId = inferInstanceAs (ForIn m (Lean.RBTree Lean.LMVarId fun (x1 x2 : Lean.LMVarId) => x1.name.quickCmp x2.name) Lean.LMVarId)
Equations
- Lean.LMVarIdMap α = Lean.RBMap Lean.LMVarId α fun (x1 x2 : Lean.LMVarId) => x1.name.quickCmp x2.name
Instances For
Equations
- Lean.instEmptyCollectionLMVarIdMap = inferInstanceAs (EmptyCollection (Lean.RBMap Lean.LMVarId α fun (x1 x2 : Lean.LMVarId) => x1.name.quickCmp x2.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 (x1 x2 : Lean.LMVarId) => x1.name.quickCmp x2.name) (Lean.LMVarId × α))
@[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
- zero : Lean.Level
- succ : Lean.Level → Lean.Level
- max : Lean.Level → Lean.Level → Lean.Level
- imax : Lean.Level → Lean.Level → Lean.Level
- param : Lean.Name → Lean.Level
- mvar : Lean.LMVarId → Lean.Level
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
- Lean.Level.zero.isZero = true
- x✝.isZero = false
Instances For
Instances For
Instances For
Instances For
Instances For
Equations
- (Lean.Level.param a).isParam = true
- x✝.isParam = false
Instances For
Equations
- (Lean.Level.mvar a).isMVar = true
- x✝.isMVar = false
Instances For
Equations
- (Lean.Level.mvar a).mvarId! = a
- x✝.mvarId! = 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
- Lean.Level.zero.ctorToNat = 0
- (Lean.Level.param a).ctorToNat = 1
- (Lean.Level.mvar a).ctorToNat = 2
- a.succ.ctorToNat = 3
- (l₁.max l₂).ctorToNat = 4
- (a.imax l₂).ctorToNat = 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 : Lean.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
- (f.offset k).succ = f.offset (k + 1)
- (Lean.Level.PP.Result.num k).succ = Lean.Level.PP.Result.num (k + 1)
- x✝.succ = x✝.offset 1
Instances For
Equations
- x✝.max (Lean.Level.PP.Result.maxNode Fs) = Lean.Level.PP.Result.maxNode (x✝ :: Fs)
- x✝¹.max x✝ = Lean.Level.PP.Result.maxNode [x✝¹, x✝]
Instances For
Equations
- x✝.imax (Lean.Level.PP.Result.imaxNode Fs) = Lean.Level.PP.Result.imaxNode (x✝ :: Fs)
- x✝¹.imax x✝ = Lean.Level.PP.Result.imaxNode [x✝¹, x✝]
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) => (Lean.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
- a.succ.updateSucc! newLvl = Lean.mkLevelSucc newLvl
- lvl.updateSucc! newLvl = panicWithPosWithDecl "Lean.Level" "Lean.Level.updateSucc!" 547 14 "succ level expected"
Instances For
@[implemented_by _private.Lean.Level.0.Lean.Level.updateMax!Impl]
Equations
- (a.max a_1).updateMax! newLhs newRhs = Lean.mkLevelMax' newLhs newRhs
- lvl.updateMax! newLhs newRhs = panicWithPosWithDecl "Lean.Level" "Lean.Level.updateMax!" 558 15 "max level expected"
Instances For
@[implemented_by _private.Lean.Level.0.Lean.Level.updateIMax!Impl]
Equations
- (a.imax a_1).updateIMax! newLhs newRhs = Lean.mkLevelIMax' newLhs newRhs
- lvl.updateIMax! newLhs newRhs = 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
Equations
- Lean.Level.substParams.go s Lean.Level.zero = Lean.Level.zero
- Lean.Level.substParams.go s v.succ = if v.succ.hasParam = true then v.succ.updateSucc! (Lean.Level.substParams.go s v) else v.succ
- Lean.Level.substParams.go s (v₁.max v₂) = if (v₁.max v₂).hasParam = true then (v₁.max v₂).updateMax! (Lean.Level.substParams.go s v₁) (Lean.Level.substParams.go s v₂) else v₁.max v₂
- Lean.Level.substParams.go s (v₁.imax v₂) = if (v₁.imax v₂).hasParam = true then (v₁.imax v₂).updateIMax! (Lean.Level.substParams.go s v₁) (Lean.Level.substParams.go s v₂) else v₁.imax v₂
- Lean.Level.substParams.go s (Lean.Level.param n) = match s n with | some u' => u' | none => Lean.Level.param n
- Lean.Level.substParams.go s u = u
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 Lean.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
@[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 Lean.Level.find?.visit p u_2 <|> 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 Lean.Level.find?.visit p u_2 <|> 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