Equations
- One or more equations did not get rendered due to their size.
Instances For
- all: Array Lean.MVarId → Lean.Elab.Tactic.Conv.PatternMatchState
The state corresponding to a
(occs := *)pattern, which acts likeoccs := 1 2 ... nwherenis the total number of pattern matches.subgoalsis the list of subgoals for patterns already matched
- occs: Array (Nat × Lean.MVarId) → Nat → List (Nat × Nat) → Lean.Elab.Tactic.Conv.PatternMatchState
The state corresponding to a partially consumed
(occs := a₁ a₂ ...)pattern.subgoalsis the list of subgoals for patterns already matched, along with their index in the original occs listidxis the number of matches that have occurred so farremainingis a list of(i, orig)pairs representing matches we have not yet reached. We maintain the invariant thatidx :: remaining.map (·.1)is sorted. The numberiis the value in theoccslist andorigis its index in the list.
Instances For
Is this pattern no longer interested in accepting matches?
Equations
- x.isDone = match x with | Lean.Elab.Tactic.Conv.PatternMatchState.all subgoals => false | Lean.Elab.Tactic.Conv.PatternMatchState.occs subgoals idx remaining => remaining.isEmpty
Instances For
Is this pattern interested in accepting the next match?
Equations
- x.isReady = match x with | Lean.Elab.Tactic.Conv.PatternMatchState.all subgoals => true | Lean.Elab.Tactic.Conv.PatternMatchState.occs subgoals idx ((i, snd) :: tail) => idx == i | x => false
Instances For
Assuming isReady returned false, this advances to the next match.
Equations
- x.skip = match x with | Lean.Elab.Tactic.Conv.PatternMatchState.occs subgoals idx remaining => Lean.Elab.Tactic.Conv.PatternMatchState.occs subgoals (idx + 1) remaining | s => s
Instances For
Assuming isReady returned true, this adds the generated subgoal to the list
and advances to the next match.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.