File: .lake/packages/lean4/src/lean/Lean/Meta/Match/Match.lean

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.Match.Match.0.Lean.Meta.Match.checkNumPatterns
code: /-- The number of patterns in each AltLHS must be equal to the number of discriminants. -/
private def checkNumPatterns (numDiscrs : Nat) (lhss : List AltLHS) : MetaM Unit 
goal: Lean.MetaM Unit

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.Match.Match.0.Lean.Meta.Match.withEqs
code: /--
  Execute `k hs` where `hs` contains new equalities `h : lhs[i] = rhs[i]` for each `discrInfos[i] = some h`.
  Assume `lhs.size == rhs.size == discrInfos.size`
-/
private partial def withEqs (lhs rhs : Array Expr) (discrInfos : Array DiscrInfo) (k : Array Expr → MetaM α) : MetaM α 
goal: Lean.MetaM α

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.Match.Match.0.Lean.Meta.Match.withEqs.go
code: /--
  Execute `k hs` where `hs` contains new equalities `h : lhs[i] = rhs[i]` for each `discrInfos[i] = some h`.
  Assume `lhs.size == rhs.size == discrInfos.size`
-/
private partial def withEqs (lhs rhs : Array Expr) (discrInfos : Array DiscrInfo) (k : Array Expr → MetaM α) : MetaM α 
goal: Lean.MetaM α

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.Match.Match.0.Lean.Meta.Match.withAlts.mkMinorType
code: /-- Given a list of `AltLHS`, create a minor premise for each one, convert them into `Alt`, and then execute `k` -/
private def withAlts {α} (motive : Expr) (discrs : Array Expr) (discrInfos : Array DiscrInfo) (lhss : List AltLHS) (k : List Alt → Array (Expr × Nat) → MetaM α) : MetaM α 
goal: Lean.MetaM Lean.Expr

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.Match.Match.0.Lean.Meta.Match.withAlts
code: /-- Given a list of `AltLHS`, create a minor premise for each one, convert them into `Alt`, and then execute `k` -/
private def withAlts {α} (motive : Expr) (discrs : Array Expr) (discrInfos : Array DiscrInfo) (lhss : List AltLHS) (k : List Alt → Array (Expr × Nat) → MetaM α) : MetaM α 
goal: Lean.MetaM α

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.Match.Match.0.Lean.Meta.Match.withAlts.loop
code: /-- Given a list of `AltLHS`, create a minor premise for each one, convert them into `Alt`, and then execute `k` -/
private def withAlts {α} (motive : Expr) (discrs : Array Expr) (discrInfos : Array DiscrInfo) (lhss : List AltLHS) (k : List Alt → Array (Expr × Nat) → MetaM α) : MetaM α 
goal: Lean.MetaM α

full_name: Lean.Meta.Match.State.counterExamples
code: structure State where
  used            : HashSet Nat := {} -- used alternatives
  counterExamples : List (List Example) := []
goal: List (List Lean.Meta.Match.Example)

full_name: Lean.Meta.Match.State
code: structure State where
  used            : HashSet Nat := {} -- used alternatives
  counterExamples : List (List Example) := []
goal: Type

full_name: Lean.Meta.Match.State.used
code: structure State where
  used            : HashSet Nat := {} -- used alternatives
  counterExamples : List (List Example) := []
