Term
Syntax of the kernel's term language. All 48 constructors produce
attrsets with a tag field (not _tag, to distinguish kernel terms
from effect system nodes). Binding is de Bruijn indexed: mkVar i
refers to the i-th enclosing binder (0 = innermost).
Name annotations (name parameter on mkPi, mkLam, mkSigma,
mkLet) are cosmetic — used only in error messages, never in
equality checking.
Spec reference: kernel-spec.md §2.
Constructors
Variables and Binding
mkVar : Int → Tm— variable by de Bruijn indexmkLet : String → Tm → Tm → Tm → Tm—let name : type = val in bodymkAnn : Tm → Tm → Tm— type annotation(term : type)
Functions (§2.2)
mkPi : String → Tm → Tm → Tm— dependent function typeΠ(name : domain). codomainmkLam : String → Tm → Tm → Tm— lambdaλ(name : domain). bodymkApp : Tm → Tm → Tm— applicationfn arg
Pairs (§2.3)
mkSigma : String → Tm → Tm → Tm— dependent pair typeΣ(name : fst). sndmkPair : Tm → Tm → Tm— pair constructor(fst, snd)mkFst : Tm → Tm— first projectionmkSnd : Tm → Tm— second projection
Inductive Types
mkNat,mkZero,mkSucc,mkNatElim— natural numbers with eliminatormkList,mkNil,mkCons,mkListElim— lists with eliminatormkUnit,mkTt— unit type and valuemkSum,mkInl,mkInr,mkSumElim— disjoint sum with eliminatormkEq,mkRefl,mkJ— identity type with J eliminator
Universes
mkU : Int → Tm— universe at level i
Axiomatized Primitives (§2.1)
mkString,mkInt,mkFloat,mkAttrs,mkPath,mkFunction,mkAny— type formersmkStringLit,mkIntLit,mkFloatLit,mkAttrsLit,mkPathLit,mkFnLit,mkAnyLit— literal values