Equations
- Lean.Elab.Structural.RecArgInfo.recArgPos info = Array.size info.fixedParams + info.pos
@[inline]
Equations
- Lean.Elab.Structural.instInhabitedM = { default := Lean.throwError (Lean.toMessageData "failed") }
def
Lean.Elab.Structural.run
{α : Type}
(x : Lean.Elab.Structural.M α)
(s : optParam Lean.Elab.Structural.State { addMatchers := #[] })
:
Equations
- Lean.Elab.Structural.run x s = StateRefT'.run x s
def
Lean.Elab.Structural.recArgHasLooseBVarsAt
(recFnName : Lean.Name)
(recArgPos : Nat)
(e : Lean.Expr)
:
Equations
- Lean.Elab.Structural.recArgHasLooseBVarsAt recFnName recArgPos e = let app? := Lean.Expr.find? (fun e => Lean.Expr.isAppOf e recFnName && decide (Lean.Expr.getAppNumArgs e > recArgPos) && Lean.Expr.hasLooseBVars (Lean.Expr.getArg! e recArgPos (Lean.Expr.getAppNumArgs e))) e; Option.isSome app?
Equations
- Lean.Elab.Structural.ensureNoRecFn recFnName e = if Lean.Elab.Structural.containsRecFn recFnName e = true then do Lean.Meta.forEachExpr e fun e => if Lean.Expr.isAppOf e recFnName = true then Lean.throwError (Lean.toMessageData "unexpected occurrence of recursive application" ++ Lean.toMessageData (Lean.indentExpr e) ++ Lean.toMessageData "") else pure PUnit.unit pure e else pure e