goal: Lean.HashSet Nat

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.Match.Match.0.Lean.Meta.Match.isDone
code: /-- Return true if the given (sub-)problem has been solved. -/
private def isDone (p : Problem) : Bool 
goal: Bool

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.Match.Match.0.Lean.Meta.Match.isNextVar
code: /-- Return true if the next element on the `p.vars` list is a variable. -/
private def isNextVar (p : Problem) : Bool 
goal: Bool

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.Match.Match.0.Lean.Meta.Match.hasAsPattern
code: private def hasAsPattern (p : Problem) : Bool 
goal: Bool

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.Match.Match.0.Lean.Meta.Match.hasCtorPattern
code: private def hasCtorPattern (p : Problem) : Bool 
goal: Bool

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.Match.Match.0.Lean.Meta.Match.hasValPattern
code: private def hasValPattern (p : Problem) : Bool 
goal: Bool

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.Match.Match.0.Lean.Meta.Match.hasNatValPattern
code: private def hasNatValPattern (p : Problem) : MetaM Bool 
goal: Lean.MetaM Bool

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.Match.Match.0.Lean.Meta.Match.hasIntValPattern
code: private def hasIntValPattern (p : Problem) : MetaM Bool 
goal: Lean.MetaM Bool

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.Match.Match.0.Lean.Meta.Match.hasVarPattern
code: private def hasVarPattern (p : Problem) : Bool 
goal: Bool

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.Match.Match.0.Lean.Meta.Match.hasArrayLitPattern
code: private def hasArrayLitPattern (p : Problem) : Bool 
goal: Bool

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.Match.Match.0.Lean.Meta.Match.isVariableTransition
code: private def isVariableTransition (p : Problem) : Bool 
goal: Bool

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.Match.Match.0.Lean.Meta.Match.isConstructorTransition
code: private def isConstructorTransition (p : Problem) : Bool 
goal: Bool

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.Match.Match.0.Lean.Meta.Match.isValueTransition
code: private def isValueTransition (p : Problem) : Bool 
goal: Bool

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.Match.Match.0.Lean.Meta.Match.isValueOnlyTransitionCore
code: private def isValueOnlyTransitionCore (p : Problem) (isValue : Expr → MetaM Bool) : MetaM Bool 
goal: Lean.MetaM Bool

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.Match.Match.0.Lean.Meta.Match.isFinValueTransition
code: private def isFinValueTransition (p : Problem) : MetaM Bool 
goal: Lean.MetaM Bool

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.Match.Match.0.Lean.Meta.Match.isBitVecValueTransition
code: private def isBitVecValueTransition (p : Problem) : MetaM Bool 
goal: Lean.MetaM Bool

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.Match.Match.0.Lean.Meta.Match.isArrayLitTransition
code: private def isArrayLitTransition (p : Problem) : Bool 
goal: Bool

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.Match.Match.0.Lean.Meta.Match.hasCtorOrInaccessible
code: private def hasCtorOrInaccessible (p : Problem) : Bool 
goal: Bool

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.Match.Match.0.Lean.Meta.Match.isNatValueTransition
code: private def isNatValueTransition (p : Problem) : MetaM Bool 
goal: Lean.MetaM Bool

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.Match.Match.0.Lean.Meta.Match.isIntValueTransition
code: /--
Predicate for testing whether we need to expand `Int` value patterns into constructors.
There are two cases:
- We have constructor or inaccessible patterns. Example:
```
| 0, ...
| Int.toVal p, ...
...
```
- We don't have the `else`-case (i.e., variable pattern). This can happen
when the non-value cases are unreachable.
-/
private def isIntValueTransition (p : Problem) : MetaM Bool 
goal: Lean.MetaM Bool

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.Match.Match.0.Lean.Meta.Match.processSkipInaccessible
code: private def processSkipInaccessible (p : Problem) : Problem 
goal: Lean.Meta.Match.Problem

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.Match.Match.0.Lean.Meta.Match.reorientCnstrs
code: /--
If constraint is of the form `e ≋ x` where `x` is a free variable, reorient it
as `x ≋ e` If
- `x` is an `alt`-local declaration
- `e` is not a free variable.
-/
private def reorientCnstrs (alt : Alt) : Alt 
goal: Lean.Meta.Match.Alt

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.Match.Match.0.Lean.Meta.Match.filterTrivialCnstrs
code: /--
Remove constraints of the form `lhs ≋ rhs` where `lhs` and `rhs` are definitionally equal,
or `lhs` is a free variable.
-/
private def filterTrivialCnstrs (alt : Alt) : MetaM Alt 
goal: Lean.MetaM Lean.Meta.Match.Alt

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.Match.Match.0.Lean.Meta.Match.solveSomeLocalFVarIdCnstr?
code: /--
Find an alternative constraint of the form `x ≋ e` where `x` is an alternative
local declarations, and `x` and `e` have definitionally equal types.
Then, replace `x` with `e` in the alternative, and return it.
Return `none` if the alternative does not contain a constraint of this form.
-/
private def solveSomeLocalFVarIdCnstr? (alt : Alt) : MetaM (Option Alt) 
goal: Lean.MetaM (Option Lean.Meta.Match.Alt)

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.Match.Match.0.Lean.Meta.Match.solveSomeLocalFVarIdCnstr?.go
code: /--
Find an alternative constraint of the form `x ≋ e` where `x` is an alternative
local declarations, and `x` and `e` have definitionally equal types.
Then, replace `x` with `e` in the alternative, and return it.
Return `none` if the alternative does not contain a constraint of this form.
-/
private def solveSomeLocalFVarIdCnstr? (alt : Alt) : MetaM (Option Alt) 
goal: Lean.MetaM (Option (Lean.FVarId × Lean.Expr) × List (Lean.Expr × Lean.Expr))

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.Match.Match.0.Lean.Meta.Match.solveCnstrs
code: /--
Solve pending alternative constraints. If all constraints can be solved perform assignment
`mvarId := alt.rhs`, and return true.
-/
private partial def solveCnstrs (mvarId : MVarId) (alt : Alt) : StateRefT State MetaM Bool 
goal: StateRefT' IO.RealWorld Lean.Meta.Match.State Lean.MetaM Bool

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.Match.Match.0.Lean.Meta.Match.solveCnstrs.go
code: /--
Solve pending alternative constraints. If all constraints can be solved perform assignment
`mvarId := alt.rhs`, and return true.
-/
private partial def solveCnstrs (mvarId : MVarId) (alt : Alt) : StateRefT State MetaM Bool 
goal: StateRefT' IO.RealWorld Lean.Meta.Match.State Lean.MetaM Bool

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.Match.Match.0.Lean.Meta.Match.processLeaf.go
code: /--
Try to solve the problem by using the first alternative whose pending constraints can be resolved.
-/
private def processLeaf (p : Problem) : StateRefT State MetaM Unit 
goal: StateRefT' IO.RealWorld Lean.Meta.Match.State Lean.MetaM Unit

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.Match.Match.0.Lean.Meta.Match.processLeaf
code: /--
Try to solve the problem by using the first alternative whose pending constraints can be resolved.
-/
private def processLeaf (p : Problem) : StateRefT State MetaM Unit 
goal: StateRefT' IO.RealWorld Lean.Meta.Match.State Lean.MetaM Unit

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.Match.Match.0.Lean.Meta.Match.processAsPattern
code: private def processAsPattern (p : Problem) : MetaM Problem 
goal: Lean.MetaM Lean.Meta.Match.Problem

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.Match.Match.0.Lean.Meta.Match.processVariable
code: private def processVariable (p : Problem) : MetaM Problem 
goal: Lean.MetaM Lean.Meta.Match.Problem

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.Match.Match.0.Lean.Meta.Match.inLocalDecls
code: private def inLocalDecls (localDecls : List LocalDecl) (fvarId : FVarId) : Bool 
goal: Bool

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.Match.Match.0.Lean.Meta.Match.expandVarIntoCtor?
code: private def expandVarIntoCtor? (alt : Alt) (fvarId : FVarId) (ctorName : Name) : MetaM (Option Alt) 
goal: Lean.MetaM (Option Lean.Meta.Match.Alt)

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.Match.Match.0.Lean.Meta.Match.getInductiveVal?
code: private def getInductiveVal? (x : Expr) : MetaM (Option InductiveVal) 
goal: Lean.MetaM (Option Lean.InductiveVal)

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.Match.Match.0.Lean.Meta.Match.hasRecursiveType
code: private def hasRecursiveType (x : Expr) : MetaM Bool 
goal: Lean.MetaM Bool

