Constant folding for primitives that have special runtime support.
Equations
- Lean.Compiler.mkLcProof p = Lean.mkApp (Lean.mkConst `lcProof) p
Instances For
@[reducible, inline]
Instances For
@[reducible, inline]
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Lean.Compiler.isOfNat fn = Lean.Compiler.numScalarTypes.any fun (info : Lean.Compiler.NumScalarTypeInfo) => info.ofNatFn == fn
Instances For
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
Instances For
Equations
- Lean.Compiler.getInfoFromVal ((Lean.Expr.const fn us).app arg) = Lean.Compiler.getInfoFromFn fn Lean.Compiler.numScalarTypes
- Lean.Compiler.getInfoFromVal x = none
Instances For
Instances For
Equations
- Lean.Compiler.foldUIntMul = Lean.Compiler.foldBinUInt fun (x : Lean.Compiler.NumScalarTypeInfo) (x : Bool) => Mul.mul
Instances For
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.
Instances For
Equations
Instances For
Equations
Instances For
Equations
- Lean.Compiler.mkNatEq a b = Lean.mkAppN (Lean.mkConst `Eq [Lean.levelOne]) #[Lean.mkConst `Nat, a, b]
Instances For
Equations
- Lean.Compiler.toDecidableExpr false pred true = Lean.mkConst `Bool.true
- Lean.Compiler.toDecidableExpr false pred false = Lean.mkConst `Bool.false
- Lean.Compiler.toDecidableExpr true pred true = Lean.mkDecIsTrue pred (Lean.Compiler.mkLcProof pred)
- Lean.Compiler.toDecidableExpr true pred false = Lean.mkDecIsFalse pred (Lean.Compiler.mkLcProof pred)
Instances For
Equations
- Lean.Compiler.foldNatDecLe = Lean.Compiler.foldNatBinPred Lean.Compiler.mkNatLe fun (a b : Nat) => decide (a ≤ b)
Instances For
Equations
- Lean.Compiler.foldNatBeq x = Lean.Compiler.foldNatBinBoolPred fun (a b : Nat) => a == b
Instances For
Equations
- Lean.Compiler.foldNatBle x = Lean.Compiler.foldNatBinBoolPred fun (a b : Nat) => decide (a ≤ b)
Instances For
Equations
- Lean.Compiler.getBoolLit (Lean.Expr.const `Bool.true us) = some true
- Lean.Compiler.getBoolLit (Lean.Expr.const `Bool.false us) = some false
- Lean.Compiler.getBoolLit x = none
Instances For
Equations
- Lean.Compiler.foldNatSucc x a = do let n ← Lean.Compiler.getNumLit a pure (Lean.mkRawNatLit (n + 1))
Instances For
Equations
- Lean.Compiler.unFoldFns = [(`Nat.succ, Lean.Compiler.foldNatSucc), (`Char.ofNat, Lean.Compiler.foldCharOfNat)] ++ Lean.Compiler.uintFoldToNatFns
Instances For
Equations
Instances For
Equations
Instances For
@[export lean_fold_bin_op]
Equations
- Lean.Compiler.foldBinOp beforeErasure (Lean.Expr.const fn us) a b = do let foldFn ← Lean.Compiler.findBinFoldFn fn foldFn beforeErasure a b
- Lean.Compiler.foldBinOp beforeErasure f a b = failure