File: .lake/packages/lean4/src/lean/Lean/Elab/Tactic/Conv/Pattern.lean

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Tactic.Conv.Pattern.0.Lean.Elab.Tactic.Conv.getContext
code: private def getContext : MetaM Simp.Context 
goal: Lean.MetaM Lean.Meta.Simp.Context

full_name: Lean.Elab.Tactic.Conv.matchPattern?.go?
code: partial def matchPattern? (pattern : AbstractMVarsResult) (e : Expr) : MetaM (Option (Expr × Array Expr)) 
goal: Lean.MetaM (Option (Lean.Expr × Array Lean.Expr))

full_name: Lean.Elab.Tactic.Conv.matchPattern?
code: partial def matchPattern? (pattern : AbstractMVarsResult) (e : Expr) : MetaM (Option (Expr × Array Expr)) 
goal: Lean.MetaM (Option (Lean.Expr × Array Lean.Expr))

full_name: Lean.Elab.Tactic.Conv.PatternMatchState
code: inductive PatternMatchState where
  /--
  The state corresponding to a `(occs := *)` pattern, which acts like `occs := 1 2 ... n` where
  `n` is the total number of pattern matches.
  * `subgoals` is the list of subgoals for patterns already matched
  -/
  | all (subgoals : Array MVarId)
  /--
  The state corresponding to a partially consumed `(occs := a₁ a₂ ...)` pattern.
  * `subgoals` is the list of subgoals for patterns already matched,
    along with their index in the original occs list
  * `idx` is the number of matches that have occurred so far
  * `remaining` is a list of `(i, orig)` pairs representing matches we have not yet reached.
    We maintain the invariant that `idx :: remaining.map (·.1)` is sorted.
    The number `i` is the value in the `occs` list and `orig` is its index in the list.
  -/
  | occs (subgoals : Array (Nat × MVarId)) (idx : Nat) (remaining : List (Nat × Nat))
goal: Type

full_name: Lean.Elab.Tactic.Conv.PatternMatchState.all
code: inductive PatternMatchState where
  /--
  The state corresponding to a `(occs := *)` pattern, which acts like `occs := 1 2 ... n` where
  `n` is the total number of pattern matches.
  * `subgoals` is the list of subgoals for patterns already matched
  -/
  | all (subgoals : Array MVarId)
  /--
  The state corresponding to a partially consumed `(occs := a₁ a₂ ...)` pattern.
  * `subgoals` is the list of subgoals for patterns already matched,
    along with their index in the original occs list
  * `idx` is the number of matches that have occurred so far
  * `remaining` is a list of `(i, orig)` pairs representing matches we have not yet reached.
    We maintain the invariant that `idx :: remaining.map (·.1)` is sorted.
    The number `i` is the value in the `occs` list and `orig` is its index in the list.
  -/
  | occs (subgoals : Array (Nat × MVarId)) (idx : Nat) (remaining : List (Nat × Nat))
goal: Lean.Elab.Tactic.Conv.PatternMatchState

full_name: Lean.Elab.Tactic.Conv.PatternMatchState.occs
code: inductive PatternMatchState where
  /--
  The state corresponding to a `(occs := *)` pattern, which acts like `occs := 1 2 ... n` where
  `n` is the total number of pattern matches.
  * `subgoals` is the list of subgoals for patterns already matched
  -/
  | all (subgoals : Array MVarId)
  /--
  The state corresponding to a partially consumed `(occs := a₁ a₂ ...)` pattern.
  * `subgoals` is the list of subgoals for patterns already matched,
    along with their index in the original occs list
  * `idx` is the number of matches that have occurred so far
  * `remaining` is a list of `(i, orig)` pairs representing matches we have not yet reached.
    We maintain the invariant that `idx :: remaining.map (·.1)` is sorted.
    The number `i` is the value in the `occs` list and `orig` is its index in the list.
  -/
  | occs (subgoals : Array (Nat × MVarId)) (idx : Nat) (remaining : List (Nat × Nat))
goal: Lean.Elab.Tactic.Conv.PatternMatchState

full_name: Lean.Elab.Tactic.Conv.PatternMatchState.isDone
code: /-- Is this pattern no longer interested in accepting matches? -/
def isDone : PatternMatchState → Bool
  
goal: Lean.Elab.Tactic.Conv.PatternMatchState → Bool

full_name: Lean.Elab.Tactic.Conv.PatternMatchState.isReady
code: /-- Is this pattern interested in accepting the next match? -/
def isReady : PatternMatchState → Bool
  
goal: Lean.Elab.Tactic.Conv.PatternMatchState → Bool

full_name: Lean.Elab.Tactic.Conv.PatternMatchState.skip
code: /-- Assuming `isReady` returned false, this advances to the next match. -/
def skip : PatternMatchState → PatternMatchState
  
goal: Lean.Elab.Tactic.Conv.PatternMatchState → Lean.Elab.Tactic.Conv.PatternMatchState

full_name: Lean.Elab.Tactic.Conv.PatternMatchState.accept
code: /--
Assuming `isReady` returned true, this adds the generated subgoal to the list
and advances to the next match.
-/
def accept (mvarId : MVarId) : PatternMatchState → PatternMatchState
  
goal: Lean.Elab.Tactic.Conv.PatternMatchState → Lean.Elab.Tactic.Conv.PatternMatchState

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Tactic.Conv.Pattern.0.Lean.Elab.Tactic.Conv.pre
code: private def pre (pattern : AbstractMVarsResult) (state : IO.Ref PatternMatchState) (e : Expr) : SimpM Simp.Step 
goal: Lean.Meta.SimpM Lean.Meta.Simp.Step

full_name: Lean.Elab.Tactic.Conv.evalPattern
code: @[builtin_tactic Lean.Parser.Tactic.Conv.pattern] def evalPattern : Tactic 
goal: Lean.Elab.Tactic.Tactic