Term
On this page
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.
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
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
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
mkUnit,mkTt— unit type and valuemkBootSum,mkBootInl,mkBootInr,mkBootSumElim— bootstrap coproduct fordescPlusmkBootEq,mkBootRefl,mkBootJ— identity type with J eliminator
Universes
mkU : (Int | Tm) → Tm— universeU(level). Accepts either a concrete Int (wrapped viamkLevelLit) or a Level-typed Tm directly.mkLevelLit : Int → Tm— buildssuc^n zeroas a Level term.
Axiomatized Primitives
mkString,mkInt,mkFloat,mkAttrs,mkPath,mkDerivation,mkFunction,mkAny— type formersmkStringLit,mkIntLit,mkFloatLit,mkAttrsLit,mkPathLit,mkDerivationLit,mkFnLit,mkAnyLit— literal values
funextTypeTm
funextTypeTm: pre-elaborated kernel term for the funext axiom's type ∀(j,k,A,B,f,g). (∀a. Eq (B a) (f a) (g a)) -> Eq (Π a:A. B a) f g.
mkAbsurd
mkAbsurd: empty-type eliminator — absurd P x discharges a stuck x : Empty to produce a value of any type P; well-typed only when x is a neutral (Empty has no canonical inhabitants).
mkAbsurd : Tm -> Tm -> Tm -- type (P), term (x : Empty)mkAllD
mkAllD: induction-hypothesis collector All D X P i payload — given motive P : (i:I) -> X i -> U(k), threads P through every recursive child in the payload.
mkAllD : Tm -> Tm -> Tm -> Tm -> Tm -> Tm -> Tm -> Tm -- k, I, D, level, X, P, i, payloadmkAnn
mkAnn: type annotation (term : type) — fixes the checking direction at the kernel level; consumed by Sub and elaboration.
mkAnn : Tm -> Tm -> Tm -- term, typemkAnnTrusted
mkAnnTrusted: type annotation marked as elaborator-trusted — check skips re-validation of term against type since elaboration has already proved well-typedness.
mkAnnTrusted : Tm -> Tm -> Tm -- term, typemkAnnTrustedWithDescRef
mkAnnTrustedWithDescRef: trusted annotation carrying a _descRef sidecar — used by the HOAS elaborator to retain levitated description provenance across eval/quote round-trips.
mkAnnTrustedWithDescRef : Tm -> Tm -> Any -> Tm -- term, type, descRefmkAnnTrustedWithLabels
mkAnnTrustedWithLabels: trusted annotation carrying _label / _conLabel sidecars — used by H.withDescLabel / H.withConLabel to surface presentation labels on descView.
mkAnnTrustedWithLabels : Tm -> Tm -> { label?, conLabel? } -> TmmkAny
mkAny: axiomatised top primitive type Any — accepts every Nix value; used as the lossy-fallback kernel for approximate types.
mkAnyLit
mkAnyLit: kernel literal for an arbitrary Nix value v : Any — used by approximate types whose kernel slot is mkAny.
mkAnyLit : Any -> TmmkApp
mkApp: function application fn arg — head fn is checked first to infer Π type, then arg is checked against the domain.
mkApp : Tm -> Tm -> Tm -- fn, argmkAttrs
mkAttrs: axiomatised primitive type Attrs — type former at U(0) inhabited by any Nix attribute set, including {}.
mkAttrsLit
mkAttrsLit: kernel literal for a Nix attribute set a : Attrs; the attrs are carried opaquely (no per-field validation at the kernel level).
mkAttrsLit : Attrs -> TmmkBootEq
mkBootEq: bootstrap identity type Eq(A, a, b) — propositional equality used by descRet's level transport and by the J eliminator.
mkBootEq : Tm -> Tm -> Tm -> Tm -- A, a, bmkBootInl
mkBootInl: left-injection of mkBootSum — inl(a) : A + B; carries both A and B for elaboration shape recovery.
mkBootInl : Tm -> Tm -> Tm -> Tm -- leftTy, rightTy, valuemkBootInr
mkBootInr: right-injection of mkBootSum — inr(b) : A + B; carries both A and B for elaboration shape recovery.
mkBootInr : Tm -> Tm -> Tm -> Tm -- leftTy, rightTy, valuemkBootJ
mkBootJ: J eliminator on mkBootEq — transports a property motive along a proof of equality, yielding a term at the other endpoint.
mkBootJ : Tm -> Tm -> Tm -> Tm -> Tm -> Tm -> Tm -- A, a, motive, identity, b, eqmkBootRefl
mkBootRefl: bootstrap reflexivity refl : Eq(A, a, a) — the canonical inhabitant of every reflexive identity type; check-mode only at elaboration.
mkBootSum
mkBootSum: bootstrap coproduct type A + B — used by descPlus to encode sum-of-descriptions before generic sums become available.
mkBootSum : Tm -> Tm -> Tm -- left, rightmkBootSumElim
mkBootSumElim: bootstrap sum eliminator — case-splits a A + B scrutinee through onLeft/onRight arms at motive (_:A+B) -> Q _.
mkBootSumElim : Tm -> Tm -> Tm -> Tm -> Tm -> Tm -> Tm -- leftTy, rightTy, motive, onLeft, onRight, scrutmkCanonApp
mkCanonApp: generic identity-tagged application — canon-app id params body evaluates by currying-applying body to params and stamps the result VDescCon with _canonRef = { id; params; }; conv/quote short-circuit on the canonical identity instead of forcing .D.
mkCanonApp : String -> [Tm] -> Tm -> Tm -- id, params, bodymkDerivation
mkDerivation: axiomatised primitive type Derivation — type former at U(0) inhabited by Nix derivation values (attrsets with type = "derivation"); the irreducible Nix-store-producing value category.
mkDerivationLit
mkDerivationLit: kernel literal for a Nix derivation d : Derivation; the value is carried opaquely (kernel never inspects derivation attrs).
mkDerivationLit : Derivation -> TmmkDesc
mkDesc: level-zero description type Desc I k at index sort I : U(0) and universe level k — the levitated algebra of constructors for datatypes.
mkDesc : Tm -> Tm -> Tm -- k, ImkDescAt
mkDescAt: Desc^k I carrying an explicit iLev for the universe of I. The kernel synthesises the desc-formation level as U(suc (max k iLev)).
mkDescAt : Tm -> Tm -> Tm -> Tm -- iLev, k, ImkDescCon
mkDescCon: constructor introduction for μ I D i — takes a payload typed by interpD D (μ I D) i and returns the corresponding μ value.
mkDescCon : Tm -> Tm -> Tm -> Tm -- D, i, payloadmkDescConChain
mkDescConChain: flat-form linear-chain dual of an N-deep mkDescCon. layers is a flat outer-first Nix-list of { i; heads } records; base = { D; i; d } at the terminator. The consumer pass-graph (evalF, conv, extract, quote) walks the list iteratively, so libnix forceValueDeep depth is O(1) regardless of N. Bijective dual of the chain-form Val (_shape == "linearChain").
mkDescConChain : { layers : [{i:Tm; heads:[Tm]}]; base : {D:Tm; i:Tm; d:Tm}; outerD : Tm; payloadTag : String; payloadLeft : Tm; payloadRight : Tm; } -> TmmkDescConWithCert
mkDescConWithCert: mkDescCon carrying a Squash-truncated guard certificate — threads a refinement guard's decision proof through the kernel for description-backed Record/Variant constructors (descConCertified).
mkDescConWithCert : Tm -> Tm -> Tm -> Tm -> Tm -- D, i, payload, certmkDescDescApp
mkDescDescApp: level-zero applied form of descDesc — Desc^(suc L) ⊤ whose mu-fixpoint is Desc^L I for I : U(0); bootstraps generic programming over descriptions themselves.
mkDescDescApp : Tm -> Tm -> Tm -- I, LmkDescDescAppAt
mkDescDescAppAt: applied form of descDesc carrying an explicit ℓ for the universe of I — generalised outer signature λℓ:Level. λI:U(ℓ). λL:Level. Desc^(suc (max L ℓ)) ⊤.
mkDescDescAppAt : Tm -> Tm -> Tm -> Tm -- ℓ, I, LmkDescInd
mkDescInd: levitated induction principle on μ I D — given a motive and step function, produces a generic recursor over the data described by D.
mkDescInd : Tm -> Tm -> Tm -> Tm -> Tm -> Tm -- I, D, motive, step, scrutmkEmpty
mkEmpty: empty type Empty — initial type at universe level 0; no constructors.
mkEverywhereD
mkEverywhereD: payload-traversal combinator over a description — applies a per-node f at every recursive position, producing a derived payload of the same shape.
mkEverywhereD : Tm -> Tm -> Tm -> Tm -> Tm -> Tm -> Tm -> Tm -> TmmkFloat
mkFloat: axiomatised primitive type Float — type former at U(0) inhabited by Nix floats (excludes integers).
mkFloatLit
mkFloatLit: kernel literal for a Nix float x : Float.
mkFloatLit : Float -> TmmkFnLit
mkFnLit: kernel literal for an opaque Nix function f : Function — wraps the function in an fnBox for thunk-identity-preserving conversion.
mkFnLit : Function -> TmmkFst
mkFst: first-projection eliminator on a Σ-typed term — yields the dependent fst component; Σ-eta is exercised in conv.
mkFst : Tm -> TmmkFunction
mkFunction: axiomatised primitive type Function — type former at U(0) inhabited by opaque Nix-level functions wrapped via mkOpaqueLam.
mkFunext
mkFunext: function-extensionality axiom — given pointwise-equal f, g at every argument, produces an equality proof Eq (Π a:A. B a) f g.
mkFunext : Tm -> Tm -> Tm -> Tm -> Tm -> Tm -- A, B, f, g, hypothesismkInt
mkInt: axiomatised primitive type Int — type former at U(0) inhabited by Nix integers (excludes floats).
mkIntEq
mkIntEq: host == on Int literals intEq a b : Bool (parallel to mkStrEq).
mkIntEq : Tm -> Tm -> Tm -- a, bmkIntLe
mkIntLe: host <= on Int literals intLe a b : Bool (parallel to mkStrEq). Non-symmetric — operand order preserved on a neutral spine.
mkIntLe : Tm -> Tm -> Tm -- a, bmkIntLit
mkIntLit: kernel literal for a Nix integer n : Int.
mkIntLit : Int -> TmmkInterpD
mkInterpD: interpret a description D : Desc I k against a recursive carrier X : I -> U(k) at index i, yielding the payload type interpD D X i.
mkInterpD : Tm -> Tm -> Tm -> Tm -> Tm -- k, I, D, X, imkLam
mkLam: lambda abstraction λ(name : domain). body — domain annotation is optional at check time (overridden by expected Π's domain).
mkLam : String -> Tm -> Tm -> Tm -- name, domain, bodymkLet
mkLet: let-binding let name : type = val in body — name is cosmetic, the binder is introduced into body's de Bruijn context as index 0.
mkLet : String -> Tm -> Tm -> Tm -> Tm -- name, type, val, bodymkLevel
mkLevel: universe-level sort Level : U(0) — the type former whose inhabitants are level expressions used in mkU.
mkLevelLit
mkLevelLit: concrete Level literal from an Int — builds suc^n zero as a Level term; entry point for level-polymorphism-free code.
mkLevelLit : Int -> TmmkLevelMax
mkLevelMax: pointwise max of two levels max(l, r) : Level — used to compute the universe of Σ / Π types whose components inhabit distinct universes.
mkLevelMax : Tm -> Tm -> Tm -- l, rmkLevelSuc
mkLevelSuc: successor suc(level) : Level — increment a Level expression by one.
mkLevelSuc : Tm -> TmmkLevelZero
mkLevelZero: level-zero literal 0 : Level — base case of Level's inductive structure.
mkLift
mkLift: Tarski lift LiftAt l m A : U(m) with l ≤ m — non-cumulative cross-level transport of a type at level l into level m.
mkLift : Tm -> Tm -> Tm -> Tm -- l, m, AmkLiftElim
mkLiftElim: elimination of Lift l m A — lowers a lifted term back to its original level; the inverse pairing with mkLiftIntro.
mkLiftElim : Tm -> Tm -> Tm -> Tm -> Tm -- l, m, A, xmkLiftIntro
mkLiftIntro: introduction of Lift l m A — lifts a term a : A at level l to a term at level m; eq witness is auto-emitted via mkBootRefl.
mkLiftIntro : Tm -> Tm -> Tm -> Tm -> Tm -- l, m, A, amkLitVal
mkLitVal: closed-Val splice — opaque Val carrier whose eval is identity on the carried value. O(1) Val→Tm reflection; sound iff val is closed.
mkLitVal : Val -> TmmkMu
mkMu: levitated fixpoint μ I D i — carrier type of values whose constructors are described by D : Desc I k at index i.
mkMu : Tm -> Tm -> Tm -> Tm -- I, D, imkOpaqueLam
mkOpaqueLam: lambda over an opaque Nix function — kernel never inspects or applies it; fnBox thunk identity preserves conv reflexivity across eval/quote rounds.
mkOpaqueLam : FnBox -> Tm -> Tm -- fnBox, piTypemkPair
mkPair: pair constructor (fst, snd) — both components are checked against the corresponding Σ slots at the expected type.
mkPair : Tm -> Tm -> Tm -- fst, sndmkPath
mkPath: axiomatised primitive type Path — type former at U(0) inhabited by Nix path values.
mkPathLit
mkPathLit: kernel literal for a Nix path p : Path.
mkPathLit : Path -> TmmkPi
mkPi: dependent function type Π(name : domain). codomain — name is cosmetic, the binder is introduced into codomain's de Bruijn context as index 0.
mkPi : String -> Tm -> Tm -> Tm -- name, domain, codomainmkSigma
mkSigma: dependent pair type Σ(name : fst). snd — name is cosmetic, the binder is introduced into snd's de Bruijn context as index 0.
mkSigma : String -> Tm -> Tm -> Tm -- name, fst, sndmkSnd
mkSnd: second-projection eliminator on a Σ-typed term — yields the snd component with fst substituted; Σ-eta is exercised in conv.
mkSnd : Tm -> TmmkSquash
mkSquash: propositional truncation Squash A — quotient of A collapsing all inhabitants to one, used for proof-irrelevant fields.
mkSquash : Tm -> TmmkSquashElim
mkSquashElim: eliminator for Squash restricted to Squash-typed motives — preserves proof irrelevance by forbidding motives that distinguish inhabitants.
mkSquashElim : Tm -> Tm -> Tm -> Tm -> Tm -- A, motive, fn, scrutmkSquashIntro
mkSquashIntro: introduction of Squash A — lifts any a : A to a single inhabitant of Squash A.
mkSquashIntro : Tm -> TmmkStrEq
mkStrEq: decidable equality on String literals strEq a b : Bool — used by indexed datatypes whose constructor selection branches on string keys.
mkStrEq : Tm -> Tm -> Tm -- a, bmkStrLen
mkStrLen: host string length strLen s : Int on a String literal; a stuck string operand keeps it neutral. Internalizes string-length refinements (e.g. non-emptiness).
mkStrLen : Tm -> Tm -- smkString
mkString: axiomatised primitive type String — type former at U(0) inhabited by Nix string values.
mkStringLit
mkStringLit: kernel literal for a Nix string s : String.
mkStringLit : String -> TmmkTt
mkTt: unit value tt — sole inhabitant of mkUnit; eta-converts every term of type Unit to itself.
mkU
mkU: universe type U(level) at the given level expression — accepts either a concrete Int (wrapped via mkLevelLit) or a Level-typed Tm.
mkU : (Int | Tm) -> TmmkUnit
mkUnit: unit type Unit — terminal type with single inhabitant tt; backs fx.types.Unit at universe level 0.
mkVar
mkVar: variable reference by de Bruijn index — 0 is the innermost binder; higher indices reach outer binders.
mkVar : Int -> Tm