Sort the given FVarId
s by the order in which they appear in the current local
context. If any of the FVarId
s do not appear in the current local context, the
result is unspecified.
Equations
- Lean.Meta.sortFVarsByContextOrder hyps = do let __do_lift ← Lean.getLCtx pure (Lean.LocalContext.sortFVarsByContextOrder __do_lift hyps)
Instances For
Get the MetavarDecl
of mvarId
. If mvarId
is not a declared metavariable
in the given MetavarContext
, throw an error.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Declare a metavariable. You must make sure that the metavariable is not already declared.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Check whether a metavariable is assigned or delayed-assigned. A delayed-assigned metavariable is already 'solved' but the solution cannot be substituted yet because we have to wait for some other metavariables to be assigned first. So in most situations you want to treat a delayed-assigned metavariable as assigned.
Equations
- Lean.MetavarContext.isExprMVarAssignedOrDelayedAssigned mctx mvarId = (Lean.PersistentHashMap.contains mctx.eAssignment mvarId || Lean.PersistentHashMap.contains mctx.dAssignment mvarId)
Instances For
Check whether a metavariable is declared in the given MetavarContext
.
Equations
- Lean.MetavarContext.isExprMVarDeclared mctx mvarId = Lean.PersistentHashMap.contains mctx.decls mvarId
Instances For
Erase any assignment or delayed assignment of the given metavariable.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Obtain all unassigned metavariables from the given MetavarContext
. If
includeDelayed
is true
, delayed-assigned metavariables are considered
unassigned.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Check whether a metavariable is declared.
Equations
- Lean.MVarId.isDeclared mvarId = do let __do_lift ← Lean.getMCtx pure (Lean.MetavarContext.isExprMVarDeclared __do_lift mvarId)
Instances For
Erase any assignment or delayed assignment of the given metavariable.
Equations
- Lean.MVarId.eraseAssignment mvarId = Lean.modifyMCtx fun (x : Lean.MetavarContext) => Lean.MetavarContext.eraseExprMVarAssignment x mvarId
Instances For
Solve a goal by synthesizing an instance.
Equations
- Lean.MVarId.synthInstance g = do let __do_lift ← Lean.MVarId.getType g let __do_lift ← Lean.Meta.synthInstance __do_lift Lean.MVarId.assign g __do_lift
Instances For
Get the type the given metavariable after instantiating metavariables and cleaning up annotations.
Equations
- Lean.MVarId.getTypeCleanup mvarId = do let __do_lift ← Lean.MVarId.getType mvarId let __do_lift ← Lean.instantiateMVars __do_lift pure (Lean.Expr.cleanupAnnotations __do_lift)
Instances For
Obtain all unassigned metavariables. If includeDelayed
is true
,
delayed-assigned metavariables are considered unassigned.
Equations
- Lean.Meta.getUnassignedExprMVars includeDelayed = do let __do_lift ← Lean.getMCtx pure (Lean.MetavarContext.unassignedExprMVars __do_lift includeDelayed)
Instances For
Run a computation with hygiene turned off.
Equations
- Lean.Meta.unhygienic x = Lean.withOptions (fun (x : Lean.Options) => Lean.Option.set x Lean.Meta.tactic.hygienic false) x
Instances For
A variant of mkFreshId
which generates names with a particular prefix. The
generated names are unique and have the form <prefix>.<N>
where N
is a
natural number. They are not suitable as user-facing names.
Equations
- One or more equations did not get rendered due to their size.
Instances For
saturate1 goal tac
runs tac
on goal
, then on the resulting goals, etc.,
until tac
does not apply to any goal any more (i.e. it returns none
). The
order of applications is depth-first, so if tac
generates goals [g₁, g₂, ⋯]
,
we apply tac
to g₁
and recursively to all its subgoals before visiting g₂
.
If tac
does not apply to goal
, saturate1
returns none
. Otherwise it
returns the generated subgoals to which tac
did not apply. saturate1
respects the MonadRecDepth
recursion limit.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Auxiliary definition for saturate1
.