Assign mvarId := sorry
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Lean.Elab.goalsToMessageData goals = Lean.MessageData.joinSep (List.map Lean.MessageData.ofGoal goals) (Lean.toMessageData "\n\n")
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
- elaborator : Lake.Name
Declaration name of the executing elaborator, used by
mkTacticInfo
to persist it in the info tree - recover : Bool
If
true
, enable "error recovery" in some tactics. For example,cases
tactic admits unsolved alternatives whenrecover == true
. The combinatorwithoutRecover
disables "error recovery" while executing
. This is useful for tactics such asfirst | ... | ...
.
Instances For
- term : Lean.Elab.Term.SavedState
- tactic : Lean.Elab.Tactic.State
Instances For
Equations
Instances For
Equations
Instances For
Equations
- Lean.Elab.Tactic.instMonadTacticM = let i := inferInstanceAs (Monad Lean.Elab.Tactic.TacticM); Monad.mk
Equations
- Lean.Elab.Tactic.getGoals = do let __do_lift ← get pure __do_lift.goals
Instances For
Equations
- Lean.Elab.Tactic.setGoals mvarIds = modify fun x => { goals := mvarIds }
Instances For
Equations
- Lean.Elab.Tactic.pruneSolvedGoals = do let gs ← Lean.Elab.Tactic.getGoals let gs ← List.filterM (fun g => not <$> Lean.MVarId.isAssigned g) gs Lean.Elab.Tactic.setGoals gs
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Lean.Elab.Tactic.saveState = do let __do_lift ← liftM Lean.Elab.Term.saveState let __do_lift_1 ← get pure { term := __do_lift, tactic := __do_lift_1 }
Instances For
Equations
- Lean.Elab.Tactic.SavedState.restore b restoreInfo = do liftM (Lean.Elab.Term.SavedState.restore b.term restoreInfo) set b.tactic
Instances For
Equations
- Lean.Elab.Tactic.getCurrMacroScope = do let __do_lift ← readThe Lean.Core.Context pure __do_lift.currMacroScope
Instances For
Equations
- Lean.Elab.Tactic.getMainModule = do let __do_lift ← Lean.getEnv pure (Lean.Environment.mainModule __do_lift)
Instances For
Equations
- Lean.Elab.Tactic.mkTacticAttribute = Lean.Elab.mkElabAttribute Lean.Elab.Tactic.Tactic `builtin_tactic `tactic `Lean.Parser.Tactic `Lean.Elab.Tactic.Tactic "tactic"
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Lean.Elab.Tactic.mkInitialTacticInfo stx = do let mctxBefore ← Lean.getMCtx let goalsBefore ← Lean.Elab.Tactic.getUnsolvedGoals pure (Lean.Elab.Tactic.mkTacticInfo mctxBefore goalsBefore stx)
Instances For
Equations
- Lean.Elab.Tactic.withTacticInfoContext stx x = do let __do_lift ← Lean.Elab.Tactic.mkInitialTacticInfo stx Lean.Elab.withInfoContext x __do_lift
Instances For
Important: we must define evalTactic
before we define
the instance MonadExcept
for TacticM
since it backtracks the state including error messages,
and this is bad when rethrowing the exception at the catch
block in these methods.
We marked these places with a (*)
in these methods.
- exception : Lean.Exception
- state : Lean.Elab.Tactic.SavedState
Auxiliary datastructure for capturing exceptions at evalTactic
.
Instances For
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.
Instances For
Equations
- Lean.Elab.Tactic.throwNoGoalsToBeSolved = Lean.throwError (Lean.toMessageData "no goals to be solved")
Instances For
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.
Instances For
Equations
- Lean.Elab.Tactic.focusAndDone tactic = Lean.Elab.Tactic.focus do let a ← tactic Lean.Elab.Tactic.done pure a
Instances For
Close the main goal using the given tactic. If it fails, log the error and admit
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Lean.Elab.Tactic.instMonadBacktrackSavedStateTacticM = { saveState := Lean.Elab.Tactic.saveState, restoreState := fun b => Lean.Elab.Tactic.SavedState.restore b false }
Equations
- Lean.Elab.Tactic.tryCatch x h = do let b ← Lean.saveState tryCatch x fun ex => do Lean.Elab.Tactic.SavedState.restore b false h ex
Instances For
Equations
- Lean.Elab.Tactic.instMonadExceptExceptionTacticM = { throw := fun {α} => throw, tryCatch := fun {α} => Lean.Elab.Tactic.tryCatch }
Execute x
with error recovery disabled
Equations
- Lean.Elab.Tactic.withoutRecover x = withReader (fun ctx => { elaborator := ctx.elaborator, recover := false }) x
Instances For
Equations
- Lean.Elab.Tactic.orElse x y = tryCatch (Lean.Elab.Tactic.withoutRecover x) fun x => y ()
Instances For
Equations
- Lean.Elab.Tactic.instOrElseTacticM = { orElse := Lean.Elab.Tactic.orElse }
Equations
- Lean.Elab.Tactic.instAlternativeTacticM = Alternative.mk (fun {x} => Lean.throwError (Lean.toMessageData "failed")) fun {α} => Lean.Elab.Tactic.orElse
Save the current tactic state for a token stx
.
This method is a no-op if stx
has no position information.
We use this method to save the tactic state at punctuation such as ;
Equations
- Lean.Elab.Tactic.saveTacticInfoForToken stx = if Option.isNone (Lean.Syntax.getPos? stx) = true then pure PUnit.unit else Lean.Elab.Tactic.withTacticInfoContext stx (pure ())
Instances For
Elaborate x
with stx
on the macro stack
Equations
- One or more equations did not get rendered due to their size.
Instances For
Adapt a syntax transformation to a regular tactic evaluator.
Equations
- Lean.Elab.Tactic.adaptExpander exp stx = do let stx' ← exp stx Lean.Elab.Tactic.withMacroExpansion stx stx' (Lean.Elab.Tactic.evalTactic stx')
Instances For
Add the given goals at the end of the current goals collection.
Equations
- Lean.Elab.Tactic.appendGoals mvarIds = modify fun s => { goals := s.goals ++ mvarIds }
Instances For
Discard the first goal and replace it by the given list of goals, keeping the other goals.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Return the first goal.
Equations
- Lean.Elab.Tactic.getMainGoal = do let __do_lift ← Lean.Elab.Tactic.getGoals Lean.Elab.Tactic.getMainGoal.loop __do_lift
Instances For
Equations
- One or more equations did not get rendered due to their size.
- Lean.Elab.Tactic.getMainGoal.loop [] = Lean.Elab.Tactic.throwNoGoalsToBeSolved
Instances For
Return the main goal metavariable declaration.
Equations
- Lean.Elab.Tactic.getMainDecl = do let __do_lift ← Lean.Elab.Tactic.getMainGoal liftM (Lean.MVarId.getDecl __do_lift)
Instances For
Return the main goal tag.
Equations
- Lean.Elab.Tactic.getMainTag = do let __do_lift ← Lean.Elab.Tactic.getMainDecl pure __do_lift.userName
Instances For
Return expected type for the main goal.
Equations
- Lean.Elab.Tactic.getMainTarget = do let __do_lift ← Lean.Elab.Tactic.getMainDecl Lean.instantiateMVars __do_lift.type
Instances For
Execute x
using the main goal local context and instances
Equations
- Lean.Elab.Tactic.withMainContext x = do let __do_lift ← Lean.Elab.Tactic.getMainGoal Lean.MVarId.withContext __do_lift x
Instances For
Evaluate tac
at mvarId
, and return the list of resulting subgoals.
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.
Instances For
Close main goal using the given expression. If checkUnassigned == true
, then val
must not contain unassigned metavariables.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Lean.Elab.Tactic.liftMetaMAtMain x = Lean.Elab.Tactic.withMainContext do let __do_lift ← Lean.Elab.Tactic.getMainGoal liftM (x __do_lift)
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Get the mvarid of the main goal, run the given tactic
,
then set the new goals to be the resulting goal list.
Equations
- Lean.Elab.Tactic.liftMetaTactic tactic = Lean.Elab.Tactic.liftMetaTacticAux fun mvarId => do let gs ← tactic mvarId pure ((), gs)
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Instances For
Equations
Instances For
Use parentTag
to tag untagged goals at newGoals
.
If there are multiple new untagged goals, they are named using
where idx > 0
.
If there is only one new untagged goal, then we just use parentTag
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Lean.Elab.Tactic.getNameOfIdent' id = if Lean.Syntax.isIdent id = true then Lean.Syntax.getId id else `_
Instances For
Use position of => $body
for error messages.
If there is a line break before body
, the message will be displayed on =>
only,
but the "full range" for the info view will still include body
.
Equations
- Lean.Elab.Tactic.withCaseRef arrow body x = Lean.withRef (Lean.mkNullNode #[arrow, body]) x