ruc-ai4math/mathlib_handler_benchmark_410 huggingface dataset:
File: .lake/packages/lean4/src/lean/Lean/Util/FindExpr.lean

full_name: Lean.Expr.FindImpl.FindM
code: unsafe abbrev FindM 
goal: Type

full_name: Lean.Expr.FindImpl.checkVisited
code: @[inline] unsafe def checkVisited (e : Expr) : OptionT FindM Unit 
goal: OptionT Lean.Expr.FindImpl.FindM Unit

full_name: Lean.Expr.FindImpl.findM?
code: unsafe def findM? (p : Expr → Bool) (e : Expr) : OptionT FindM Expr 
goal: OptionT Lean.Expr.FindImpl.FindM Lean.Expr

full_name: Lean.Expr.FindImpl.findM?.visit
code: unsafe def findM? (p : Expr → Bool) (e : Expr) : OptionT FindM Expr 
goal: OptionT Lean.Expr.FindImpl.FindM Lean.Expr

full_name: Lean.Expr.FindImpl.findUnsafe?
code: unsafe def findUnsafe? (p : Expr → Bool) (e : Expr) : Option Expr 
goal: Option Lean.Expr

full_name: Lean.Expr.find?
code: @[implemented_by FindImpl.findUnsafe?]
def find? (p : Expr → Bool) (e : Expr) : Option Expr 
goal: Option Lean.Expr

full_name: Lean.Expr.occurs
code: /-- Return true if `e` occurs in `t` -/
def occurs (e : Expr) (t : Expr) : Bool 
goal: Bool

full_name: Lean.Expr.FindStep.visit
code: /--
  Return type for `findExt?` function argument.
-/
inductive FindStep where
  /-- Found desired subterm -/ | found
  /-- Search subterms -/ | visit
  /-- Do not search subterms -/ | done
goal: Lean.Expr.FindStep

full_name: Lean.Expr.FindStep
code: /--
  Return type for `findExt?` function argument.
-/
inductive FindStep where
  /-- Found desired subterm -/ | found
  /-- Search subterms -/ | visit
  /-- Do not search subterms -/ | done
goal: Type

full_name: Lean.Expr.FindStep.found
code: /--
  Return type for `findExt?` function argument.
-/
inductive FindStep where
  /-- Found desired subterm -/ | found
  /-- Search subterms -/ | visit
  /-- Do not search subterms -/ | done
goal: Lean.Expr.FindStep

full_name: Lean.Expr.FindStep.done
code: /--
  Return type for `findExt?` function argument.
-/
inductive FindStep where
  /-- Found desired subterm -/ | found
  /-- Search subterms -/ | visit
  /-- Do not search subterms -/ | done
goal: Lean.Expr.FindStep

full_name: Lean.Expr.FindExtImpl.findM?.visitApp
code: unsafe def findM? (p : Expr → FindStep) (e : Expr) : OptionT FindImpl.FindM Expr 
goal: OptionT Lean.Expr.FindImpl.FindM Lean.Expr

full_name: Lean.Expr.FindExtImpl.findM?
code: unsafe def findM? (p : Expr → FindStep) (e : Expr) : OptionT FindImpl.FindM Expr 
goal: OptionT Lean.Expr.FindImpl.FindM Lean.Expr

full_name: Lean.Expr.FindExtImpl.findM?.visit
code: unsafe def findM? (p : Expr → FindStep) (e : Expr) : OptionT FindImpl.FindM Expr 
goal: OptionT Lean.Expr.FindImpl.FindM Lean.Expr

full_name: Lean.Expr.FindExtImpl.findUnsafe?
code: unsafe def findUnsafe? (p : Expr → FindStep) (e : Expr) : Option Expr 
goal: Option Lean.Expr

full_name: Lean.Expr.findExt?
code: /--
  Similar to `find?`, but `p` can return `FindStep.done` to interrupt the search on subterms.
  Remark: Differently from `find?`, we do not invoke `p` for partial applications of an application. -/
