@[inline]
@[inline]
Equations
- Lean.Compiler.mkUIntTypeName nbytes = Lean.Name.mkSimple ("UInt" ++ toString nbytes)
Equations
- One or more equations did not get rendered due to their size.
Equations
- Lean.Compiler.isOfNat fn = List.any Lean.Compiler.numScalarTypes fun info => info.ofNatFn == fn
Equations
- Lean.Compiler.isToNat fn = List.any Lean.Compiler.numScalarTypes fun info => info.toNatFn == fn
Equations
- Lean.Compiler.getInfoFromFn fn [] = none
- Lean.Compiler.getInfoFromFn fn (info :: infos) = if (info.ofNatFn == fn) = true then some info else Lean.Compiler.getInfoFromFn fn infos
Equations
- Lean.Compiler.getInfoFromVal _fun_discr = match _fun_discr with | Lean.Expr.app (Lean.Expr.const fn a a_1) a_2 a_3 => Lean.Compiler.getInfoFromFn fn Lean.Compiler.numScalarTypes | x => none
Equations
- Lean.Compiler.mkUIntLit info n = Lean.mkApp (Lean.mkConst info.ofNatFn) (Lean.mkRawNatLit (n % info.size))
Equations
- One or more equations did not get rendered due to their size.
Equations
- Lean.Compiler.foldUIntAdd = Lean.Compiler.foldBinUInt fun x x => Add.add
Equations
- Lean.Compiler.foldUIntMul = Lean.Compiler.foldBinUInt fun x x => Mul.mul
Equations
- Lean.Compiler.foldUIntDiv = Lean.Compiler.foldBinUInt fun x x => Div.div
Equations
- Lean.Compiler.foldUIntMod = Lean.Compiler.foldBinUInt fun x x => Mod.mod
Equations
- Lean.Compiler.foldUIntSub = Lean.Compiler.foldBinUInt fun info x a b => a + (info.size - b)
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
- Lean.Compiler.foldNatBinOp fn a₁ a₂ = do let n₁ ← Lean.Compiler.getNumLit a₁ let n₂ ← Lean.Compiler.getNumLit a₂ pure (Lean.mkRawNatLit (fn n₁ n₂))
Equations
Equations
Equations
Equations
Equations
- Lean.Compiler.mkNatEq a b = Lean.mkAppN (Lean.mkConst `Eq [Lean.levelOne]) #[Lean.mkConst `Nat, a, b]
Equations
- Lean.Compiler.mkNatLt a b = Lean.mkAppN (Lean.mkConst `LT.lt [Lean.levelZero]) #[Lean.mkConst `Nat, Lean.mkConst `Nat.lt, a, b]
Equations
- Lean.Compiler.mkNatLe a b = Lean.mkAppN (Lean.mkConst `LE.le [Lean.levelZero]) #[Lean.mkConst `Nat, Lean.mkConst `Nat.le, a, b]
Equations
- Lean.Compiler.foldNatDecEq = Lean.Compiler.foldNatBinPred Lean.Compiler.mkNatEq fun a b => decide (a = b)
Equations
- Lean.Compiler.foldNatDecLt = Lean.Compiler.foldNatBinPred Lean.Compiler.mkNatLt fun a b => decide (a < b)
Equations
- Lean.Compiler.foldNatDecLe = Lean.Compiler.foldNatBinPred Lean.Compiler.mkNatLe fun a b => decide (a ≤ b)
Equations
- Lean.Compiler.foldNatBeq x = Lean.Compiler.foldNatBinBoolPred fun a b => a == b
Equations
- Lean.Compiler.foldNatBle x = Lean.Compiler.foldNatBinBoolPred fun a b => decide (a < b)
Equations
- Lean.Compiler.foldNatBlt x = Lean.Compiler.foldNatBinBoolPred fun a b => decide (a ≤ b)
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
- Lean.Compiler.boolFoldFns = [(`strictOr, Lean.Compiler.foldStrictOr), (`strictAnd, Lean.Compiler.foldStrictAnd)]
Equations
- Lean.Compiler.foldNatSucc x a = do let n ← Lean.Compiler.getNumLit a pure (Lean.mkRawNatLit (n + 1))
Equations
- Lean.Compiler.foldToNat x a = do let n ← Lean.Compiler.getNumLit a pure (Lean.mkRawNatLit n)
Equations
- Lean.Compiler.uintFoldToNatFns = List.foldl (fun r info => (info.toNatFn, Lean.Compiler.foldToNat) :: r) [] Lean.Compiler.numScalarTypes
Equations
- Lean.Compiler.unFoldFns = [(`Nat.succ, Lean.Compiler.foldNatSucc), (`Char.ofNat, Lean.Compiler.foldCharOfNat)] ++ Lean.Compiler.uintFoldToNatFns
Equations
@[export lean_fold_bin_op]
def
Lean.Compiler.foldBinOp
(beforeErasure : Bool)
(f : Lean.Expr)
(a : Lean.Expr)
(b : Lean.Expr)
:
Equations
- Lean.Compiler.foldBinOp beforeErasure f a b = match f with | Lean.Expr.const fn a a_1 => do let foldFn ← Lean.Compiler.findBinFoldFn fn foldFn beforeErasure a b | x => failure
@[export lean_fold_un_op]
Equations
- Lean.Compiler.foldUnOp beforeErasure f a = match f with | Lean.Expr.const fn a a_1 => do let foldFn ← Lean.Compiler.findUnFoldFn fn foldFn beforeErasure a | x => failure