Equations
- Lean.IR.instInhabitedVarId = { default := { idx := default } }
Equations
- Lean.IR.instInhabitedJoinPointId = { default := { idx := default } }
@[inline]
Equations
- Lean.IR.Index.lt a b = decide (a < b)
Equations
- Lean.IR.instBEqVarId = { beq := fun a b => a.idx == b.idx }
Equations
- Lean.IR.instToStringVarId = { toString := fun a => "x_" ++ toString a.idx }
Equations
- Lean.IR.instToFormatVarId = { format := fun a => Std.Format.text (toString a) }
Equations
- Lean.IR.instHashableVarId = { hash := fun a => hash a.idx }
Equations
- Lean.IR.instBEqJoinPointId = { beq := fun a b => a.idx == b.idx }
Equations
- Lean.IR.instToStringJoinPointId = { toString := fun a => "block_" ++ toString a.idx }
Equations
- Lean.IR.instToFormatJoinPointId = { format := fun a => Std.Format.text (toString a) }
Equations
- Lean.IR.instHashableJoinPointId = { hash := fun a => hash a.idx }
@[inline]
Equations
- Lean.IR.MData.empty = { entries := [] }
- float: Lean.IR.IRType
- uint8: Lean.IR.IRType
- uint16: Lean.IR.IRType
- uint32: Lean.IR.IRType
- uint64: Lean.IR.IRType
- usize: Lean.IR.IRType
- irrelevant: Lean.IR.IRType
- object: Lean.IR.IRType
- tobject: Lean.IR.IRType
- struct: Option Lean.Name → Array Lean.IR.IRType → Lean.IR.IRType
- union: Lean.Name → Array Lean.IR.IRType → Lean.IR.IRType
Equations
- Lean.IR.instInhabitedIRType = { default := Lean.IR.IRType.float }
Equations
- Lean.IR.IRType.instBEqIRType = { beq := Lean.IR.IRType.beq }
Equations
- Lean.IR.IRType.isObj x = match x with | Lean.IR.IRType.object => true | Lean.IR.IRType.tobject => true | x => false
Equations
- Lean.IR.IRType.isIrrelevant x = match x with | Lean.IR.IRType.irrelevant => true | x => false
Equations
- Lean.IR.IRType.isStruct x = match x with | Lean.IR.IRType.struct x x_1 => true | x => false
Equations
- Lean.IR.IRType.isUnion x = match x with | Lean.IR.IRType.union x x_1 => true | x => false
Equations
- Lean.IR.instInhabitedArg = { default := Lean.IR.Arg.var default }
Equations
- Lean.IR.Arg.beq x x = match x, x with | Lean.IR.Arg.var x, Lean.IR.Arg.var y => x == y | Lean.IR.Arg.irrelevant, Lean.IR.Arg.irrelevant => true | x, x_1 => false
Equations
- Lean.IR.instBEqArg = { beq := Lean.IR.Arg.beq }
Equations
- Lean.IR.mkVarArg id = Lean.IR.Arg.var id
Equations
- Lean.IR.LitVal.beq x x = match x, x with | Lean.IR.LitVal.num v₁, Lean.IR.LitVal.num v₂ => v₁ == v₂ | Lean.IR.LitVal.str v₁, Lean.IR.LitVal.str v₂ => v₁ == v₂ | x, x_1 => false
Equations
- Lean.IR.instBEqLitVal = { beq := Lean.IR.LitVal.beq }
Equations
- Lean.IR.instReprCtorInfo = { reprPrec := [anonymous] }
Equations
Equations
- Lean.IR.instBEqCtorInfo = { beq := Lean.IR.CtorInfo.beq }
Equations
- ctor: Lean.IR.CtorInfo → Array Lean.IR.Arg → Lean.IR.Expr
- reset: Nat → Lean.IR.VarId → Lean.IR.Expr
- reuse: Lean.IR.VarId → Lean.IR.CtorInfo → Bool → Array Lean.IR.Arg → Lean.IR.Expr
- proj: Nat → Lean.IR.VarId → Lean.IR.Expr
- uproj: Nat → Lean.IR.VarId → Lean.IR.Expr
- sproj: Nat → Nat → Lean.IR.VarId → Lean.IR.Expr
- fap: Lean.IR.FunId → Array Lean.IR.Arg → Lean.IR.Expr
- pap: Lean.IR.FunId → Array Lean.IR.Arg → Lean.IR.Expr
- ap: Lean.IR.VarId → Array Lean.IR.Arg → Lean.IR.Expr
- box: Lean.IR.IRType → Lean.IR.VarId → Lean.IR.Expr
- unbox: Lean.IR.VarId → Lean.IR.Expr
- lit: Lean.IR.LitVal → Lean.IR.Expr
- isTaggedPtr: Lean.IR.VarId → Lean.IR.Expr
def
Lean.IR.mkCtorExpr
(n : Lean.Name)
(cidx : Nat)
(size : Nat)
(usize : Nat)
(ssize : Nat)
(ys : Array Lean.IR.Arg)
:
Equations
- Lean.IR.mkCtorExpr n cidx size usize ssize ys = Lean.IR.Expr.ctor { name := n, cidx := cidx, size := size, usize := usize, ssize := ssize } ys
Equations
- Lean.IR.mkProjExpr i x = Lean.IR.Expr.proj i x
Equations
- Lean.IR.mkUProjExpr i x = Lean.IR.Expr.uproj i x
Equations
- Lean.IR.mkSProjExpr n offset x = Lean.IR.Expr.sproj n offset x
Equations
- Lean.IR.mkFAppExpr c ys = Lean.IR.Expr.fap c ys
Equations
- Lean.IR.mkPAppExpr c ys = Lean.IR.Expr.pap c ys
Equations
- Lean.IR.mkAppExpr x ys = Lean.IR.Expr.ap x ys
Equations
Equations
Equations
- Lean.IR.instInhabitedParam = { default := { x := default, borrow := default, ty := default } }
Equations
- Lean.IR.mkParam x borrow ty = { x := x, borrow := borrow, ty := ty }
- ctor: {FnBody : Type} → Lean.IR.CtorInfo → FnBody → Lean.IR.AltCore FnBody
- default: {FnBody : Type} → FnBody → Lean.IR.AltCore FnBody
- vdecl: Lean.IR.VarId → Lean.IR.IRType → Lean.IR.Expr → Lean.IR.FnBody → Lean.IR.FnBody
- jdecl: Lean.IR.JoinPointId → Array Lean.IR.Param → Lean.IR.FnBody → Lean.IR.FnBody → Lean.IR.FnBody
- set: Lean.IR.VarId → Nat → Lean.IR.Arg → Lean.IR.FnBody → Lean.IR.FnBody
- setTag: Lean.IR.VarId → Nat → Lean.IR.FnBody → Lean.IR.FnBody
- uset: Lean.IR.VarId → Nat → Lean.IR.VarId → Lean.IR.FnBody → Lean.IR.FnBody
- sset: Lean.IR.VarId → Nat → Nat → Lean.IR.VarId → Lean.IR.IRType → Lean.IR.FnBody → Lean.IR.FnBody
- inc: Lean.IR.VarId → Nat → Bool → Bool → Lean.IR.FnBody → Lean.IR.FnBody
- dec: Lean.IR.VarId → Nat → Bool → Bool → Lean.IR.FnBody → Lean.IR.FnBody
- del: Lean.IR.VarId → Lean.IR.FnBody → Lean.IR.FnBody
- mdata: Lean.IR.MData → Lean.IR.FnBody → Lean.IR.FnBody
- case: Lean.Name → Lean.IR.VarId → Lean.IR.IRType → Array (Lean.IR.AltCore Lean.IR.FnBody) → Lean.IR.FnBody
- ret: Lean.IR.Arg → Lean.IR.FnBody
- jmp: Lean.IR.JoinPointId → Array Lean.IR.Arg → Lean.IR.FnBody
- unreachable: Lean.IR.FnBody
Equations
- Lean.IR.instInhabitedFnBody = { default := Lean.IR.FnBody.unreachable }
@[inline]
Equations
def
Lean.IR.mkVDecl
(x : Lean.IR.VarId)
(ty : Lean.IR.IRType)
(e : Lean.IR.Expr)
(b : Lean.IR.FnBody)
:
Equations
- Lean.IR.mkVDecl x ty e b = Lean.IR.FnBody.vdecl x ty e b
def
Lean.IR.mkJDecl
(j : Lean.IR.JoinPointId)
(xs : Array Lean.IR.Param)
(v : Lean.IR.FnBody)
(b : Lean.IR.FnBody)
:
Equations
- Lean.IR.mkJDecl j xs v b = Lean.IR.FnBody.jdecl j xs v b
Equations
- Lean.IR.mkUSet x i y b = Lean.IR.FnBody.uset x i y b
def
Lean.IR.mkSSet
(x : Lean.IR.VarId)
(i : Nat)
(offset : Nat)
(y : Lean.IR.VarId)
(ty : Lean.IR.IRType)
(b : Lean.IR.FnBody)
:
Equations
- Lean.IR.mkSSet x i offset y ty b = Lean.IR.FnBody.sset x i offset y ty b
def
Lean.IR.mkCase
(tid : Lean.Name)
(x : Lean.IR.VarId)
(cs : Array (Lean.IR.AltCore Lean.IR.FnBody))
:
Equations
- Lean.IR.mkCase tid x cs = Lean.IR.FnBody.case tid x Lean.IR.IRType.object cs
Equations
Equations
- Lean.IR.mkJmp j ys = Lean.IR.FnBody.jmp j ys
Equations
@[matchPattern, inline]
Equations
- Lean.IR.Alt.ctor = Lean.IR.AltCore.ctor
@[matchPattern, inline]
Equations
- Lean.IR.Alt.default = Lean.IR.AltCore.default
Equations
- Lean.IR.instInhabitedAlt = { default := Lean.IR.Alt.default default }
Equations
- Lean.IR.FnBody.isTerminal x = match x with | Lean.IR.FnBody.case x x_1 x_2 x_3 => true | Lean.IR.FnBody.ret x => true | Lean.IR.FnBody.jmp x x_1 => true | Lean.IR.FnBody.unreachable => true | x => false
Equations
- Lean.IR.FnBody.body x = match x with | Lean.IR.FnBody.vdecl x x_1 x_2 b => b | Lean.IR.FnBody.jdecl x x_1 x_2 b => b | Lean.IR.FnBody.set x x_1 x_2 b => b | Lean.IR.FnBody.uset x x_1 x_2 b => b | Lean.IR.FnBody.sset x x_1 x_2 x_3 x_4 b => b | Lean.IR.FnBody.setTag x x_1 b => b | Lean.IR.FnBody.inc x x_1 x_2 x_3 b => b | Lean.IR.FnBody.dec x x_1 x_2 x_3 b => b | Lean.IR.FnBody.del x b => b | Lean.IR.FnBody.mdata x b => b | other => other
Equations
- Lean.IR.FnBody.setBody x x = match x, x with | Lean.IR.FnBody.vdecl x t v x_1, b => Lean.IR.FnBody.vdecl x t v b | Lean.IR.FnBody.jdecl j xs v x, b => Lean.IR.FnBody.jdecl j xs v b | Lean.IR.FnBody.set x i y x_1, b => Lean.IR.FnBody.set x i y b | Lean.IR.FnBody.uset x i y x_1, b => Lean.IR.FnBody.uset x i y b | Lean.IR.FnBody.sset x i o y t x_1, b => Lean.IR.FnBody.sset x i o y t b | Lean.IR.FnBody.setTag x i x_1, b => Lean.IR.FnBody.setTag x i b | Lean.IR.FnBody.inc x n c p x_1, b => Lean.IR.FnBody.inc x n c p b | Lean.IR.FnBody.dec x n c p x_1, b => Lean.IR.FnBody.dec x n c p b | Lean.IR.FnBody.del x x_1, b => Lean.IR.FnBody.del x b | Lean.IR.FnBody.mdata d x, b => Lean.IR.FnBody.mdata d b | other, b => other
@[inline]
Equations
@[inline]
Equations
- Lean.IR.FnBody.split b = let b' := Lean.IR.FnBody.body b; let c := Lean.IR.FnBody.resetBody b; (c, b')
Equations
- Lean.IR.AltCore.body x = match x with | Lean.IR.AltCore.ctor x b => b | Lean.IR.AltCore.default b => b
Equations
- Lean.IR.AltCore.setBody x x = match x, x with | Lean.IR.AltCore.ctor c x, b => Lean.IR.Alt.ctor c b | Lean.IR.AltCore.default x, b => Lean.IR.Alt.default b
@[inline]
Equations
- Lean.IR.AltCore.modifyBody f x = match x with | Lean.IR.AltCore.ctor c b => Lean.IR.Alt.ctor c (f b) | Lean.IR.AltCore.default b => Lean.IR.Alt.default (f b)
@[inline]
def
Lean.IR.AltCore.mmodifyBody
{m : Type → Type}
[inst : Monad m]
(f : Lean.IR.FnBody → m Lean.IR.FnBody)
:
Equations
- Lean.IR.AltCore.mmodifyBody f x = match x with | Lean.IR.AltCore.ctor c b => Lean.IR.Alt.ctor c <$> f b | Lean.IR.AltCore.default b => Lean.IR.Alt.default <$> f b
Equations
- Lean.IR.Alt.isDefault x = match x with | Lean.IR.AltCore.ctor x x_1 => false | Lean.IR.AltCore.default x => true
Equations
- Lean.IR.push bs b = let b := Lean.IR.FnBody.resetBody b; Array.push bs b
Equations
Equations
- Lean.IR.reshape bs term = Lean.IR.reshapeAux bs (Array.size bs) term
@[inline]
Equations
- Lean.IR.modifyJPs bs f = Array.map (fun b => match b with | Lean.IR.FnBody.jdecl j xs v k => Lean.IR.FnBody.jdecl j xs (f v) k | other => other) bs
@[inline]
def
Lean.IR.mmodifyJPs
{m : Type → Type}
[inst : Monad m]
(bs : Array Lean.IR.FnBody)
(f : Lean.IR.FnBody → m Lean.IR.FnBody)
:
m (Array Lean.IR.FnBody)
Equations
- Lean.IR.mmodifyJPs bs f = Array.mapM (fun b => match b with | Lean.IR.FnBody.jdecl j xs v k => do let a ← f v pure (Lean.IR.FnBody.jdecl j xs a k) | other => pure other) bs
def
Lean.IR.mkAlt
(n : Lean.Name)
(cidx : Nat)
(size : Nat)
(usize : Nat)
(ssize : Nat)
(b : Lean.IR.FnBody)
:
Equations
- Lean.IR.mkAlt n cidx size usize ssize b = Lean.IR.Alt.ctor { name := n, cidx := cidx, size := size, usize := usize, ssize := ssize } b
- fdecl: Lean.IR.FunId → Array Lean.IR.Param → Lean.IR.IRType → Lean.IR.FnBody → Lean.IR.DeclInfo → Lean.IR.Decl
- extern: Lean.IR.FunId → Array Lean.IR.Param → Lean.IR.IRType → Lean.ExternAttrData → Lean.IR.Decl
Equations
- Lean.IR.instInhabitedDecl = { default := Lean.IR.Decl.extern default default default default }
Equations
- Lean.IR.Decl.name x = match x with | Lean.IR.Decl.fdecl f x x_1 x_2 x_3 => f | Lean.IR.Decl.extern f x x_1 x_2 => f
Equations
- Lean.IR.Decl.params x = match x with | Lean.IR.Decl.fdecl x xs x_1 x_2 x_3 => xs | Lean.IR.Decl.extern x xs x_1 x_2 => xs
Equations
- Lean.IR.Decl.resultType x = match x with | Lean.IR.Decl.fdecl x x_1 t x_2 x_3 => t | Lean.IR.Decl.extern x x_1 t x_2 => t
Equations
- Lean.IR.Decl.isExtern x = match x with | Lean.IR.Decl.extern x x_1 x_2 x_3 => true | x => false
Equations
- Lean.IR.Decl.getInfo x = match x with | Lean.IR.Decl.fdecl x x_1 x_2 x_3 info => info | x => { sorryDep? := none }
Equations
- Lean.IR.Decl.updateBody! d bNew = match d with | Lean.IR.Decl.fdecl f xs t b info => Lean.IR.Decl.fdecl f xs t bNew info | x => panicWithPosWithDecl "Lean.Compiler.IR.Basic" "Lean.IR.Decl.updateBody!" 431 9 "expected definition"
def
Lean.IR.mkDecl
(f : Lean.IR.FunId)
(xs : Array Lean.IR.Param)
(ty : Lean.IR.IRType)
(b : Lean.IR.FnBody)
:
Equations
- Lean.IR.mkDecl f xs ty b = Lean.IR.Decl.fdecl f xs ty b { sorryDep? := none }
def
Lean.IR.mkExternDecl
(f : Lean.IR.FunId)
(xs : Array Lean.IR.Param)
(ty : Lean.IR.IRType)
(e : Lean.ExternAttrData)
:
Equations
- Lean.IR.mkExternDecl f xs ty e = Lean.IR.Decl.extern f xs ty e
def
Lean.IR.mkDummyExternDecl
(f : Lean.IR.FunId)
(xs : Array Lean.IR.Param)
(ty : Lean.IR.IRType)
:
Equations
- Lean.IR.mkDummyExternDecl f xs ty = Lean.IR.Decl.fdecl f xs ty Lean.IR.FnBody.unreachable { sorryDep? := none }
@[inline]
Equations
- Lean.IR.IndexSet = Std.RBTree Lean.IR.Index compare
Equations
- Lean.IR.instInhabitedIndexSet = { default := ∅ }
Equations
- Lean.IR.mkIndexSet idx = Std.RBTree.insert Std.RBTree.empty idx
- param: Lean.IR.IRType → Lean.IR.LocalContextEntry
- localVar: Lean.IR.IRType → Lean.IR.Expr → Lean.IR.LocalContextEntry
- joinPoint: Array Lean.IR.Param → Lean.IR.FnBody → Lean.IR.LocalContextEntry
@[inline]
Equations
def
Lean.IR.LocalContext.addLocal
(ctx : Lean.IR.LocalContext)
(x : Lean.IR.VarId)
(t : Lean.IR.IRType)
(v : Lean.IR.Expr)
:
Equations
- Lean.IR.LocalContext.addLocal ctx x t v = Std.RBMap.insert ctx x.idx (Lean.IR.LocalContextEntry.localVar t v)
def
Lean.IR.LocalContext.addJP
(ctx : Lean.IR.LocalContext)
(j : Lean.IR.JoinPointId)
(xs : Array Lean.IR.Param)
(b : Lean.IR.FnBody)
:
Equations
- Lean.IR.LocalContext.addJP ctx j xs b = Std.RBMap.insert ctx j.idx (Lean.IR.LocalContextEntry.joinPoint xs b)
Equations
- Lean.IR.LocalContext.addParam ctx p = Std.RBMap.insert ctx p.x.idx (Lean.IR.LocalContextEntry.param p.ty)
Equations
- Lean.IR.LocalContext.addParams ctx ps = Array.foldl Lean.IR.LocalContext.addParam ctx ps 0 (Array.size ps)
Equations
- Lean.IR.LocalContext.isJP ctx idx = match Std.RBMap.find? ctx idx with | some (Lean.IR.LocalContextEntry.joinPoint x x_1) => true | other => false
Equations
- Lean.IR.LocalContext.getJPBody ctx j = match Std.RBMap.find? ctx j.idx with | some (Lean.IR.LocalContextEntry.joinPoint x b) => some b | other => none
Equations
- Lean.IR.LocalContext.getJPParams ctx j = match Std.RBMap.find? ctx j.idx with | some (Lean.IR.LocalContextEntry.joinPoint ys x) => some ys | other => none
Equations
- Lean.IR.LocalContext.isParam ctx idx = match Std.RBMap.find? ctx idx with | some (Lean.IR.LocalContextEntry.param x) => true | other => false
Equations
- Lean.IR.LocalContext.isLocalVar ctx idx = match Std.RBMap.find? ctx idx with | some (Lean.IR.LocalContextEntry.localVar x x_1) => true | other => false
Equations
- Lean.IR.LocalContext.contains ctx idx = Std.RBMap.contains ctx idx
def
Lean.IR.LocalContext.eraseJoinPointDecl
(ctx : Lean.IR.LocalContext)
(j : Lean.IR.JoinPointId)
:
Equations
- Lean.IR.LocalContext.eraseJoinPointDecl ctx j = Std.RBMap.erase ctx j.idx
Equations
- Lean.IR.LocalContext.getType ctx x = match Std.RBMap.find? ctx x.idx with | some (Lean.IR.LocalContextEntry.param t) => some t | some (Lean.IR.LocalContextEntry.localVar t x) => some t | other => none
Equations
- Lean.IR.LocalContext.getValue ctx x = match Std.RBMap.find? ctx x.idx with | some (Lean.IR.LocalContextEntry.localVar x v) => some v | other => none
@[inline]
Equations
- aeqv : Lean.IR.IndexRenaming → α → α → Bool
Equations
- Lean.IR.VarId.alphaEqv ρ v₁ v₂ = match Std.RBMap.find? ρ v₁.idx with | some v => v == v₂.idx | none => v₁ == v₂
Equations
- Lean.IR.instAlphaEqvVarId = { aeqv := Lean.IR.VarId.alphaEqv }
Equations
- Lean.IR.Arg.alphaEqv ρ x x = match x, x with | Lean.IR.Arg.var v₁, Lean.IR.Arg.var v₂ => Lean.IR.aeqv ρ v₁ v₂ | Lean.IR.Arg.irrelevant, Lean.IR.Arg.irrelevant => true | x, x_1 => false
Equations
- Lean.IR.instAlphaEqvArg = { aeqv := Lean.IR.Arg.alphaEqv }
def
Lean.IR.args.alphaEqv
(ρ : Lean.IR.IndexRenaming)
(args₁ : Array Lean.IR.Arg)
(args₂ : Array Lean.IR.Arg)
:
Equations
- Lean.IR.args.alphaEqv ρ args₁ args₂ = Array.isEqv args₁ args₂ fun a b => Lean.IR.aeqv ρ a b
Equations
- Lean.IR.instAlphaEqvArrayArg = { aeqv := Lean.IR.args.alphaEqv }
Equations
- Lean.IR.Expr.alphaEqv ρ x x = match x, x with | Lean.IR.Expr.ctor i₁ ys₁, Lean.IR.Expr.ctor i₂ ys₂ => i₁ == i₂ && Lean.IR.aeqv ρ ys₁ ys₂ | Lean.IR.Expr.reset n₁ x₁, Lean.IR.Expr.reset n₂ x₂ => n₁ == n₂ && Lean.IR.aeqv ρ x₁ x₂ | Lean.IR.Expr.reuse x₁ i₁ u₁ ys₁, Lean.IR.Expr.reuse x₂ i₂ u₂ ys₂ => Lean.IR.aeqv ρ x₁ x₂ && i₁ == i₂ && u₁ == u₂ && Lean.IR.aeqv ρ ys₁ ys₂ | Lean.IR.Expr.proj i₁ x₁, Lean.IR.Expr.proj i₂ x₂ => i₁ == i₂ && Lean.IR.aeqv ρ x₁ x₂ | Lean.IR.Expr.uproj i₁ x₁, Lean.IR.Expr.uproj i₂ x₂ => i₁ == i₂ && Lean.IR.aeqv ρ x₁ x₂ | Lean.IR.Expr.sproj n₁ o₁ x₁, Lean.IR.Expr.sproj n₂ o₂ x₂ => n₁ == n₂ && o₁ == o₂ && Lean.IR.aeqv ρ x₁ x₂ | Lean.IR.Expr.fap c₁ ys₁, Lean.IR.Expr.fap c₂ ys₂ => c₁ == c₂ && Lean.IR.aeqv ρ ys₁ ys₂ | Lean.IR.Expr.pap c₁ ys₁, Lean.IR.Expr.pap c₂ ys₂ => c₁ == c₂ && Lean.IR.aeqv ρ ys₁ ys₂ | Lean.IR.Expr.ap x₁ ys₁, Lean.IR.Expr.ap x₂ ys₂ => Lean.IR.aeqv ρ x₁ x₂ && Lean.IR.aeqv ρ ys₁ ys₂ | Lean.IR.Expr.box ty₁ x₁, Lean.IR.Expr.box ty₂ x₂ => ty₁ == ty₂ && Lean.IR.aeqv ρ x₁ x₂ | Lean.IR.Expr.unbox x₁, Lean.IR.Expr.unbox x₂ => Lean.IR.aeqv ρ x₁ x₂ | Lean.IR.Expr.lit v₁, Lean.IR.Expr.lit v₂ => v₁ == v₂ | Lean.IR.Expr.isShared x₁, Lean.IR.Expr.isShared x₂ => Lean.IR.aeqv ρ x₁ x₂ | Lean.IR.Expr.isTaggedPtr x₁, Lean.IR.Expr.isTaggedPtr x₂ => Lean.IR.aeqv ρ x₁ x₂ | x, x_1 => false
Equations
- Lean.IR.instAlphaEqvExpr = { aeqv := Lean.IR.Expr.alphaEqv }
Equations
- Lean.IR.addVarRename ρ x₁ x₂ = if (x₁ == x₂) = true then ρ else Std.RBMap.insert ρ x₁ x₂
Equations
- Lean.IR.addParamRename ρ p₁ p₂ = if (p₁.ty == p₂.ty && decide (p₁.borrow = p₂.borrow)) = true then some (Lean.IR.addVarRename ρ p₁.x.idx p₂.x.idx) else none
def
Lean.IR.addParamsRename
(ρ : Lean.IR.IndexRenaming)
(ps₁ : Array Lean.IR.Param)
(ps₂ : Array Lean.IR.Param)
:
Equations
- Lean.IR.addParamsRename ρ ps₁ ps₂ = OptionM.run (if (Array.size ps₁ != Array.size ps₂) = true then failure else let ρ := ρ; do let r ← let col := { start := 0, stop := Array.size ps₁, step := 1 }; forIn col ρ fun i r => let ρ := r; do let r ← Lean.IR.addParamRename ρ (Array.getOp ps₁ i) (Array.getOp ps₂ i) let ρ : Lean.IR.IndexRenaming := r pure PUnit.unit pure (ForInStep.yield ρ) let x : Lean.IR.IndexRenaming := r let ρ : Lean.IR.IndexRenaming := x pure ρ)
Equations
- Lean.IR.FnBody.beq b₁ b₂ = Lean.IR.FnBody.alphaEqv ∅ b₁ b₂
Equations
- Lean.IR.instBEqFnBody = { beq := Lean.IR.FnBody.beq }
@[inline]
Equations
- Lean.IR.VarIdSet = Std.RBTree Lean.IR.VarId fun x y => compare x.idx y.idx
Equations
- Lean.IR.instInhabitedVarIdSet = { default := ∅ }
Equations
- Lean.IR.mkIf x t e = Lean.IR.FnBody.case `Bool x Lean.IR.IRType.uint8 #[Lean.IR.Alt.ctor { name := `Bool.false, cidx := 0, size := 0, usize := 0, ssize := 0 } e, Lean.IR.Alt.ctor { name := `Bool.true, cidx := 1, size := 0, usize := 0, ssize := 0 } t]