Documentation

Lean.Meta.Tactic.Repeat

def Lean.Meta.repeat'Core {m : TypeType} {ε : Type u_1} {s : Type} [Monad m] [MonadExcept ε m] [MonadBacktrack s m] [MonadMCtx m] (f : MVarIdm (List MVarId)) (goals : List MVarId) (maxIters : Nat := 100000) :

Implementation of repeat' and repeat1'.

repeat'Core f runs f on all of the goals to produce a new list of goals, then runs f again on all of those goals, and repeats until f fails on all remaining goals, or until maxIters total calls to f have occurred.

Returns a boolean indicating whether f succeeded at least once, and all the remaining goals (i.e. those on which f failed).

Equations
    Instances For
      @[irreducible]
      def Lean.Meta.repeat'Core.go {m : TypeType} {ε : Type u_1} {s : Type} [Monad m] [MonadExcept ε m] [MonadBacktrack s m] [MonadMCtx m] (f : MVarIdm (List MVarId)) :

      Auxiliary for repeat'Core. repeat'Core.go f maxIters progress goals stk acc evaluates to essentially acc.toList ++ repeat' f (goals::stk).join maxIters: that is, acc are goals we will not revisit, and (goals::stk).join is the accumulated todo list of subgoals.

      Equations
        Instances For
          def Lean.Meta.repeat' {m : TypeType} {ε : Type u_1} {s : Type} [Monad m] [MonadExcept ε m] [MonadBacktrack s m] [MonadMCtx m] (f : MVarIdm (List MVarId)) (goals : List MVarId) (maxIters : Nat := 100000) :

          repeat' f runs f on all of the goals to produce a new list of goals, then runs f again on all of those goals, and repeats until f fails on all remaining goals, or until maxIters total calls to f have occurred. Always succeeds (returning the original goals if f fails on all of them).

          Equations
            Instances For
              def Lean.Meta.repeat1' {m : TypeType} {ε : Type u_1} {s : Type} [Monad m] [MonadError m] [MonadExcept ε m] [MonadBacktrack s m] [MonadMCtx m] (f : MVarIdm (List MVarId)) (goals : List MVarId) (maxIters : Nat := 100000) :

              repeat1' f runs f on all of the goals to produce a new list of goals, then runs f again on all of those goals, and repeats until f fails on all remaining goals, or until maxIters total calls to f have occurred. Fails if f does not succeed at least once.

              Equations
                Instances For