Value
Values are the semantic domain produced by evaluation. They use de Bruijn levels (counting outward from the top of the context), not indices, which makes weakening trivial.
Closures
mkClosure : Env → Tm → Closure — defunctionalized closure.
No Nix lambdas in the TCB; a closure is { env, body } where
body is a kernel Tm evaluated by eval.instantiate.
Value Constructors
Each v* constructor mirrors a term constructor:
vLam,vPi— function values/types (carry name, domain, closure)vSigma,vPair— pair types/valuesvUnit,vTt— unitvBootSum,vBootInl,vBootInr— bootstrap coproduct valuesvBootEq,vBootRefl— identity valuesvU— universe valuesvString,vInt,vFloat,vAttrs,vPath,vDerivation,vFunction,vAny— primitive typesvStringLit,vIntLit,vFloatLit,vAttrsLit,vPathLit,vDerivationLit,vFnLit,vAnyLit— primitive literals
Neutrals
vNe : Level → Spine → Val — a stuck computation: a variable
(identified by de Bruijn level) applied to a spine of eliminators.
freshVar : Depth → Val — neutral with empty spine at the given depth.
Used during type-checking to introduce fresh variables under binders.
Elimination Frames (Spine Entries)
eApp,eFst,eSnd— function/pair eliminatorseBootSumElim,eBootJ— inductive eliminators
eAbsurd
eAbsurd: elimination frame for absurd on a neutral Empty-typed scrutinee — carries the target type P; sound because Empty has no canonical inhabitants, so this frame can only arise on a stuck spine.
eAbsurd : Val -> SpineEntry -- type PeAllD
eAllD: elimination frame for allD on a neutral description — carries motive P plus shape parameters.
eAllD : Val -> Val -> Val -> Val -> Val -> Val -> SpineEntryeApp
eApp: elimination frame for function application — pushes an argument onto a neutral spine.
eApp : Val -> SpineEntryeBootJ
eBootJ: elimination frame for the J eliminator on a neutral identity proof — carries A, a, motive, refl-case, b.
eBootJ : Val -> Val -> Val -> Val -> Val -> SpineEntryeBootSumElim
eBootSumElim: elimination frame for bootSumElim on a neutral sum scrutinee — carries motive and case arms.
eBootSumElim : Val -> Val -> Val -> Val -> Val -> SpineEntryeDescInd
eDescInd: elimination frame for descInd on a neutral μ-typed scrutinee — carries I, D, motive, step.
eDescInd : Val -> Val -> Val -> Val -> SpineEntryeEverywhereD
eEverywhereD: elimination frame for everywhereD on a neutral description — carries per-node f plus shape parameters.
eEverywhereD : Val -> Val -> Val -> Val -> Val -> Val -> Val -> SpineEntryeFst
eFst: elimination frame for first-projection on a Σ neutral.
eInterpD
eInterpD: elimination frame for interpD on a neutral description — carries k, I, X, i for completion when the neutral resolves.
eInterpD : Val -> Val -> Val -> Val -> SpineEntryeLiftElim
eLiftElim: elimination frame for liftElim on a neutral Lift l m A — carries l, m, A for level lowering.
eLiftElim : Val -> Val -> Val -> SpineEntryeSnd
eSnd: elimination frame for second-projection on a Σ neutral.
eSquashElim
eSquashElim: elimination frame for squashElim on a neutral Squash-typed scrutinee — carries motive shape (A, B) and case function f.
eSquashElim : Val -> Val -> Val -> SpineEntryeStrEq
eStrEq: elimination frame for strEq on a neutral string operand — carries the other operand for completion when the neutral resolves.
eStrEq : Val -> Val -> SpineEntryenvCons
envCons: O(1) environment extension — prepend a value as index 0; no list copy, no cached field.
envCons : Val -> Env -> EnvenvFromList
envFromList: normalize a Nix-list environment to cons cells (index 0 = list head); idempotent on cons (isList guard) so evaluator entry points normalize in O(1) on already-cons inputs.
envFromList : [Val] | Env -> EnvenvLen
envLen: environment length (binder depth) via an iterative genericClosure spine walk — O(N) time, O(1) stack (overflow-free); no cached field, which would recurse N-deep at read or build.
envLen : Env -> IntenvNil
envNil: empty de Bruijn environment (the cons-cell nil).
envNth
envNth: iterative de Bruijn lookup (foldl' over a range) — clears the C-stack and max-call-depth on deep environments.
envNth : Env -> Int -> ValenvPrepend
envPrepend: prepend a short Nix list of values (index 0 first) onto an environment.
envPrepend : [Val] -> Env -> EnvfreshVar
freshVar: introduce a fresh neutral variable at the given depth — used during type-checking to bind a fresh witness under Π / Σ / let binders.
freshVar : Int -> Val -- depthmkClosure
mkClosure: defunctionalised closure { env, body } — captures the evaluation environment and the kernel Tm body; instantiated by eval.instantiate without Nix lambdas in the TCB.
mkClosure : Env -> Tm -> ClosurevAllD
vAllD: value-domain induction-hypothesis collector — threads motive P through every recursive position in a payload.
vAllD : Val -> Val -> Val -> Val -> Val -> Val -> Val -> ValvAny
vAny: value-domain axiomatised top primitive Any : U(0) — accepts every Nix value.
vAnyLit
vAnyLit: value-domain literal carrying an arbitrary Nix value v : Any — used by approximate types whose kernel slot is vAny.
vAnyLit : Any -> ValvAttrs
vAttrs: value-domain axiomatised primitive Attrs : U(0) — inhabited by any Nix attrset.
vAttrsLit
vAttrsLit: value-domain literal carrying an opaque Nix attrset a : Attrs.
vAttrsLit : Attrs -> ValvBootEq
vBootEq: value-domain bootstrap identity type Eq(A, a, b) — propositional equality used by descRet's level transport and by the J eliminator.
vBootEq : Val -> Val -> Val -> Val -- A, a, bvBootInl
vBootInl: value-domain left-injection inl(a) : A + B — carries leftTy and rightTy for elaboration shape recovery.
vBootInl : Val -> Val -> Val -> Val -- leftTy, rightTy, valuevBootInr
vBootInr: value-domain right-injection inr(b) : A + B — carries leftTy and rightTy for elaboration shape recovery.
vBootInr : Val -> Val -> Val -> Val -- leftTy, rightTy, valuevBootRefl
vBootRefl: value-domain reflexivity refl : Eq(A, a, a) — canonical inhabitant of every reflexive identity; conv collapses all proofs of refl to this.
vBootSum
vBootSum: value-domain bootstrap coproduct type A + B — used by descPlus's sum-of-descriptions before generic sums become available.
vBootSum : Val -> Val -> ValvDerivation
vDerivation: value-domain axiomatised primitive Derivation : U(0) — Nix derivation values; the store-producing irreducible value category.
vDerivationLit
vDerivationLit: value-domain literal carrying a Nix derivation d : Derivation opaquely.
vDerivationLit : Derivation -> ValvDesc
vDesc: value-domain level-zero description type Desc I k at index sort I : U(0) and universe level k.
vDesc : Val -> Val -> Val -- level, IvDescAt
vDescAt: value-domain Desc^k I carrying an explicit iLev for the universe of I. The conv unfolding rule reads iLev to construct the expected mkDescDescAppV D-slot.
vDescAt : Val -> Val -> Val -> Val -- level, iLev, IvDescCon
vDescCon: value-domain constructor descCon(D, i, payload) — the canonical introducer for μ I D i values.
vDescCon : Val -> Val -> Val -> Val -- D, i, payloadvDescConChain
vDescConChain: flat-chain VDescCon for linearChain Descs. .d is stub vTt; chain lives in _layers (Nix list, outer-first) + _base. Chain-wide BootSum wrapper info on _payloadTag/_payloadLeft/_payloadRight. Outer cert is _layers[0].cert. O(1) libnix stack on deep force; non-chain-aware consumers crash on .d.fst rather than silently mis-reading a degenerate view.
vDescConChain : Val -> Val -> String -> Val -> Val -> [LayerRec] -> Val -> Val -- D, i, payloadTag, payloadLeft, payloadRight, layers, basevDescConTagged
vDescConTagged: value-domain descCon carrying a Squash-truncated guard certificate — surfaces refinement proofs on fx.types.Certified values.
vDescConTagged : Val -> Val -> Val -> Val -> Val -- D, i, payload, certvEmpty
vEmpty: value-domain empty type — initial type with no inhabitants; conv-equal in one step by tag identity.
vEverywhereD
vEverywhereD: value-domain payload-traversal combinator — applies per-node f at every recursive position, producing a same-shape derived payload.
vEverywhereD : Val -> Val -> Val -> Val -> Val -> Val -> Val -> Val -> ValvFloat
vFloat: value-domain axiomatised primitive Float : U(0).
vFloatLit
vFloatLit: value-domain literal carrying a Nix float x : Float.
vFloatLit : Float -> ValvFnLit
vFnLit: value-domain literal carrying an opaque Nix function — fnBox preserves thunk identity for conv reflexivity.
vFnLit : FnBox -> ValvFunction
vFunction: value-domain axiomatised primitive Function : U(0) — opaque-function carrier.
vFunext
vFunext: value-domain funext axiom — given pointwise equality, produces equality of functions at Π(a:A). B a.
vFunext : Val -> Val -> Val -> Val -> Val -> ValvInt
vInt: value-domain axiomatised primitive Int : U(0).
vIntLit
vIntLit: value-domain literal carrying a Nix integer n : Int.
vIntLit : Int -> ValvInterpD
vInterpD: value-domain interpretation interpD D X i — yields the payload type for a constructor described by D against carrier X.
vInterpD : Val -> Val -> Val -> Val -> Val -> Val -- k, I, D, X, ivLam
vLam: value-domain lambda λ(name : domain). body — carries a defunctionalised closure rather than a Nix function, keeping the TCB Nix-lambda-free.
vLam : String -> Val -> Closure -> ValvLazyDescIndAccLayer
vLazyDescIndAccLayer: MACHINE-INTERNAL deferred accumulator layer of a descInd linear chain. Applying expands via four kAppVV frames (step i d (vPair prevAcc vTt) arg); never escapes runMachineAtF.
vLazyDescIndAccLayer : Val -> Val -> Val -> Val -> Val -- step, i, d, prevAccvLevel
vLevel: value-domain Level type Level : U(0).
vLevelLit
vLevelLit: value-domain concrete Level literal n : Level — derived from a Nix integer at evaluation time.
vLevelLit : Int -> ValvLevelMax
vLevelMax: value-domain pointwise max max(l, r) : Level — used for universes of dependent products / pairs across distinct levels.
vLevelMax : Val -> Val -> Val -- l, rvLevelSuc
vLevelSuc: value-domain successor of a Level expression suc(l) : Level.
vLevelSuc : Val -> ValvLevelZero
vLevelZero: value-domain level-zero literal 0 : Level.
vLift
vLift: value-domain Tarski lift Lift l m A — non-cumulative cross-level transport of type A : U(l) into U(m) with l ≤ m.
vLift : Val -> Val -> Val -> Val -- l, m, AvLiftIntro
vLiftIntro: value-domain introduction of Lift l m A — lifts a term a : A at level l to a term at level m.
vLiftIntro : Val -> Val -> Val -> Val -> Val -- l, m, A, avMu
vMu: value-domain levitated fixpoint μ I D i — carrier type of values whose constructors are described by D at index i.
vMu : Val -> Val -> Val -> Val -- I, D, ivNe
vNe: neutral value — stuck computation var^lvl <spine>; head is a de Bruijn level, spine is a list of elimination frames awaiting reduction.
vNe : Int -> Spine -> Val -- level, spinevNeSnoc
vNeSnoc: O(1) neutral-spine extension — append one elimination frame via the skew-binary RAL backing _ral, keeping .spine a materialized in-order list. Use in place of vNe lvl (n.spine ++ [frame]) to avoid the O(N²)/overflow-prone Nix-list snoc.
vNeSnoc : Val -> SpineEntry -> Val -- neutral, framevOpaqueLam
vOpaqueLam: value-domain opaque lambda over a Nix function — kernel never inspects it; fnBox thunk identity preserves conv reflexivity.
vOpaqueLam : FnBox -> Val -> Val -- fnBox, piTypevPair
vPair: value-domain pair (fst, snd) — components held in WHNF, projected by eFst / eSnd spine frames.
vPair : Val -> Val -> ValvPath
vPath: value-domain axiomatised primitive Path : U(0).
vPathLit
vPathLit: value-domain literal carrying a Nix path p : Path.
vPathLit : Path -> ValvPi
vPi: value-domain dependent function type Π(name : domain). codomain — carries a closure for the codomain to permit semantic substitution.
vPi : String -> Val -> Closure -> ValvSigma
vSigma: value-domain dependent pair type Σ(name : fst). snd — carries a closure for the snd component to permit semantic substitution.
vSigma : String -> Val -> Closure -> ValvSquash
vSquash: value-domain propositional truncation Squash A — quotient of A collapsing all inhabitants to one for proof-irrelevant fields.
vSquash : Val -> ValvSquashIntro
vSquashIntro: value-domain introduction of Squash A — lifts any inhabitant of A to the sole inhabitant of Squash A.
vSquashIntro : Val -> ValvString
vString: value-domain axiomatised primitive String : U(0).
vStringLit
vStringLit: value-domain literal carrying a Nix string s : String.
vStringLit : String -> ValvThunkTm
vThunkTm: MACHINE-INTERNAL deferred-Tm Val produced by ev on non-atomic Tms. Captures { env; tm }; the driver's Done handler forces top-level VThunkTm before returning, so external code observes it only in stored sub-Val fields.
vThunkTm : Env -> Tm -> ValvTt
vTt: value-domain unit value tt — sole inhabitant of vUnit; conv collapses all Unit-typed values to this.
vU
vU: value-domain universe U(level) — the type of types at a given Level value.
vU : Val -> ValvUnit
vUnit: value-domain unit type — terminal type with single inhabitant vTt; eta-converted in conv.