Type inference for LCNF #
@[reducible, inline]
We use a regular local context to store temporary local declarations created during type inference.
Equations
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
- One or more equations did not get rendered due to their size.
Instances For
def Lean.Compiler.LCNF.InferType.Pure.mkForallParams (params : Array (Param Purity.pure)) (type : Expr) :
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[inline]
def Lean.Compiler.LCNF.InferType.Pure.withLocalDecl {α : Type} (binderName : Name) (type : Expr) (binderInfo : BinderInfo) (k : Expr → InferTypeM α) :
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Lean.Compiler.LCNF.InferType.Pure.inferLitValueType (Lean.Compiler.LCNF.LitValue.nat val) = Lean.mkConst `Nat
- Lean.Compiler.LCNF.InferType.Pure.inferLitValueType (Lean.Compiler.LCNF.LitValue.str val) = Lean.mkConst `String
- Lean.Compiler.LCNF.InferType.Pure.inferLitValueType (Lean.Compiler.LCNF.LitValue.uint8 val) = Lean.mkConst `UInt8
- Lean.Compiler.LCNF.InferType.Pure.inferLitValueType (Lean.Compiler.LCNF.LitValue.uint16 val) = Lean.mkConst `UInt16
- Lean.Compiler.LCNF.InferType.Pure.inferLitValueType (Lean.Compiler.LCNF.LitValue.uint32 val) = Lean.mkConst `UInt32
- Lean.Compiler.LCNF.InferType.Pure.inferLitValueType (Lean.Compiler.LCNF.LitValue.uint64 val) = Lean.mkConst `UInt64
- Lean.Compiler.LCNF.InferType.Pure.inferLitValueType (Lean.Compiler.LCNF.LitValue.usize val) = Lean.mkConst `USize
Instances For
Equations
- Lean.Compiler.LCNF.InferType.Pure.inferArgType Lean.Compiler.LCNF.Arg.erased = pure Lean.Compiler.LCNF.erasedExpr
- Lean.Compiler.LCNF.InferType.Pure.inferArgType (Lean.Compiler.LCNF.Arg.type e ⋯) = Lean.Compiler.LCNF.InferType.Pure.inferType e
- Lean.Compiler.LCNF.InferType.Pure.inferArgType (Lean.Compiler.LCNF.Arg.fvar fvarId) = liftM (Lean.Compiler.LCNF.getType fvarId)
Instances For
Equations
- One or more equations did not get rendered due to their size.
- Lean.Compiler.LCNF.InferType.Pure.inferLetValueType Lean.Compiler.LCNF.LetValue.erased = pure Lean.Compiler.LCNF.erasedExpr
- Lean.Compiler.LCNF.InferType.Pure.inferLetValueType (Lean.Compiler.LCNF.LetValue.lit v) = pure (Lean.Compiler.LCNF.InferType.Pure.inferLitValueType v)
- Lean.Compiler.LCNF.InferType.Pure.inferLetValueType (Lean.Compiler.LCNF.LetValue.proj structName idx fvarId ⋯) = Lean.Compiler.LCNF.InferType.Pure.inferProjType structName idx fvarId
Instances For
def Lean.Compiler.LCNF.InferType.Pure.inferAppTypeCore (fType : Expr) (args : Array (Arg Purity.pure)) :
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
- Lean.Compiler.LCNF.inferAppType fnType args_2 = ReaderT.run (Lean.Compiler.LCNF.InferType.Pure.inferAppTypeCore fnType args_2) { }
- Lean.Compiler.LCNF.inferAppType fnType args_2 = panicWithPosWithDecl "Lean.Compiler.LCNF.InferType" "Lean.Compiler.LCNF.inferAppType" 258 15 "Infer type for impure unimplemented"
Instances For
Equations
- arg_2.inferType = ReaderT.run (Lean.Compiler.LCNF.InferType.Pure.inferArgType arg_2) { }
- arg_2.inferType = panicWithPosWithDecl "Lean.Compiler.LCNF.InferType" "Lean.Compiler.LCNF.Arg.inferType" 263 15 "Infer type for impure unimplemented"
Instances For
Equations
- e_2.inferType = ReaderT.run (Lean.Compiler.LCNF.InferType.Pure.inferLetValueType e_2) { }
- e_2.inferType = panicWithPosWithDecl "Lean.Compiler.LCNF.InferType" "Lean.Compiler.LCNF.LetValue.inferType" 268 15 "Infer type for impure unimplemented"
Instances For
@[irreducible]
Equations
- (Lean.Compiler.LCNF.Code.let decl k).inferType = k.inferType
- (Lean.Compiler.LCNF.Code.fun decl k h).inferType = k.inferType
- (Lean.Compiler.LCNF.Code.jp decl k).inferType = k.inferType
- (Lean.Compiler.LCNF.Code.return fvarId).inferType = Lean.Compiler.LCNF.getType fvarId
- (Lean.Compiler.LCNF.Code.jmp fvarId args).inferType = do let __do_lift ← Lean.Compiler.LCNF.getType fvarId ReaderT.run (Lean.Compiler.LCNF.InferType.Pure.inferAppTypeCore __do_lift args) { }
- (Lean.Compiler.LCNF.Code.unreach type).inferType = pure type
- (Lean.Compiler.LCNF.Code.cases c).inferType = pure c.resultType
- code_2.inferType = panicWithPosWithDecl "Lean.Compiler.LCNF.InferType" "Lean.Compiler.LCNF.Code.inferType" 279 15 "Infer type for impure unimplemented"
Instances For
Equations
- Lean.Compiler.LCNF.mkForallParams params_2 type = ReaderT.run (Lean.Compiler.LCNF.InferType.Pure.mkForallParams params_2 type) { }
- Lean.Compiler.LCNF.mkForallParams params_2 type = panicWithPosWithDecl "Lean.Compiler.LCNF.InferType" "Lean.Compiler.LCNF.mkForallParams" 295 15 "Infer type for impure unimplemented"
Instances For
def Lean.Compiler.LCNF.mkAuxFunDecl (params : Array (Param Purity.pure)) (code : Code Purity.pure) (prefixName : Name := `_f) :
Equations
- Lean.Compiler.LCNF.mkAuxFunDecl params code prefixName = Lean.Compiler.LCNF.mkAuxFunDeclAux✝ params code prefixName
Instances For
def Lean.Compiler.LCNF.mkAuxJpDecl {pu : Purity} (params : Array (Param pu)) (code : Code pu) (prefixName : Name := `_jp) :
Equations
- Lean.Compiler.LCNF.mkAuxJpDecl params code prefixName = Lean.Compiler.LCNF.mkAuxFunDeclAux✝ params code prefixName
Instances For
def Lean.Compiler.LCNF.mkAuxJpDecl' {pu : Purity} (param : Param pu) (code : Code pu) (prefixName : Name := `_jp) :
Equations
- Lean.Compiler.LCNF.mkAuxJpDecl' param code prefixName = Lean.Compiler.LCNF.mkAuxFunDeclAux✝ #[param] code prefixName
Instances For
Return true if type should be erased. See item 1 in the note above where x ◾ ◾ is
a proposition and should be erased when the universe level parameter is set to 0.
Remark: predVars is a bitmask that indicates whether de-bruijn variables are predicates or not.
That is, #i is a predicate if predVars[predVars.size - i - 1] = true
Equations
- Lean.Compiler.LCNF.isErasedCompatible type predVars = Lean.Compiler.LCNF.isErasedCompatible.go✝ type predVars