@[implemented_by FindExtImpl.findUnsafe?]
opaque findExt? (p : Expr → FindStep) (e : Expr) : Option Expr
goal: Option Lean.Expr
File: .lake/packages/lean4/src/lean/Lean/Util/Heartbeats.lean

full_name: Lean.withHeartbeats
code: /--
Counts the number of heartbeats used during a monadic function.

Remember that user facing heartbeats (e.g. as used in `set_option maxHeartbeats`)
differ from the internally tracked heartbeats by a factor of 1000,
so you need to divide the results here by 1000 before comparing with user facing numbers.
-/
-- See also `Lean.withSeconds`
def withHeartbeats [Monad m] [MonadLiftT BaseIO m] (x : m α) : m (α × Nat) 
goal: m (α × Nat)

full_name: Lean.getMaxHeartbeats
code: /-- Returns the current `maxHeartbeats`. -/
def getMaxHeartbeats : CoreM Nat 
goal: Lean.CoreM Nat

full_name: Lean.getInitHeartbeats
code: /-- Returns the current `initHeartbeats`. -/
def getInitHeartbeats : CoreM Nat 
goal: Lean.CoreM Nat

full_name: Lean.getRemainingHeartbeats
code: /-- Returns the remaining heartbeats available in this computation. -/
def getRemainingHeartbeats : CoreM Nat 
goal: Lean.CoreM Nat

full_name: Lean.heartbeatsPercent
code: /--
Returns the percentage of the max heartbeats allowed
that have been consumed so far in this computation.
-/
def heartbeatsPercent : CoreM Nat 
goal: Lean.CoreM Nat

full_name: Lean.reportOutOfHeartbeats
code: /-- Log a message if it looks like we ran out of time. -/
def reportOutOfHeartbeats (tac : Name) (stx : Syntax) (threshold : Nat := 90) : CoreM Unit 
goal: Lean.CoreM Unit
File: .lake/packages/lean4/src/lean/Lean/Util/Profile.lean

full_name: Lean.profiler
code: register_builtin_option profiler : Bool := {
  defValue := false
  group    := "profiler"
  descr    := "show exclusive execution times of various Lean components
  
See also `trace.profiler` for an alternative profiling system with structured output."
}
goal: Lean.Option Bool

full_name: Lean.initFn._@..lake.packages.lean4.src.lean.Lean.Util.Profile._hyg.6
code: register_builtin_option profiler : Bool := {
  defValue := false
  group    := "profiler"
  descr    := "show exclusive execution times of various Lean components
  
See also `trace.profiler` for an alternative profiling system with structured output."
}
goal: IO (Lean.Option Bool)

full_name: Lean.profiler.threshold
code: register_builtin_option profiler.threshold : Nat := {
  defValue := 100
  group    := "profiler"
  descr    := "threshold in milliseconds, profiling times under threshold will not be reported individually"
}
goal: Lean.Option Nat

full_name: Lean.initFn._@..lake.packages.lean4.src.lean.Lean.Util.Profile._hyg.43
code: register_builtin_option profiler.threshold : Nat := {
  defValue := 100
  group    := "profiler"
  descr    := "threshold in milliseconds, profiling times under threshold will not be reported individually"
}
goal: IO (Lean.Option Nat)

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Util.Profile.0.Lean.get_profiler
code: @[export lean_get_profiler]
private def get_profiler (o : Options) : Bool 
goal: Bool

full_name: Lean.profiler.threshold.getSecs
code: @[export lean_get_profiler_threshold]
def profiler.threshold.getSecs (o : Options) : Float 
goal: Float

full_name: Lean.profileit
code: /-- Print and accumulate run time of `act` when option `profiler` is set to `true`. -/
@[extern "lean_profileit"]
def profileit {α : Type} (category : @& String) (opts : @& Options) (fn : Unit → α) (decl := Name.anonymous) : α 
goal: α

full_name: Lean.profileitIOUnsafe
code: unsafe def profileitIOUnsafe {ε α : Type} (category : String) (opts : Options) (act : EIO ε α) (decl := Name.anonymous) : EIO ε α 
goal: EIO ε α

