Documentation

Lean.Meta.Closure

structure Lean.Meta.Closure.Context :
Type
structure Lean.Meta.Closure.State :
Type
@[inline]
Equations
@[inline]
Equations
Equations
Equations
Equations
  • Lean.Meta.Closure.mkNextUserName = do let s ← get let n : Lean.Name := Lean.Name.appendIndexAfter `_x s.nextExprIdx modify fun s => { visitedLevel := s.visitedLevel, visitedExpr := s.visitedExpr, levelParams := s.levelParams, nextLevelIdx := s.nextLevelIdx, levelArgs := s.levelArgs, newLocalDecls := s.newLocalDecls, newLocalDeclsForMVars := s.newLocalDeclsForMVars, newLetDecls := s.newLetDecls, nextExprIdx := s.nextExprIdx + 1, exprMVarArgs := s.exprMVarArgs, exprFVarArgs := s.exprFVarArgs, toProcess := s.toProcess } pure n
Equations
  • Lean.Meta.Closure.pushToProcess elem = modify fun s => { visitedLevel := s.visitedLevel, visitedExpr := s.visitedExpr, levelParams := s.levelParams, nextLevelIdx := s.nextLevelIdx, levelArgs := s.levelArgs, newLocalDecls := s.newLocalDecls, newLocalDeclsForMVars := s.newLocalDeclsForMVars, newLetDecls := s.newLetDecls, nextExprIdx := s.nextExprIdx, exprMVarArgs := s.exprMVarArgs, exprFVarArgs := s.exprFVarArgs, toProcess := Array.push s.toProcess elem }
Equations
  • Lean.Meta.Closure.pickNextToProcess? = do let lctx ← Lean.getLCtx let s ← get if Array.isEmpty s.toProcess = true then pure none else modifyGet fun s => let elem := Array.back s.toProcess; let toProcess := Array.pop s.toProcess; let x := Lean.Meta.Closure.pickNextToProcessAux lctx 0 toProcess elem; match x with | (elem, toProcess) => (some elem, { visitedLevel := s.visitedLevel, visitedExpr := s.visitedExpr, levelParams := s.levelParams, nextLevelIdx := s.nextLevelIdx, levelArgs := s.levelArgs, newLocalDecls := s.newLocalDecls, newLocalDeclsForMVars := s.newLocalDeclsForMVars, newLetDecls := s.newLetDecls, nextExprIdx := s.nextExprIdx, exprMVarArgs := s.exprMVarArgs, exprFVarArgs := s.exprFVarArgs, toProcess := toProcess })
Equations
  • Lean.Meta.Closure.pushFVarArg e = modify fun s => { visitedLevel := s.visitedLevel, visitedExpr := s.visitedExpr, levelParams := s.levelParams, nextLevelIdx := s.nextLevelIdx, levelArgs := s.levelArgs, newLocalDecls := s.newLocalDecls, newLocalDeclsForMVars := s.newLocalDeclsForMVars, newLetDecls := s.newLetDecls, nextExprIdx := s.nextExprIdx, exprMVarArgs := s.exprMVarArgs, exprFVarArgs := Array.push s.exprFVarArgs e, toProcess := s.toProcess }
Equations
  • Lean.Meta.Closure.pushLocalDecl newFVarId userName type bi = do let type ← Lean.Meta.Closure.collectExpr type modify fun s => { visitedLevel := s.visitedLevel, visitedExpr := s.visitedExpr, levelParams := s.levelParams, nextLevelIdx := s.nextLevelIdx, levelArgs := s.levelArgs, newLocalDecls := Array.push s.newLocalDecls (Lean.LocalDecl.cdecl default newFVarId userName type bi), newLocalDeclsForMVars := s.newLocalDeclsForMVars, newLetDecls := s.newLetDecls, nextExprIdx := s.nextExprIdx, exprMVarArgs := s.exprMVarArgs, exprFVarArgs := s.exprFVarArgs, toProcess := s.toProcess }
@[inline]
Equations
Equations
Equations
Equations