@[reducible, inline]
Equations
Instances For
Equations
- Lean.IR.UniqueIds.checkId id = modifyGet fun (s : Lean.IR.IndexSet) => if Lean.RBTree.contains s id = true then (false, s) else (true, Lean.RBTree.insert s id)
Instances For
Equations
- Lean.IR.UniqueIds.checkParams ps = Array.allM (fun (p : Lean.IR.Param) => Lean.IR.UniqueIds.checkId p.x.idx) ps
Instances For
Return true if variable, parameter and join point ids are unique
Equations
- d.uniqueIds = StateT.run' (Lean.IR.UniqueIds.checkDecl d) ∅
Instances For
@[reducible, inline]
Instances For
Instances For
Instances For
Equations
Instances For
Instances For
Instances For
@[reducible, inline]
Equations
Instances For
@[inline]
def
Lean.IR.NormalizeIds.withVar
{α : Type}
(x : Lean.IR.VarId)
(k : Lean.IR.VarId → Lean.IR.NormalizeIds.N α)
:
Equations
- Lean.IR.NormalizeIds.withVar x k m = do let n ← getModify fun (n : Nat) => n + 1 k { idx := n } (Lean.RBMap.insert m x.idx n)
Instances For
@[inline]
def
Lean.IR.NormalizeIds.withJP
{α : Type}
(x : Lean.IR.JoinPointId)
(k : Lean.IR.JoinPointId → Lean.IR.NormalizeIds.N α)
:
Instances For
@[inline]
def
Lean.IR.NormalizeIds.withParams
{α : Type}
(ps : Array Lean.IR.Param)
(k : Array Lean.IR.Param → Lean.IR.NormalizeIds.N α)
:
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
- Lean.IR.NormalizeIds.normDecl d = pure d
Instances For
Create a declaration equivalent to d
s.t. d.normalizeIds.uniqueIds == true
Instances For
Apply a function f : VarId → VarId
to variable occurrences.
The following functions assume the IR code does not have variable shadowing.
@[inline]
Instances For
Instances For
Equations
- Lean.IR.MapVars.mapExpr f (Lean.IR.Expr.ctor c ys) = Lean.IR.Expr.ctor c (Lean.IR.MapVars.mapArgs f ys)
- Lean.IR.MapVars.mapExpr f (Lean.IR.Expr.reset n x_1) = Lean.IR.Expr.reset n (f x_1)
- Lean.IR.MapVars.mapExpr f (Lean.IR.Expr.reuse x_1 c u ys) = Lean.IR.Expr.reuse (f x_1) c u (Lean.IR.MapVars.mapArgs f ys)
- Lean.IR.MapVars.mapExpr f (Lean.IR.Expr.proj i x_1) = Lean.IR.Expr.proj i (f x_1)
- Lean.IR.MapVars.mapExpr f (Lean.IR.Expr.uproj i x_1) = Lean.IR.Expr.uproj i (f x_1)
- Lean.IR.MapVars.mapExpr f (Lean.IR.Expr.sproj n o x_1) = Lean.IR.Expr.sproj n o (f x_1)
- Lean.IR.MapVars.mapExpr f (Lean.IR.Expr.fap c ys) = Lean.IR.Expr.fap c (Lean.IR.MapVars.mapArgs f ys)
- Lean.IR.MapVars.mapExpr f (Lean.IR.Expr.pap c ys) = Lean.IR.Expr.pap c (Lean.IR.MapVars.mapArgs f ys)
- Lean.IR.MapVars.mapExpr f (Lean.IR.Expr.ap x_1 ys) = Lean.IR.Expr.ap (f x_1) (Lean.IR.MapVars.mapArgs f ys)
- Lean.IR.MapVars.mapExpr f (Lean.IR.Expr.box t x_1) = Lean.IR.Expr.box t (f x_1)
- Lean.IR.MapVars.mapExpr f (Lean.IR.Expr.unbox x_1) = Lean.IR.Expr.unbox (f x_1)
- Lean.IR.MapVars.mapExpr f (Lean.IR.Expr.isShared x_1) = Lean.IR.Expr.isShared (f x_1)
- Lean.IR.MapVars.mapExpr f (Lean.IR.Expr.lit v) = Lean.IR.Expr.lit v
Instances For
@[inline]
Equations
Instances For
Replace x
with y
in b
. This function assumes b
does not shadow x
Equations
- Lean.IR.FnBody.replaceVar x y b = Lean.IR.FnBody.mapVars (fun (z : Lean.IR.VarId) => if (x == z) = true then y else z) b