full_name: Lean.profileitIO
code: @[implemented_by profileitIOUnsafe]
def profileitIO {ε α : Type} (category : String) (opts : Options) (act : EIO ε α) (decl := Name.anonymous) : EIO ε α 
goal: EIO ε α

full_name: Lean.profileitM
code: def profileitM {m : Type → Type} (ε : Type) [MonadFunctorT (EIO ε) m] {α : Type} (category : String) (opts : Options) (act : m α) (decl := Name.anonymous) : m α 
goal: m α
File: .lake/packages/lean4/src/lean/Lean/Util/FindMVar.lean

full_name: Lean.FindMVar.Visitor
code: abbrev Visitor 
goal: Type

full_name: Lean.Expr.findMVar?
code: @[inline] def Expr.findMVar? (e : Expr) (p : MVarId → Bool) : Option MVarId 
goal: Option Lean.MVarId
File: .lake/packages/lean4/src/lean/Lean/Util/ReplaceLevel.lean

full_name: Lean.Level.replace
code: partial def replace (f? : Level → Option Level) (u : Level) : Level 
goal: Lean.Level

full_name: Lean.Expr.ReplaceLevelImpl.cacheSize
code: abbrev cacheSize : USize 
goal: USize

full_name: Lean.Expr.ReplaceLevelImpl.State.keys
code: structure State where
  keys    : Array Expr -- Remark: our "unsafe" implementation relies on the fact that `()` is not a valid Expr
  results : Array Expr
goal: Array Lean.Expr

full_name: Lean.Expr.ReplaceLevelImpl.State
code: structure State where
  keys    : Array Expr -- Remark: our "unsafe" implementation relies on the fact that `()` is not a valid Expr
  results : Array Expr
goal: Type

full_name: Lean.Expr.ReplaceLevelImpl.State.results
code: structure State where
  keys    : Array Expr -- Remark: our "unsafe" implementation relies on the fact that `()` is not a valid Expr
  results : Array Expr
goal: Array Lean.Expr

full_name: Lean.Expr.ReplaceLevelImpl.ReplaceM
code: abbrev ReplaceM 
goal: Type

full_name: Lean.Expr.ReplaceLevelImpl.cache
code: unsafe def cache (i : USize) (key : Expr) (result : Expr) : ReplaceM Expr 
goal: Lean.Expr.ReplaceLevelImpl.ReplaceM Lean.Expr

full_name: Lean.Expr.ReplaceLevelImpl.replaceUnsafeM
code: unsafe def replaceUnsafeM (f? : Level → Option Level) (size : USize) (e : Expr) : ReplaceM Expr 
goal: Lean.Expr.ReplaceLevelImpl.ReplaceM Lean.Expr

full_name: Lean.Expr.ReplaceLevelImpl.replaceUnsafeM.visit
code: unsafe def replaceUnsafeM (f? : Level → Option Level) (size : USize) (e : Expr) : ReplaceM Expr 
goal: Lean.Expr.ReplaceLevelImpl.ReplaceM Lean.Expr

full_name: Lean.Expr.ReplaceLevelImpl.initCache
code: unsafe def initCache : State 
goal: Lean.Expr.ReplaceLevelImpl.State

full_name: Lean.Expr.ReplaceLevelImpl.replaceUnsafe
code: unsafe def replaceUnsafe (f? : Level → Option Level) (e : Expr) : Expr 
goal: Lean.Expr

full_name: Lean.Expr.replaceLevel
code: @[implemented_by ReplaceLevelImpl.replaceUnsafe]
partial def replaceLevel (f? : Level → Option Level) : Expr → Expr
  
goal: Lean.Expr → Lean.Expr
File: .lake/packages/lean4/src/lean/Lean/Util/CollectMVars.lean

full_name: Lean.CollectMVars.State.visitedExpr
code: structure State where
  visitedExpr  : ExprSet      := {}
  result       : Array MVarId := #[]
goal: Lean.ExprSet

full_name: Lean.CollectMVars.State
code: structure State where
  visitedExpr  : ExprSet      := {}
  result       : Array MVarId := #[]
goal: Type

