Throws an exception if target of the given goal contains metavariables.
Equations
- One or more equations did not get rendered due to their size.
Throws an exception if target is not a proposition.
Equations
- One or more equations did not get rendered due to their size.
Returns true
if declName
is the name of a grind helper declaration that
should not be unfolded by unfoldReducible
.
Equations
- Lean.Meta.Grind.isGrindGadget declName = (declName == `Lean.Grind.EqMatch)
Unfolds all reducible
declarations occurring in e
.
Equations
- One or more equations did not get rendered due to their size.
Unfolds all reducible
declarations occurring in the goal's target.
Equations
- mvarId.unfoldReducible = mvarId.transformTarget Lean.Meta.Grind.unfoldReducible
Abstracts nested proofs occurring in the goal's target.
Equations
- mvarId.abstractNestedProofs mainDeclName = mvarId.transformTarget (Lean.Meta.abstractNestedProofs mainDeclName)
Beta-reduces the goal's target.
Equations
- mvarId.betaReduce = mvarId.transformTarget fun (x : Lean.Expr) => liftM (Lean.Core.betaReduce x)
Clears auxiliary decls used to encode recursive declarations.
grind
eliminates them to ensure they are not accidentally used by its proof automation.
Equations
- One or more equations did not get rendered due to their size.
In the grind
tactic, during Expr
internalization, we don't expect to find Expr.mdata
.
This function ensures Expr.mdata
is not found during internalization.
Recall that we do not internalize Expr.lam
children.
Recall that we still have to process Expr.forallE
because of ForallProp.lean
.
Moreover, we may not want to reduce p → q
to ¬p ∨ q
when (p q : Prop)
.
Equations
- One or more equations did not get rendered due to their size.
Converts nested Expr.proj
s into projection applications if possible.
Equations
- One or more equations did not get rendered due to their size.
Normalizes universe levels in constants and sorts.
Equations
- One or more equations did not get rendered due to their size.
Normalizes the given expression using the grind
simplification theorems and simprocs.
This function is used for normalzing E-matching patterns. Note that it does not return a proof.
Returns Grind.MatchCond e
.
We have special support for propagating is truth value.
See comment at MatchCond.lean
.
Equations
- Lean.Meta.Grind.markAsMatchCond e = Lean.mkApp (Lean.mkConst `Lean.Grind.MatchCond) e
Equations
- Lean.Meta.Grind.isMatchCond e = e.isAppOfArity `Lean.Grind.MatchCond 1
Returns Grind.PreMatchCond e
.
Recall that Grind.PreMatchCond
is an identity function,
but the simproc reducePreMatchCond
is used to prevent the term e
from being simplified.
Grind.PreMatchCond
is later converted into Grind.MatchCond
.
See comment at MatchCond.lean
.
Equations
- Lean.Meta.Grind.markAsPreMatchCond e = Lean.mkApp (Lean.mkConst `Lean.Grind.PreMatchCond) e
Equations
- Lean.Meta.Grind.isPreMatchCond e = e.isAppOfArity `Lean.Grind.PreMatchCond 1
Equations
- One or more equations did not get rendered due to their size.
Adds reducePreMatchCond
to s
Equations
- Lean.Meta.Grind.addPreMatchCondSimproc s = s.add `Lean.Meta.Grind.reducePreMatchCond false
Converts Grind.PreMatchCond
into Grind.MatchCond
.
Recall that Grind.PreMatchCond
uses default reducibility setting, but
Grind.MatchCond
does not.
Equations
- One or more equations did not get rendered due to their size.