@[inline]
Equations
Equations
- Lean.IR.Borrow.OwnedSet.beq _fun_discr _fun_discr = match _fun_discr, _fun_discr with | (f₁, x₁), (f₂, x₂) => f₁ == f₂ && x₁ == x₂
Equations
Equations
- Lean.IR.Borrow.OwnedSet.getHash _fun_discr = match _fun_discr with | (f, x) => mixHash (hash f) (hash x)
@[inline]
def
Lean.IR.Borrow.OwnedSet.insert
(s : Lean.IR.Borrow.OwnedSet)
(k : Lean.IR.Borrow.OwnedSet.Key)
:
Equations
def
Lean.IR.Borrow.OwnedSet.contains
(s : Lean.IR.Borrow.OwnedSet)
(k : Lean.IR.Borrow.OwnedSet.Key)
:
Equations
Equations
- Lean.IR.Borrow.ParamMap.instBEqKey = { beq := [anonymous] }
Equations
- Lean.IR.Borrow.ParamMap.getHash _fun_discr = match _fun_discr with | Lean.IR.Borrow.ParamMap.Key.decl n => hash n | Lean.IR.Borrow.ParamMap.Key.jp n id => mixHash (hash n) (hash id)
@[inline]
Equations
- One or more equations did not get rendered due to their size.
Equations
- Lean.IR.Borrow.instToFormatParamMap = { format := Lean.IR.Borrow.ParamMap.fmt }
Equations
- Lean.IR.Borrow.instToStringParamMap = { toString := fun m => Lean.Format.pretty (Lean.format m) }
Equations
- Lean.IR.Borrow.InitParamMap.initBorrow ps = Array.map (fun p => { x := p.x, borrow := Lean.IR.IRType.isObj p.ty, ty := p.ty }) ps
def
Lean.IR.Borrow.InitParamMap.initBorrowIfNotExported
(exported : Bool)
(ps : Array Lean.IR.Param)
:
Equations
- Lean.IR.Borrow.InitParamMap.initBorrowIfNotExported exported ps = if exported = true then ps else Lean.IR.Borrow.InitParamMap.initBorrow ps
Equations
- One or more equations did not get rendered due to their size.
Equations
- Lean.IR.Borrow.mkInitParamMap env decls = StateT.run' (SeqRight.seqRight (Lean.IR.Borrow.InitParamMap.visitDecls env decls) fun x => get) ∅
partial def
Lean.IR.Borrow.ApplyParamMap.visitFnBody
(fn : Lean.IR.FunId)
(paramMap : Lean.IR.Borrow.ParamMap)
:
def
Lean.IR.Borrow.ApplyParamMap.visitDecls
(decls : Array Lean.IR.Decl)
(paramMap : Lean.IR.Borrow.ParamMap)
:
Equations
- One or more equations did not get rendered due to their size.
Equations
- Lean.IR.Borrow.applyParamMap decls map = Lean.IR.Borrow.ApplyParamMap.visitDecls decls map
- env : Lean.Environment
- decls : Array Lean.IR.Decl
- currFn : Lean.IR.FunId
- paramSet : Lean.IR.IndexSet
- owned : Lean.IR.Borrow.OwnedSet
- modified : Bool
- paramMap : Lean.IR.Borrow.ParamMap
@[inline]
Equations
- Lean.IR.Borrow.getCurrFn = do let ctx ← read pure ctx.currFn
Equations
- Lean.IR.Borrow.markModified = modify fun s => { owned := s.owned, modified := true, paramMap := s.paramMap }
Equations
- One or more equations did not get rendered due to their size.
Equations
- Lean.IR.Borrow.ownArg x = match x with | Lean.IR.Arg.var x => Lean.IR.Borrow.ownVar x | x => pure ()
Equations
- Lean.IR.Borrow.ownArgs xs = Array.forM Lean.IR.Borrow.ownArg xs 0 (Array.size xs)
Equations
- Lean.IR.Borrow.isOwned x = do let currFn ← Lean.IR.Borrow.getCurrFn let s ← get pure (Lean.IR.Borrow.OwnedSet.contains s.owned (currFn, x.idx))
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
@[inline]
Equations
- Lean.IR.Borrow.collectDecls = do let a ← read Lean.IR.Borrow.whileModifing (Array.forM Lean.IR.Borrow.collectDecl a.decls 0 (Array.size a.decls)) let s ← get pure s.paramMap
Equations
- One or more equations did not get rendered due to their size.
Equations
- Lean.IR.inferBorrow decls = do let env ← Lean.IR.getEnv let paramMap : Lean.IR.Borrow.ParamMap := Lean.IR.Borrow.infer env decls pure (Lean.IR.Borrow.applyParamMap decls paramMap)