full_name: Lean.Meta.Match.processInaccessibleAsCtor
code: /-- Given `alt` s.t. the next pattern is an inaccessible pattern `e`,
   try to normalize `e` into a constructor application.
   If it is not a constructor, throw an error.
   Otherwise, if it is a constructor application of `ctorName`,
   update the next patterns with the fields of the constructor.
   Otherwise, return none. -/
def processInaccessibleAsCtor (alt : Alt) (ctorName : Name) : MetaM (Option Alt) 
goal: Lean.MetaM (Option Lean.Meta.Match.Alt)

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.Match.Match.0.Lean.Meta.Match.hasNonTrivialExample
code: private def hasNonTrivialExample (p : Problem) : Bool 
goal: Bool

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.Match.Match.0.Lean.Meta.Match.throwCasesException
code: private def throwCasesException (p : Problem) (ex : Exception) : MetaM α 
goal: Lean.MetaM α

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.Match.Match.0.Lean.Meta.Match.processConstructor
code: private def processConstructor (p : Problem) : MetaM (Array Problem) 
goal: Lean.MetaM (Array Lean.Meta.Match.Problem)

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.Match.Match.0.Lean.Meta.Match.altsAreCtorLike
code: private def altsAreCtorLike (p : Problem) : MetaM Bool 
goal: Lean.MetaM Bool

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.Match.Match.0.Lean.Meta.Match.processNonVariable
code: private def processNonVariable (p : Problem) : MetaM Problem 
goal: Lean.MetaM Lean.Meta.Match.Problem

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.Match.Match.0.Lean.Meta.Match.collectValues
code: private def collectValues (p : Problem) : Array Expr 
goal: Array Lean.Expr

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.Match.Match.0.Lean.Meta.Match.isFirstPatternVar
code: private def isFirstPatternVar (alt : Alt) : Bool 
goal: Bool

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.Match.Match.0.Lean.Meta.Match.processValue
code: private def processValue (p : Problem) : MetaM (Array Problem) 
goal: Lean.MetaM (Array Lean.Meta.Match.Problem)

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.Match.Match.0.Lean.Meta.Match.collectArraySizes
code: private def collectArraySizes (p : Problem) : Array Nat 
goal: Array Nat

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.Match.Match.0.Lean.Meta.Match.expandVarIntoArrayLit
code: private def expandVarIntoArrayLit (alt : Alt) (fvarId : FVarId) (arrayElemType : Expr) (arraySize : Nat) : MetaM Alt 
goal: Lean.MetaM Lean.Meta.Match.Alt

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.Match.Match.0.Lean.Meta.Match.expandVarIntoArrayLit.loop
code: private def expandVarIntoArrayLit (alt : Alt) (fvarId : FVarId) (arrayElemType : Expr) (arraySize : Nat) : MetaM Alt 
goal: Lean.MetaM Lean.Meta.Match.Alt

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.Match.Match.0.Lean.Meta.Match.processArrayLit
code: private def processArrayLit (p : Problem) : MetaM (Array Problem) 
goal: Lean.MetaM (Array Lean.Meta.Match.Problem)

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.Match.Match.0.Lean.Meta.Match.expandNatValuePattern
code: private def expandNatValuePattern (p : Problem) : MetaM Problem 
goal: Lean.MetaM Lean.Meta.Match.Problem

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.Match.Match.0.Lean.Meta.Match.expandIntValuePattern
code: private def expandIntValuePattern (p : Problem) : MetaM Problem 
goal: Lean.MetaM Lean.Meta.Match.Problem

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.Match.Match.0.Lean.Meta.Match.expandFinValuePattern
code: private def expandFinValuePattern (p : Problem) : MetaM Problem 
goal: Lean.MetaM Lean.Meta.Match.Problem

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.Match.Match.0.Lean.Meta.Match.expandBitVecValuePattern
code: private def expandBitVecValuePattern (p : Problem) : MetaM Problem 
goal: Lean.MetaM Lean.Meta.Match.Problem

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.Match.Match.0.Lean.Meta.Match.traceStep
code: private def traceStep (msg : String) : StateRefT State MetaM Unit 
goal: StateRefT' IO.RealWorld Lean.Meta.Match.State Lean.MetaM Unit

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.Match.Match.0.Lean.Meta.Match.traceState
code: private def traceState (p : Problem) : MetaM Unit 
goal: Lean.MetaM Unit

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.Match.Match.0.Lean.Meta.Match.throwNonSupported
code: private def throwNonSupported (p : Problem) : MetaM Unit 
goal: Lean.MetaM Unit

