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
- One or more equations did not get rendered due to their size.
Equations
- Lean.IR.IRType.isObj _fun_discr = match _fun_discr with | Lean.IR.IRType.object => true | Lean.IR.IRType.tobject => true | x => false
Equations
- Lean.IR.IRType.isIrrelevant _fun_discr = match _fun_discr with | Lean.IR.IRType.irrelevant => true | x => false
Equations
- Lean.IR.IRType.isStruct _fun_discr = match _fun_discr with | Lean.IR.IRType.struct leanTypeName types => true | x => false
Equations
- Lean.IR.IRType.isUnion _fun_discr = match _fun_discr with | Lean.IR.IRType.union leanTypeName types => true | x => false
Equations
- Lean.IR.instInhabitedArg = { default := Lean.IR.Arg.var default }
Equations
- One or more equations did not get rendered due to their size.
Equations
- Lean.IR.instBEqArg = { beq := Lean.IR.Arg.beq }
@[export lean_ir_mk_var_arg]
Equations
- Lean.IR.mkVarArg id = Lean.IR.Arg.var id
Equations
- One or more equations did not get rendered due to their size.
Equations
- Lean.IR.instBEqLitVal = { beq := Lean.IR.LitVal.beq }
Equations
- Lean.IR.instReprCtorInfo = { reprPrec := [anonymous] }
Equations
- One or more equations did not get rendered due to their size.
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
@[export lean_ir_mk_ctor_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
@[export lean_ir_mk_proj_expr]
Equations
- Lean.IR.mkProjExpr i x = Lean.IR.Expr.proj i x
@[export lean_ir_mk_uproj_expr]
Equations
- Lean.IR.mkUProjExpr i x = Lean.IR.Expr.uproj i x
@[export lean_ir_mk_sproj_expr]
Equations
- Lean.IR.mkSProjExpr n offset x = Lean.IR.Expr.sproj n offset x
@[export lean_ir_mk_fapp_expr]
Equations
- Lean.IR.mkFAppExpr c ys = Lean.IR.Expr.fap c ys
@[export lean_ir_mk_papp_expr]
Equations
- Lean.IR.mkPAppExpr c ys = Lean.IR.Expr.pap c ys
@[export lean_ir_mk_app_expr]
Equations
- Lean.IR.mkAppExpr x ys = Lean.IR.Expr.ap x ys
@[export lean_ir_mk_num_expr]
Equations
@[export lean_ir_mk_str_expr]
Equations
Equations
- Lean.IR.instInhabitedParam = { default := { x := default, borrow := default, ty := default } }
@[export lean_ir_mk_param]
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]
@[export lean_ir_mk_vdecl]
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
@[export lean_ir_mk_jdecl]
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
@[export lean_ir_mk_uset]
Equations
- Lean.IR.mkUSet x i y b = Lean.IR.FnBody.uset x i y b
@[export lean_ir_mk_sset]
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
@[export lean_ir_mk_case]
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
@[export lean_ir_mk_ret]
Equations
@[export lean_ir_mk_jmp]
Equations
- Lean.IR.mkJmp j ys = Lean.IR.FnBody.jmp j ys
@[export lean_ir_mk_unreachable]
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
- 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]
@[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 _fun_discr = match _fun_discr with | Lean.IR.AltCore.ctor info b => b | Lean.IR.AltCore.default b => b
Equations
- One or more equations did not get rendered due to their size.
@[inline]
Equations
- Lean.IR.AltCore.modifyBody f _fun_discr = match _fun_discr 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 _fun_discr = match _fun_discr 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 _fun_discr = match _fun_discr with | Lean.IR.AltCore.ctor info b => false | Lean.IR.AltCore.default b => 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
- One or more equations did not get rendered due to their size.
@[export lean_ir_mk_alt]
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
If
some
, then declaration depends on
which uses asorry
axiom.
Extra information associated with a declaration.
- 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 _fun_discr = match _fun_discr with | Lean.IR.Decl.fdecl f xs type body info => f | Lean.IR.Decl.extern f xs type ext => f
Equations
- Lean.IR.Decl.params _fun_discr = match _fun_discr with | Lean.IR.Decl.fdecl f xs type body info => xs | Lean.IR.Decl.extern f xs type ext => xs
Equations
- Lean.IR.Decl.resultType _fun_discr = match _fun_discr with | Lean.IR.Decl.fdecl f xs t body info => t | Lean.IR.Decl.extern f xs t ext => t
Equations
- Lean.IR.Decl.isExtern _fun_discr = match _fun_discr with | Lean.IR.Decl.extern f xs type ext => true | x => false
Equations
- Lean.IR.Decl.getInfo _fun_discr = match _fun_discr with | Lean.IR.Decl.fdecl f xs type body info => info | x => { sorryDep? := none }
Equations
- One or more equations did not get rendered due to their size.
@[export lean_ir_mk_decl]
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 }
@[export lean_ir_mk_extern_decl]
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
@[export lean_ir_mk_dummy_extern_decl]
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]
Set of variable and join point names
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 a a_1) => true | x => false
Equations
- Lean.IR.LocalContext.getJPBody ctx j = match Std.RBMap.find? ctx j.idx with | some (Lean.IR.LocalContextEntry.joinPoint a b) => some b | x => none
Equations
- Lean.IR.LocalContext.getJPParams ctx j = match Std.RBMap.find? ctx j.idx with | some (Lean.IR.LocalContextEntry.joinPoint ys a) => some ys | x => none
Equations
- Lean.IR.LocalContext.isParam ctx idx = match Std.RBMap.find? ctx idx with | some (Lean.IR.LocalContextEntry.param a) => true | x => false
Equations
- Lean.IR.LocalContext.isLocalVar ctx idx = match Std.RBMap.find? ctx idx with | some (Lean.IR.LocalContextEntry.localVar a a_1) => true | x => 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
- One or more equations did not get rendered due to their size.
Equations
- Lean.IR.LocalContext.getValue ctx x = match Std.RBMap.find? ctx x.idx with | some (Lean.IR.LocalContextEntry.localVar a v) => some v | x => 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
- One or more equations did not get rendered due to their size.
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
- One or more equations did not get rendered due to their size.
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
- One or more equations did not get rendered due to their size.
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
- One or more equations did not get rendered due to their size.