full_name: Lean.CollectMVars.State.result
code: structure State where
  visitedExpr  : ExprSet      := {}
  result       : Array MVarId := #[]
goal: Array Lean.MVarId

full_name: Lean.CollectMVars.instInhabitedState
code: instance : Inhabited State 
goal: Inhabited Lean.CollectMVars.State

full_name: Lean.CollectMVars.Visitor
code: abbrev Visitor 
goal: Type

full_name: Lean.Expr.collectMVars
code: def Expr.collectMVars (s : CollectMVars.State) (e : Expr) : CollectMVars.State 
goal: Lean.CollectMVars.State
File: .lake/packages/lean4/src/lean/Lean/Util/CollectFVars.lean

full_name: Lean.CollectFVars.State.fvarIds
code: structure State where
  visitedExpr  : ExprSet  := {}
  fvarSet      : FVarIdSet  := {}
  fvarIds      : Array FVarId := #[]
  deriving Inhabited
goal: Array Lean.FVarId

full_name: Lean.CollectFVars.instInhabitedState
code: structure State where
  visitedExpr  : ExprSet  := {}
  fvarSet      : FVarIdSet  := {}
  fvarIds      : Array FVarId := #[]
  deriving Inhabited
goal: Inhabited Lean.CollectFVars.State

full_name: Lean.CollectFVars.State
code: structure State where
  visitedExpr  : ExprSet  := {}
  fvarSet      : FVarIdSet  := {}
  fvarIds      : Array FVarId := #[]
  deriving Inhabited
goal: Type

full_name: Lean.CollectFVars.State.visitedExpr
code: structure State where
  visitedExpr  : ExprSet  := {}
  fvarSet      : FVarIdSet  := {}
  fvarIds      : Array FVarId := #[]
  deriving Inhabited
goal: Lean.ExprSet

full_name: Lean.CollectFVars.State.fvarSet
code: structure State where
  visitedExpr  : ExprSet  := {}
  fvarSet      : FVarIdSet  := {}
  fvarIds      : Array FVarId := #[]
  deriving Inhabited
goal: Lean.FVarIdSet

full_name: Lean.CollectFVars.State.add
code: def State.add (s : State) (fvarId : FVarId) : State 
goal: Lean.CollectFVars.State

full_name: Lean.CollectFVars.Visitor
code: abbrev Visitor 
goal: Type

full_name: Lean.collectFVars
code: def collectFVars (s : CollectFVars.State) (e : Expr) : CollectFVars.State 
goal: Lean.CollectFVars.State
File: .lake/packages/lean4/src/lean/Lean/Util/InstantiateLevelParams.lean

full_name: Lean.Expr.instantiateLevelParamsCore
code: /--
Instantiate level parameters
-/
@[specialize] def instantiateLevelParamsCore (s : Name → Option Level) (e : Expr) : Expr 
goal: Lean.Expr

full_name: Lean.Expr.instantiateLevelParamsCore.replaceFn
code: /--
Instantiate level parameters
-/
@[specialize] def instantiateLevelParamsCore (s : Name → Option Level) (e : Expr) : Expr 
goal: Option Lean.Expr

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Util.InstantiateLevelParams.0.Lean.Expr.getParamSubst
code: private def getParamSubst : List Name → List Level → Name → Option Level
  
goal: List Lean.Name → List Lean.Level → Lean.Name → Option Lean.Level

full_name: Lean.Expr.instantiateLevelParams
code: /--
Instantiate universe level parameters names `paramNames` with `lvls` in `e`.
If the two lists have different length, the smallest one is used.
-/
def instantiateLevelParams (e : Expr) (paramNames : List Name) (lvls : List Level) : Expr 
goal: Lean.Expr

