@[inline]
Equations
@[inline]
Equations
- Lean.Expr.FindImpl.visited e size = do let s ← get let h : USize := ptrAddrUnsafe e let i : USize := h % size let k : Lean.Expr := Array.uget s.keys i (_ : USize.toNat (ptrAddrUnsafe e % size) < Array.size s.keys) if (ptrAddrUnsafe k == h) = true then pure true else do modify fun s => { keys := Array.uset s.keys i e (_ : USize.toNat (ptrAddrUnsafe e % size) < Array.size s.keys) } pure false
Equations
- Lean.Expr.FindImpl.findM? p size e = (fun visit => visit e) (Lean.Expr.FindImpl.findM?.visit p size)
Equations
- Lean.Expr.FindImpl.findM?.visit p size e = do let a ← liftM (Lean.Expr.FindImpl.visited e size) if a = true then failure else if p e = true then pure e else match e with | Lean.Expr.forallE x d b x_1 => HOrElse.hOrElse (Lean.Expr.FindImpl.findM?.visit p size d) fun x => Lean.Expr.FindImpl.findM?.visit p size b | Lean.Expr.lam x d b x_1 => HOrElse.hOrElse (Lean.Expr.FindImpl.findM?.visit p size d) fun x => Lean.Expr.FindImpl.findM?.visit p size b | Lean.Expr.mdata x b x_1 => Lean.Expr.FindImpl.findM?.visit p size b | Lean.Expr.letE x t v b x_1 => HOrElse.hOrElse (Lean.Expr.FindImpl.findM?.visit p size t) fun x => HOrElse.hOrElse (Lean.Expr.FindImpl.findM?.visit p size v) fun x => Lean.Expr.FindImpl.findM?.visit p size b | Lean.Expr.app f a x => HOrElse.hOrElse (Lean.Expr.FindImpl.findM?.visit p size f) fun x => Lean.Expr.FindImpl.findM?.visit p size a | Lean.Expr.proj x x_1 b x_2 => Lean.Expr.FindImpl.findM?.visit p size b | e => failure
Equations
Equations
- Lean.Expr.occurs e t = Option.isSome (Lean.Expr.find? (fun s => s == e) t)