@[inline, reducible]
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 0
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Return true if variable, parameter and join point ids are unique
Equations
Instances For
@[inline, reducible]
Instances For
Equations
- Lean.IR.NormalizeIds.normIndex x m = match Lean.RBMap.find? m x with | some y => y | none => x
Instances For
Equations
Instances For
Equations
- Lean.IR.NormalizeIds.normArg x = match x with | Lean.IR.Arg.var x => Lean.IR.Arg.var <$> Lean.IR.NormalizeIds.normVar x | other => pure other
Instances For
Equations
- Lean.IR.NormalizeIds.normArgs as m = Array.map (fun (a : Lean.IR.Arg) => Lean.IR.NormalizeIds.normArg a m) as
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[inline, reducible]
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 α)
:
Equations
- Lean.IR.NormalizeIds.withJP 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.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
- Lean.IR.NormalizeIds.instMonadLiftMN = { monadLift := fun {α : Type} (x : Lean.IR.NormalizeIds.M α) (m : Lean.IR.IndexRenaming) => pure (x m) }
Equations
- One or more equations did not get rendered due to their size.
Instances For
Apply a function f : VarId → VarId
to variable occurrences.
The following functions assume the IR code does not have variable shadowing.
@[inline]
Equations
- Lean.IR.MapVars.mapArg f x = match x with | Lean.IR.Arg.var x => Lean.IR.Arg.var (f x) | a => a
Instances For
Equations
- Lean.IR.MapVars.mapArgs f as = Array.map (Lean.IR.MapVars.mapArg f) as
Instances For
Equations
- One or more equations did not get rendered due to their size.
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