Documentation

Lean.MetavarContext

structure Lean.LocalInstance :
Type
Equations
Equations
Equations
inductive Lean.MetavarKind :
Type
Equations
Equations
structure Lean.MetavarDecl :
Type
Equations
  • Lean.instInhabitedMetavarDecl = { default := { userName := default, lctx := default, type := default, depth := default, localInstances := default, kind := default, numScopeArgs := default, index := default } }
instance Lean.instMonadMCtx (m : TypeType) (n : TypeType) [inst : MonadLift m n] [inst : Lean.MonadMCtx m] :
Equations
Equations
Equations
Equations
  • Lean.MetavarContext.addExprMVarDecl mctx mvarId userName lctx localInstances type kind numScopeArgs = { depth := mctx.depth, mvarCounter := mctx.mvarCounter + 1, lDepth := mctx.lDepth, decls := Std.PersistentHashMap.insert mctx.decls mvarId { userName := userName, lctx := lctx, type := type, depth := mctx.depth, localInstances := localInstances, kind := kind, numScopeArgs := numScopeArgs, index := mctx.mvarCounter }, userNames := if Lean.Name.isAnonymous userName = true then mctx.userNames else Std.PersistentHashMap.insert mctx.userNames userName mvarId, lAssignment := mctx.lAssignment, eAssignment := mctx.eAssignment, dAssignment := mctx.dAssignment }
Equations
Equations
  • Lean.MetavarContext.addLevelMVarDecl mctx mvarId = { depth := mctx.depth, mvarCounter := mctx.mvarCounter, lDepth := Std.PersistentHashMap.insert mctx.lDepth mvarId mctx.depth, decls := mctx.decls, userNames := mctx.userNames, lAssignment := mctx.lAssignment, eAssignment := mctx.eAssignment, dAssignment := mctx.dAssignment }
Equations
Equations
  • Lean.MetavarContext.setMVarKind mctx mvarId kind = let decl := Lean.MetavarContext.getDecl mctx mvarId; { depth := mctx.depth, mvarCounter := mctx.mvarCounter, lDepth := mctx.lDepth, decls := Std.PersistentHashMap.insert mctx.decls mvarId { userName := decl.userName, lctx := decl.lctx, type := decl.type, depth := decl.depth, localInstances := decl.localInstances, kind := kind, numScopeArgs := decl.numScopeArgs, index := decl.index }, userNames := mctx.userNames, lAssignment := mctx.lAssignment, eAssignment := mctx.eAssignment, dAssignment := mctx.dAssignment }
Equations
Equations
  • Lean.MetavarContext.setMVarType mctx mvarId type = let decl := Lean.MetavarContext.getDecl mctx mvarId; { depth := mctx.depth, mvarCounter := mctx.mvarCounter, lDepth := mctx.lDepth, decls := Std.PersistentHashMap.insert mctx.decls mvarId { userName := decl.userName, lctx := decl.lctx, type := type, depth := decl.depth, localInstances := decl.localInstances, kind := decl.kind, numScopeArgs := decl.numScopeArgs, index := decl.index }, userNames := mctx.userNames, lAssignment := mctx.lAssignment, eAssignment := mctx.eAssignment, dAssignment := mctx.dAssignment }
Equations
Equations
Equations
Equations
Equations
  • Lean.MetavarContext.assignDelayed m mvarId lctx fvars val = { depth := m.depth, mvarCounter := m.mvarCounter, lDepth := m.lDepth, decls := m.decls, userNames := m.userNames, lAssignment := m.lAssignment, eAssignment := m.eAssignment, dAssignment := Std.PersistentHashMap.insert m.dAssignment mvarId { lctx := lctx, fvars := fvars, val := val } }
Equations
Equations
Equations
Equations
  • Lean.MetavarContext.incDepth mctx = { depth := mctx.depth + 1, mvarCounter := mctx.mvarCounter, lDepth := mctx.lDepth, decls := mctx.decls, userNames := mctx.userNames, lAssignment := mctx.lAssignment, eAssignment := mctx.eAssignment, dAssignment := mctx.dAssignment }
partial def Lean.MetavarContext.instantiateLevelMVars {m : TypeType} [inst : Monad m] [inst : Lean.MonadMCtx m] :
partial def Lean.MetavarContext.instantiateExprMVars {m : TypeType} {ω : outParam Type} [inst : Monad m] [inst : Lean.MonadMCtx m] [inst : STWorld ω m] [inst : MonadLiftT (ST ω) m] (e : Lean.Expr) :
Equations
  • Lean.MetavarContext.instMonadMCtxStateRefT'MetavarContextST = { getMCtx := get, modifyMCtx := modify }
Equations
Equations
Equations
Equations
Equations
Equations
@[specialize]
Equations
Equations
@[inline]
Equations
@[inline]
Equations
Equations
def Lean.MetavarContext.levelMVarToParam (mctx : Lean.MetavarContext) (alreadyUsedPred : Lean.NameBool) (e : Lean.Expr) (paramNamePrefix : optParam Lean.Name `u) (nextParamIdx : optParam Nat 1) :
Equations
  • Lean.MetavarContext.levelMVarToParam mctx alreadyUsedPred e paramNamePrefix nextParamIdx = let x := Lean.MetavarContext.LevelMVarToParam.main e { paramNamePrefix := paramNamePrefix, alreadyUsedPred := alreadyUsedPred } { mctx := mctx, paramNames := #[], nextParamIdx := nextParamIdx, cache := }; match x with | (e, s) => { mctx := s.mctx, newParamNames := s.paramNames, nextParamIdx := s.nextParamIdx, expr := e }