full_name: Lean.Meta.Match.isCurrVarInductive
code: def isCurrVarInductive (p : Problem) : MetaM Bool 
goal: Lean.MetaM Bool

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.Match.Match.0.Lean.Meta.Match.checkNextPatternTypes
code: private def checkNextPatternTypes (p : Problem) : MetaM Unit 
goal: Lean.MetaM Unit

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.Match.Match.0.Lean.Meta.Match.process
code: private partial def process (p : Problem) : StateRefT State MetaM Unit 
goal: StateRefT' IO.RealWorld Lean.Meta.Match.State Lean.MetaM Unit

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.Match.Match.0.Lean.Meta.Match.getUElimPos?
code: private def getUElimPos? (matcherLevels : List Level) (uElim : Level) : MetaM (Option Nat) 
goal: Lean.MetaM (Option Nat)

full_name: Lean.Meta.Match.bootstrap.genMatcherCode
code: register_builtin_option bootstrap.genMatcherCode : Bool := {
  defValue := true
  group := "bootstrap"
  descr := "disable code generation for auxiliary matcher function"
}
goal: Lean.Option Bool

full_name: Lean.Meta.Match.initFn._@..lake.packages.lean4.src.lean.Lean.Meta.Match.Match._hyg.10682
code: register_builtin_option bootstrap.genMatcherCode : Bool := {
  defValue := true
  group := "bootstrap"
  descr := "disable code generation for auxiliary matcher function"
}
goal: IO (Lean.Option Bool)

