Equations
Equations
Equations
- Lean.instBEqData = { beq := fun a b => a == b }
Equations
Equations
- Lean.Level.Data.hasMVar c = (UInt64.land (UInt64.shiftRight c 32) 1 == 1)
Equations
- Lean.Level.Data.hasParam c = (UInt64.land (UInt64.shiftRight c 33) 1 == 1)
def
Lean.Level.mkData
(h : UInt64)
(depth : optParam Nat 0)
(hasMVar : optParam Bool false)
(hasParam : optParam Bool false)
:
Equations
- Lean.Level.mkData h depth hasMVar hasParam = if depth > Nat.pow 2 24 - 1 then panicWithPosWithDecl "Lean.Level" "Lean.Level.mkData" 46 35 "universe level depth is too big" else let r := UInt32.toUInt64 (UInt64.toUInt32 h) + UInt64.shiftLeft (Bool.toUInt64 hasMVar) 32 + UInt64.shiftLeft (Bool.toUInt64 hasParam) 33 + UInt64.shiftLeft (Nat.toUInt64 depth) 40; r
Equations
- Lean.instReprData = { reprPrec := fun v prec => Id.run (let r := "Level.mkData " ++ toString (Lean.Level.Data.hash v); let _do_jp := fun r y => let _do_jp := fun r y => let _do_jp := fun r y => Repr.addAppParen (Std.Format.text r) prec; if Lean.Level.Data.hasParam v = true then let r := r ++ " (hasParam := " ++ toString (Lean.Level.Data.hasParam v) ++ ")"; do let y ← pure PUnit.unit _do_jp r y else do let y ← pure PUnit.unit _do_jp r y; if Lean.Level.Data.hasMVar v = true then let r := r ++ " (hasMVar := " ++ toString (Lean.Level.Data.hasMVar v) ++ ")"; do let y ← pure PUnit.unit _do_jp r y else do let y ← pure PUnit.unit _do_jp r y; if (Lean.Level.Data.depth v != 0) = true then let r := r ++ " (depth := " ++ toString (Lean.Level.Data.depth v) ++ ")"; do let y ← pure PUnit.unit _do_jp r y else do let y ← pure PUnit.unit _do_jp r y) }
Equations
- Lean.instBEqMVarId = { beq := [anonymous] }
Equations
- Lean.instInhabitedMVarId = { default := { name := default } }
Equations
- Lean.instHashableMVarId = { hash := [anonymous] }
Equations
- Lean.instReprMVarId = { reprPrec := [anonymous] }
Equations
- Lean.instReprMVarId_1 = { reprPrec := fun n p => reprPrec n.name p }
Equations
- Lean.MVarIdSet = Std.RBTree Lean.MVarId fun a a_1 => Lean.Name.quickCmp a.name a_1.name
Equations
- Lean.instForInMVarIdSetMVarId = inferInstanceAs (ForIn m (Std.RBTree Lean.MVarId fun a a_1 => Lean.Name.quickCmp a.name a_1.name) Lean.MVarId)
Equations
- Lean.MVarIdMap α = Std.RBMap Lean.MVarId α fun a a_1 => Lean.Name.quickCmp a.name a_1.name
Equations
- Lean.instEmptyCollectionMVarIdMap = inferInstanceAs (EmptyCollection (Std.RBMap Lean.MVarId α fun a a_1 => Lean.Name.quickCmp a.name a_1.name))
instance
Lean.instForInMVarIdMapProdMVarId
{m : Type u_1 → Type u_2}
{α : Type}
:
ForIn m (Lean.MVarIdMap α) (Lean.MVarId × α)
Equations
- Lean.instForInMVarIdMapProdMVarId = inferInstanceAs (ForIn m (Std.RBMap Lean.MVarId α fun a a_1 => Lean.Name.quickCmp a.name a_1.name) (Lean.MVarId × α))
- zero: Lean.Level.Data → Lean.Level
- succ: Lean.Level → Lean.Level.Data → Lean.Level
- max: Lean.Level → Lean.Level → Lean.Level.Data → Lean.Level
- imax: Lean.Level → Lean.Level → Lean.Level.Data → Lean.Level
- param: Lean.Name → Lean.Level.Data → Lean.Level
- mvar: Lean.MVarId → Lean.Level.Data → Lean.Level
Equations
- Lean.instInhabitedLevel = { default := Lean.Level.zero default }
Equations
- Lean.instReprLevel = { reprPrec := [anonymous] }
@[inline]
Equations
- Lean.Level.data x = match x with | Lean.Level.zero d => d | Lean.Level.mvar x d => d | Lean.Level.param x d => d | Lean.Level.succ x d => d | Lean.Level.max x x_1 d => d | Lean.Level.imax x x_1 d => d
Equations
Equations
- Lean.Level.instHashableLevel = { hash := Lean.Level.hash }
Equations
Equations
Equations
Equations
Equations
Equations
Equations
Equations
- Lean.levelZero = Lean.Level.zero (Lean.Level.mkData 2221 0 false)
Equations
- Lean.mkLevelMVar mvarId = Lean.Level.mvar mvarId (Lean.Level.mkData (mixHash 2237 (hash mvarId)) 0 true)
Equations
- Lean.mkLevelParam name = Lean.Level.param name (Lean.Level.mkData (mixHash 2239 (hash name)) 0 false true)
Equations
- Lean.mkLevelSucc u = Lean.Level.succ u (Lean.Level.mkData (mixHash 2243 (hash u)) (Lean.Level.depth u + 1) (Lean.Level.hasMVar u) (Lean.Level.hasParam u))
Equations
- Lean.mkLevelMax u v = Lean.Level.max u v (Lean.Level.mkData (mixHash 2251 (mixHash (hash u) (hash v))) (Nat.max (Lean.Level.depth u) (Lean.Level.depth v) + 1) (Lean.Level.hasMVar u || Lean.Level.hasMVar v) (Lean.Level.hasParam u || Lean.Level.hasParam v))
Equations
- Lean.mkLevelIMax u v = Lean.Level.imax u v (Lean.Level.mkData (mixHash 2267 (mixHash (hash u) (hash v))) (Nat.max (Lean.Level.depth u) (Lean.Level.depth v) + 1) (Lean.Level.hasMVar u || Lean.Level.hasMVar v) (Lean.Level.hasParam u || Lean.Level.hasParam v))
Equations
Equations
Equations
Equations
Equations
Equations
- Lean.Level.isZero x = match x with | Lean.Level.zero x => true | x => false
Equations
- Lean.Level.isSucc x = match x with | Lean.Level.succ x x_1 => true | x => false
Equations
- Lean.Level.isMax x = match x with | Lean.Level.max x x_1 x_2 => true | x => false
Equations
- Lean.Level.isIMax x = match x with | Lean.Level.imax x x_1 x_2 => true | x => false
Equations
- Lean.Level.isMaxIMax x = match x with | Lean.Level.max x x_1 x_2 => true | Lean.Level.imax x x_1 x_2 => true | x => false
Equations
- Lean.Level.isParam x = match x with | Lean.Level.param x x_1 => true | x => false
Equations
- Lean.Level.isMVar x = match x with | Lean.Level.mvar x x_1 => true | x => false
Equations
- Lean.Level.mvarId! x = match x with | Lean.Level.mvar mvarId x => mvarId | x => panicWithPosWithDecl "Lean.Level" "Lean.Level.mvarId!" 189 21 "metavariable expected"
Equations
- Lean.Level.isNeverZero (Lean.Level.zero x_1) = false
- Lean.Level.isNeverZero (Lean.Level.param x_1 x_2) = false
- Lean.Level.isNeverZero (Lean.Level.mvar x_1 x_2) = false
- Lean.Level.isNeverZero (Lean.Level.succ x_1 x_2) = true
- Lean.Level.isNeverZero (Lean.Level.max l₁ l₂ x_1) = (Lean.Level.isNeverZero l₁ || Lean.Level.isNeverZero l₂)
- Lean.Level.isNeverZero (Lean.Level.imax l₁ l₂ x_1) = Lean.Level.isNeverZero l₂
Equations
Equations
- Lean.Level.addOffsetAux 0 x = x
- Lean.Level.addOffsetAux (Nat.succ n) x = Lean.Level.addOffsetAux n (Lean.mkLevelSucc x)
Equations
Equations
Equations
- Lean.Level.getOffsetAux (Lean.Level.succ u x_2) x = Lean.Level.getOffsetAux u (x + 1)
- Lean.Level.getOffsetAux x x = x
Equations
- Lean.Level.getOffset lvl = Lean.Level.getOffsetAux lvl 0
Equations
- Lean.Level.getLevelOffset (Lean.Level.succ x_1 x_2) = Lean.Level.getLevelOffset x_1
- Lean.Level.getLevelOffset x = x
Equations
- Lean.Level.toNat lvl = match Lean.Level.getLevelOffset lvl with | Lean.Level.zero x => some (Lean.Level.getOffset lvl) | x => none
Equations
- Lean.Level.instBEqLevel = { beq := Lean.Level.beq }
Equations
- Lean.Level.occurs x (Lean.Level.succ v₁ x_2) = (x == Lean.Level.succ v₁ x_2 || Lean.Level.occurs x v₁)
- Lean.Level.occurs x (Lean.Level.max v₁ v₂ x_2) = (x == Lean.Level.max v₁ v₂ x_2 || Lean.Level.occurs x v₁ || Lean.Level.occurs x v₂)
- Lean.Level.occurs x (Lean.Level.imax v₁ v₂ x_2) = (x == Lean.Level.imax v₁ v₂ x_2 || Lean.Level.occurs x v₁ || Lean.Level.occurs x v₂)
- Lean.Level.occurs x x = (x == x)
Equations
- Lean.Level.ctorToNat x = match x with | Lean.Level.zero x => 0 | Lean.Level.param x x_1 => 1 | Lean.Level.mvar x x_1 => 2 | Lean.Level.succ x x_1 => 3 | Lean.Level.max x x_1 x_2 => 4 | Lean.Level.imax x x_1 x_2 => 5
Equations
- Lean.Level.normLt l₁ l₂ = Lean.Level.normLtAux l₁ 0 l₂ 0
Equations
- Lean.Level.isEquiv u v = (u == v || Lean.Level.normalize u == Lean.Level.normalize v)
Equations
- Lean.Level.dec (Lean.Level.zero x_1) = none
- Lean.Level.dec (Lean.Level.param x_1 x_2) = none
- Lean.Level.dec (Lean.Level.mvar x_1 x_2) = none
- Lean.Level.dec (Lean.Level.succ x_1 x_2) = some x_1
- Lean.Level.dec (Lean.Level.max l₁ l₂ x_1) = OptionM.run do let a ← Lean.Level.dec l₁ let a_1 ← Lean.Level.dec l₂ pure (Lean.mkLevelMax a a_1)
- Lean.Level.dec (Lean.Level.imax l₁ l₂ x_1) = OptionM.run do let a ← Lean.Level.dec l₁ let a_1 ← Lean.Level.dec l₂ pure (Lean.mkLevelMax a a_1)
- 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
Equations
- Lean.Level.PP.Result.succ x = match x with | Lean.Level.PP.Result.offset f k => Lean.Level.PP.Result.offset f (k + 1) | Lean.Level.PP.Result.num k => Lean.Level.PP.Result.num (k + 1) | f => Lean.Level.PP.Result.offset f 1
Equations
- Lean.Level.PP.Result.max x 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₂]
Equations
- Lean.Level.PP.Result.imax x 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₂]
Equations
- Lean.Level.PP.toResult (Lean.Level.zero a) = Lean.Level.PP.Result.num 0
- Lean.Level.PP.toResult (Lean.Level.succ a a_1) = Lean.Level.PP.Result.succ (Lean.Level.PP.toResult a)
- Lean.Level.PP.toResult (Lean.Level.max a a_1 a_2) = Lean.Level.PP.Result.max (Lean.Level.PP.toResult a) (Lean.Level.PP.toResult a_1)
- Lean.Level.PP.toResult (Lean.Level.imax a a_1 a_2) = Lean.Level.PP.Result.imax (Lean.Level.PP.toResult a) (Lean.Level.PP.toResult a_1)
- Lean.Level.PP.toResult (Lean.Level.param a a_1) = Lean.Level.PP.Result.leaf a
- Lean.Level.PP.toResult (Lean.Level.mvar a a_1) = let n := Lean.Name.replacePrefix a.name `_uniq (Lean.Name.mkSimple "?u"); Lean.Level.PP.Result.leaf n
Equations
Equations
- Lean.Level.instToFormatLevel = { format := fun u => Lean.Level.format u }
Equations
- Lean.Level.instToStringLevel = { toString := fun u => Lean.Format.pretty (Lean.Level.format u) }
Equations
- Lean.Level.quote u prec = Lean.Level.PP.Result.quote (Lean.Level.PP.toResult u) prec
Equations
- Lean.Level.instQuoteLevel = { quote := fun u => Lean.Level.quote u }
Equations
- Lean.mkLevelMax' u v = let subsumes := fun u v => if (Lean.Level.isExplicit v && decide (Lean.Level.getOffset u ≥ Lean.Level.getOffset v)) = true then true else match u with | Lean.Level.max u₁ u₂ x => v == u₁ || v == u₂ | x => false; if (u == v) = true then u else if Lean.Level.isZero u = true then v else if Lean.Level.isZero v = true then u else if subsumes u v = true then u else if subsumes v u = true then v else if (Lean.Level.getLevelOffset u == Lean.Level.getLevelOffset v) = true then if Lean.Level.getOffset u ≥ Lean.Level.getOffset v then u else v else Lean.mkLevelMax u v
Equations
- Lean.mkLevelIMax' u v = if Lean.Level.isNeverZero v = true then Lean.mkLevelMax' u v else if Lean.Level.isZero v = true then v else if Lean.Level.isZero u = true then v else if (u == v) = true then u else Lean.mkLevelIMax u v
@[extern lean_level_update_succ]
def
Lean.Level.updateSucc
(lvl : Lean.Level)
(newLvl : Lean.Level)
(h : Lean.Level.isSucc lvl = true)
:
Equations
- Lean.Level.updateSucc lvl newLvl h = Lean.mkLevelSucc newLvl
@[inline]
Equations
- Lean.Level.updateSucc! lvl newLvl = match lvl with | Lean.Level.succ lvl d => Lean.Level.updateSucc (Lean.Level.succ lvl d) newLvl (_ : Lean.Level.isSucc (Lean.Level.succ lvl d) = Lean.Level.isSucc (Lean.Level.succ lvl d)) | x => panicWithPosWithDecl "Lean.Level" "Lean.Level.updateSucc!" 519 18 "succ level expected"
@[extern lean_level_update_max]
def
Lean.Level.updateMax
(lvl : Lean.Level)
(newLhs : Lean.Level)
(newRhs : Lean.Level)
(h : Lean.Level.isMax lvl = true)
:
Equations
- Lean.Level.updateMax lvl newLhs newRhs h = Lean.mkLevelMax' newLhs newRhs
@[inline]
Equations
- Lean.Level.updateMax! lvl newLhs newRhs = match lvl with | Lean.Level.max lhs rhs d => Lean.Level.updateMax (Lean.Level.max lhs rhs d) newLhs newRhs (_ : Lean.Level.isMax (Lean.Level.max lhs rhs d) = Lean.Level.isMax (Lean.Level.max lhs rhs d)) | x => panicWithPosWithDecl "Lean.Level" "Lean.Level.updateMax!" 528 21 "max level expected"
@[extern lean_level_update_imax]
def
Lean.Level.updateIMax
(lvl : Lean.Level)
(newLhs : Lean.Level)
(newRhs : Lean.Level)
(h : Lean.Level.isIMax lvl = true)
:
Equations
- Lean.Level.updateIMax lvl newLhs newRhs h = Lean.mkLevelIMax' newLhs newRhs
@[inline]
Equations
- Lean.Level.updateIMax! lvl newLhs newRhs = match lvl with | Lean.Level.imax lhs rhs d => Lean.Level.updateIMax (Lean.Level.imax lhs rhs d) newLhs newRhs (_ : Lean.Level.isIMax (Lean.Level.imax lhs rhs d) = Lean.Level.isIMax (Lean.Level.imax lhs rhs d)) | x => panicWithPosWithDecl "Lean.Level" "Lean.Level.updateIMax!" 537 22 "imax level expected"
Equations
- Lean.Level.mkNaryMax [] = Lean.levelZero
- Lean.Level.mkNaryMax [u] = u
- Lean.Level.mkNaryMax (u :: us) = Lean.mkLevelMax' u (Lean.Level.mkNaryMax us)
@[specialize]
@[inline]
Equations
@[inline]
Equations
@[inline]
Equations
Equations
- Lean.Level.collectMVars (Lean.Level.succ v x) s = Lean.Level.collectMVars v s
- Lean.Level.collectMVars (Lean.Level.max u_2 v x) s = Lean.Level.collectMVars u_2 (Lean.Level.collectMVars v s)
- Lean.Level.collectMVars (Lean.Level.imax u_2 v x) s = Lean.Level.collectMVars u_2 (Lean.Level.collectMVars v s)
- Lean.Level.collectMVars (Lean.Level.mvar n x) s = Std.RBTree.insert s n
- Lean.Level.collectMVars u s = s
Equations
- Lean.Level.find? u p = (fun visit => visit u) (Lean.Level.find?.visit p)
Equations
- Lean.Level.find?.visit p (Lean.Level.succ v x) = if p (Lean.Level.succ v x) = true then pure (Lean.Level.succ v x) else Lean.Level.find?.visit p v
- Lean.Level.find?.visit p (Lean.Level.max u_2 v x) = if p (Lean.Level.max u_2 v x) = true then pure (Lean.Level.max u_2 v x) else HOrElse.hOrElse (Lean.Level.find?.visit p u_2) fun x => Lean.Level.find?.visit p v
- Lean.Level.find?.visit p (Lean.Level.imax u_2 v x) = if p (Lean.Level.imax u_2 v x) = true then pure (Lean.Level.imax u_2 v x) else HOrElse.hOrElse (Lean.Level.find?.visit p u_2) fun x => Lean.Level.find?.visit p v
- Lean.Level.find?.visit p u = if p u = true then pure u else failure
Equations
- Lean.Level.any u p = Option.isSome (Lean.Level.find? u p)
@[inline]