full_name: Lean.Expr.instantiateLevelParamsNoCache
code: /--
Instantiate universe level parameters names `paramNames` with `lvls` in `e`.
If the two lists have different length, the smallest one is used.
(Does not preserve expression sharing.)
-/
def instantiateLevelParamsNoCache (e : Expr) (paramNames : List Name) (lvls : List Level) : Expr 
goal: Lean.Expr

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Util.InstantiateLevelParams.0.Lean.Expr.getParamSubstArray
code: private partial def getParamSubstArray (ps : Array Name) (us : Array Level) (p' : Name) (i : Nat) : Option Level 
goal: Option Lean.Level

full_name: Lean.Expr.instantiateLevelParamsArray
code: /--
Instantiate universe level parameters names `paramNames` with `lvls` in `e`.
If the two arrays have different length, the smallest one is used.
-/
def instantiateLevelParamsArray (e : Expr) (paramNames : Array Name) (lvls : Array Level) : Expr 
goal: Lean.Expr
File: .lake/packages/lean4/src/lean/Lean/Util/MonadBacktrack.lean

full_name: Lean.MonadBacktrack.saveState
code: /-- Similar to `MonadState`, but it retrieves/restores only the "backtrackable" part of the state -/
class MonadBacktrack (s : outParam Type) (m : Type → Type) where
  saveState    : m s
  restoreState : s → m Unit
goal: m s

full_name: Lean.MonadBacktrack
code: /-- Similar to `MonadState`, but it retrieves/restores only the "backtrackable" part of the state -/
class MonadBacktrack (s : outParam Type) (m : Type → Type) where
  saveState    : m s
  restoreState : s → m Unit
goal: Type

full_name: Lean.MonadBacktrack.restoreState
code: /-- Similar to `MonadState`, but it retrieves/restores only the "backtrackable" part of the state -/
class MonadBacktrack (s : outParam Type) (m : Type → Type) where
  saveState    : m s
  restoreState : s → m Unit
goal: s → m Unit

full_name: Lean.commitWhenSome?
code: /--
Execute `x?`, but backtrack state if result is `none` or an exception was thrown.
-/
def commitWhenSome? [Monad m] [MonadBacktrack s m] [MonadExcept ε m] (x? : m (Option α)) : m (Option α) 
goal: m (Option α)

full_name: Lean.commitWhenSomeNoEx?
code: /--
Execute `x?`, but backtrack state if result is `none` or an exception was thrown.
If an exception is thrown, `none` is returned.
That is, this function is similar to `commitWhenSome?`, but swallows the exception and returns `none`.
-/
def commitWhenSomeNoEx? [Monad m] [MonadBacktrack s m] [MonadExcept ε m] (x? : m (Option α)) : m (Option α) 
goal: m (Option α)

full_name: Lean.commitWhen
code: def commitWhen [Monad m] [MonadBacktrack s m] [MonadExcept ε m] (x : m Bool) : m Bool 
goal: m Bool

full_name: Lean.commitIfNoEx
code: def commitIfNoEx [Monad m] [MonadBacktrack s m] [MonadExcept ε m] (x : m α) : m α 
goal: m α

full_name: Lean.withoutModifyingState
code: def withoutModifyingState [Monad m] [MonadFinally m] [MonadBacktrack s m] (x : m α) : m α 
goal: m α

full_name: Lean.observing?
code: def observing? [Monad m] [MonadBacktrack s m] [MonadExcept ε m] (x : m α) : m (Option α) 
goal: m (Option α)

full_name: Lean.instMonadBacktrackExceptTOfMonad
code: instance [MonadBacktrack s m] [Monad m] : MonadBacktrack s (ExceptT ε m) 
goal: Lean.MonadBacktrack s (ExceptT ε m)
File: .lake/packages/lean4/src/lean/Lean/Util/OccursCheck.lean

full_name: Lean.occursCheck.visit
code: /--
  Return true if `e` does **not** contain `mvarId` directly or indirectly
  This function considers assignments and delayed assignments. -/
partial def occursCheck [Monad m] [MonadMCtx m] (mvarId : MVarId) (e : Expr) : m Bool 
goal: ExceptT Unit (StateT Lean.ExprSet m) Unit

full_name: Lean.occursCheck
code: /--
  Return true if `e` does **not** contain `mvarId` directly or indirectly
  This function considers assignments and delayed assignments. -/
partial def occursCheck [Monad m] [MonadMCtx m] (mvarId : MVarId) (e : Expr) : m Bool 
goal: m Bool

full_name: Lean.occursCheck.visitMVar
code: /--
  Return true if `e` does **not** contain `mvarId` directly or indirectly
  This function considers assignments and delayed assignments. -/
partial def occursCheck [Monad m] [MonadMCtx m] (mvarId : MVarId) (e : Expr) : m Bool 
goal: ExceptT Unit (StateT Lean.ExprSet m) Unit
File: .lake/packages/lean4/src/lean/Lean/Util/Sorry.lean

full_name: Lean.Expr.isSorry
code: def Expr.isSorry : Expr → Bool
  
goal: Lean.Expr → Bool

full_name: Lean.Expr.isSyntheticSorry
code: def Expr.isSyntheticSorry : Expr → Bool
  
goal: Lean.Expr → Bool

full_name: Lean.Expr.isNonSyntheticSorry
code: def Expr.isNonSyntheticSorry : Expr → Bool
  
goal: Lean.Expr → Bool

full_name: Lean.Expr.hasSorry
code: def Expr.hasSorry (e : Expr) : Bool 
goal: Bool

full_name: Lean.Expr.hasSyntheticSorry
code: def Expr.hasSyntheticSorry (e : Expr) : Bool 
goal: Bool

full_name: Lean.Expr.hasNonSyntheticSorry
code: def Expr.hasNonSyntheticSorry (e : Expr) : Bool 
goal: Bool

full_name: Lean.Declaration.hasSorry
code: def Declaration.hasSorry (d : Declaration) : Bool 
goal: Bool

full_name: Lean.Declaration.hasNonSyntheticSorry
code: def Declaration.hasNonSyntheticSorry (d : Declaration) : Bool 
goal: Bool
File: .lake/packages/lean4/src/lean/Lean/Util/PtrSet.lean

full_name: Lean.Ptr.value
code: structure Ptr (α : Type u) where
  value : α
goal: α

full_name: Lean.Ptr
code: structure Ptr (α : Type u) where
  value : α
goal: Type u

full_name: Lean.instHashablePtr
code: unsafe instance : Hashable (Ptr α) 
goal: Hashable (Lean.Ptr α)

full_name: Lean.instBEqPtr
code: unsafe instance : BEq (Ptr α) 
goal: BEq (Lean.Ptr α)

full_name: Lean.PtrSet
code: /--
Set of pointers. It is a low-level auxiliary datastructure used for traversing DAGs.
-/
unsafe def PtrSet (α : Type) 
goal: Type

full_name: Lean.mkPtrSet
code: unsafe def mkPtrSet {α : Type} (capacity : Nat := 64) : PtrSet α 
goal: Lean.PtrSet α

full_name: Lean.PtrSet.insert
code: unsafe abbrev PtrSet.insert (s : PtrSet α) (a : α) : PtrSet α 
goal: Lean.PtrSet α

full_name: Lean.PtrSet.contains
code: unsafe abbrev PtrSet.contains (s : PtrSet α) (a : α) : Bool 
goal: Bool
File: .lake/packages/lean4/src/lean/Lean/Util/HasConstCache.lean

full_name: Lean.HasConstCache.cache
code: structure HasConstCache (declName : Name) where
  cache : HashMapImp Expr Bool := mkHashMapImp
goal: Lean.HashMapImp Lean.Expr Bool

full_name: Lean.HasConstCache
code: structure HasConstCache (declName : Name) where
  cache : HashMapImp Expr Bool := mkHashMapImp
goal: Type

full_name: Lean.HasConstCache.containsUnsafe.cache
code: unsafe def HasConstCache.containsUnsafe (e : Expr) : StateM (HasConstCache declName) Bool 
goal: StateM (Lean.HasConstCache declName) Bool

full_name: Lean.HasConstCache.containsUnsafe
code: unsafe def HasConstCache.containsUnsafe (e : Expr) : StateM (HasConstCache declName) Bool 
goal: StateM (Lean.HasConstCache declName) Bool

full_name: Lean.HasConstCache.contains
code: /--
  Return true iff `e` contains the constant `declName`.
  Remark: the results for visited expressions are stored in the state cache. -/
@[implemented_by HasConstCache.containsUnsafe]
opaque HasConstCache.contains (e : Expr) : StateM (HasConstCache declName) Bool
goal: StateM (Lean.HasConstCache declName) Bool
File: .lake/packages/lean4/src/lean/Lean/Util/ForEachExprWhere.lean

full_name: Lean.ForEachExprWhere.cacheSize
code: abbrev cacheSize : USize 
goal: USize

full_name: Lean.ForEachExprWhere.State
code: structure State where
  /--
  Implements caching trick similar to the one used at `FindExpr` and `ReplaceExpr`.
  -/
  visited : Array Expr   -- Remark: our "unsafe" implementation relies on the fact that `()` is not a valid Expr
  /--
  Set of visited subterms that satisfy the predicate `p`.
  We have to use this set to make sure `f` is applied at most once of each subterm that satisfies `p`.
  -/
  checked : HashSet Expr
goal: Type

full_name: Lean.ForEachExprWhere.State.checked
code: structure State where
  /--
  Implements caching trick similar to the one used at `FindExpr` and `ReplaceExpr`.
  -/
  visited : Array Expr   -- Remark: our "unsafe" implementation relies on the fact that `()` is not a valid Expr
  /--
  Set of visited subterms that satisfy the predicate `p`.
  We have to use this set to make sure `f` is applied at most once of each subterm that satisfies `p`.
  -/
  checked : HashSet Expr
goal: Lean.HashSet Lean.Expr

full_name: Lean.ForEachExprWhere.State.visited
code: structure State where
  /--
  Implements caching trick similar to the one used at `FindExpr` and `ReplaceExpr`.
  -/
  visited : Array Expr   -- Remark: our "unsafe" implementation relies on the fact that `()` is not a valid Expr
  /--
  Set of visited subterms that satisfy the predicate `p`.
  We have to use this set to make sure `f` is applied at most once of each subterm that satisfies `p`.
  -/
  checked : HashSet Expr
goal: Array Lean.Expr

full_name: Lean.ForEachExprWhere.initCache
code: unsafe def initCache : State 
goal: Lean.ForEachExprWhere.State

full_name: Lean.ForEachExprWhere.ForEachM
code: abbrev ForEachM {ω : Type} (m : Type → Type) [STWorld ω m] 
goal: Type

full_name: Lean.ForEachExprWhere.visited
code: unsafe def visited (e : Expr) : ForEachM m Bool 
goal: Lean.ForEachExprWhere.ForEachM m Bool

full_name: Lean.ForEachExprWhere.checked
code: def checked (e : Expr) : ForEachM m Bool 
goal: Lean.ForEachExprWhere.ForEachM m Bool

full_name: Lean.ForEachExprWhere.visit.go
code: /-- `Expr.forEachWhere` (unsafe) implementation -/
unsafe def visit (p : Expr → Bool) (f : Expr → m Unit) (e : Expr) (stopWhenVisited : Bool := false) : m Unit 
goal: StateRefT' ω Lean.ForEachExprWhere.State m Unit

full_name: Lean.ForEachExprWhere.visit
code: /-- `Expr.forEachWhere` (unsafe) implementation -/
unsafe def visit (p : Expr → Bool) (f : Expr → m Unit) (e : Expr) (stopWhenVisited : Bool := false) : m Unit 
goal: m Unit

full_name: Lean.Expr.forEachWhere
code: /--
  `e.forEachWhere p f` applies `f` to each subterm that satisfies `p`.
  If `stopWhenVisited` is `true`, the function doesn't visit subterms of terms
  which satisfy `p`.
-/
@[implemented_by ForEachExprWhere.visit]
opaque Expr.forEachWhere {ω : Type} {m : Type → Type} [STWorld ω m] [MonadLiftT (ST ω) m] [Monad m] (p : Expr → Bool) (f : Expr → m Unit) (e : Expr) (stopWhenVisited : Bool := false) : m Unit
goal: m Unit