full_name: Lean.Meta.Match.matcherExt
code: builtin_initialize matcherExt : EnvExtension (PHashMap (Expr × Bool) Name) ← registerEnvExtension (pure {})
goal: Lean.EnvExtension (Lean.PHashMap (Lean.Expr × Bool) Lean.Name)

full_name: Lean.Meta.Match.initFn._@..lake.packages.lean4.src.lean.Lean.Meta.Match.Match._hyg.10722
code: builtin_initialize matcherExt : EnvExtension (PHashMap (Expr × Bool) Name) ← registerEnvExtension (pure {})
goal: IO (Lean.EnvExtension (Lean.PHashMap (Lean.Expr × Bool) Lean.Name))

full_name: Lean.Meta.Match.mkMatcherAuxDefinition
code: /-- Similar to `mkAuxDefinition`, but uses the cache `matcherExt`.
   It also returns an Boolean that indicates whether a new matcher function was added to the environment or not. -/
def mkMatcherAuxDefinition (name : Name) (type : Expr) (value : Expr) : MetaM (Expr × Option (MatcherInfo → MetaM Unit)) 
goal: Lean.MetaM (Lean.Expr × Option (Lean.Meta.MatcherInfo → Lean.MetaM Unit))

full_name: Lean.Meta.Match.MkMatcherInput
code: structure MkMatcherInput where
  matcherName : Name
  matchType   : Expr
  discrInfos  : Array DiscrInfo
  lhss        : List AltLHS
goal: Type

full_name: Lean.Meta.Match.MkMatcherInput.discrInfos
code: structure MkMatcherInput where
  matcherName : Name
  matchType   : Expr
  discrInfos  : Array DiscrInfo
  lhss        : List AltLHS
goal: Array Lean.Meta.Match.DiscrInfo

full_name: Lean.Meta.Match.MkMatcherInput.matchType
code: structure MkMatcherInput where
  matcherName : Name
  matchType   : Expr
  discrInfos  : Array DiscrInfo
  lhss        : List AltLHS
goal: Lean.Expr

full_name: Lean.Meta.Match.MkMatcherInput.matcherName
code: structure MkMatcherInput where
  matcherName : Name
  matchType   : Expr
  discrInfos  : Array DiscrInfo
  lhss        : List AltLHS
goal: Lean.Name

full_name: Lean.Meta.Match.MkMatcherInput.lhss
code: structure MkMatcherInput where
  matcherName : Name
  matchType   : Expr
  discrInfos  : Array DiscrInfo
  lhss        : List AltLHS
goal: List Lean.Meta.Match.AltLHS

full_name: Lean.Meta.Match.MkMatcherInput.numDiscrs
code: def MkMatcherInput.numDiscrs (m : MkMatcherInput) 
goal: Nat

full_name: Lean.Meta.Match.MkMatcherInput.collectFVars
code: def MkMatcherInput.collectFVars (m : MkMatcherInput) : StateRefT CollectFVars.State MetaM Unit 
goal: StateRefT' IO.RealWorld Lean.CollectFVars.State Lean.MetaM Unit

full_name: Lean.Meta.Match.MkMatcherInput.collectDependencies
code: def MkMatcherInput.collectDependencies (m : MkMatcherInput) : MetaM FVarIdSet 
goal: Lean.MetaM Lean.FVarIdSet

full_name: Lean.Meta.Match.withCleanLCtxFor
code: /--
Auxiliary method used at `mkMatcher`. It executes `k` in a local context that contains only
the local declarations `m` depends on. This is important because otherwise dependent elimination
may "refine" the types of unnecessary declarations and accidentally introduce unnecessary dependencies
in the auto-generated auxiliary declaration. Note that this is not just an optimization because the
unnecessary dependencies may prevent the termination checker from succeeding. For an example,
see issue #1237.
-/
def withCleanLCtxFor (m : MkMatcherInput) (k : MetaM α) : MetaM α 
goal: Lean.MetaM α

full_name: Lean.Meta.Match.mkMatcher
code: /--
Create a dependent matcher for `matchType` where `matchType` is of the form
`(a_1 : A_1) -> (a_2 : A_2[a_1]) -> ... -> (a_n : A_n[a_1, a_2, ... a_{n-1}]) -> B[a_1, ..., a_n]`
where `n = numDiscrs`, and the `lhss` are the left-hand-sides of the `match`-expression alternatives.
Each `AltLHS` has a list of local declarations and a list of patterns.
The number of patterns must be the same in each `AltLHS`.
The generated matcher has the structure described at `MatcherInfo`. The motive argument is of the form
`(motive : (a_1 : A_1) -> (a_2 : A_2[a_1]) -> ... -> (a_n : A_n[a_1, a_2, ... a_{n-1}]) -> Sort v)`
where `v` is a universe parameter or 0 if `B[a_1, ..., a_n]` is a proposition.

If `exceptionIfContainsSorry := true`, then `mkMatcher` throws an exception if the auxiliary
declarations contains a `sorry`. We use this argument to workaround a bug at `IndPredBelow.mkBelowMatcher`.
-/
def mkMatcher (input : MkMatcherInput) (exceptionIfContainsSorry := false) : MetaM MatcherResult 
goal: Lean.MetaM Lean.Meta.Match.MatcherResult

full_name: Lean.Meta.Match.getMkMatcherInputInContext
code: def getMkMatcherInputInContext (matcherApp : MatcherApp) : MetaM MkMatcherInput 
goal: Lean.MetaM Lean.Meta.Match.MkMatcherInput

full_name: Lean.Meta.Match.withMkMatcherInput
code: /-- This function is only used for testing purposes -/
def withMkMatcherInput (matcherName : Name) (k : MkMatcherInput → MetaM α) : MetaM α 
goal: Lean.MetaM α

full_name: Lean.Meta.initFn._@..lake.packages.lean4.src.lean.Lean.Meta.Match.Match._hyg.14337
code: builtin_initialize
  registerTraceClass `Meta.Match.match
  registerTraceClass `Meta.Match.debug
  registerTraceClass `Meta.Match.unify
goal: IO Unit