Expand description
LOGOS’s own terms in the core’s store: lower takes a Term of LOGOS’s Calculus of
Inductive Constructions to an ExprId, and lift takes it back.
Named variables become de Bruijn indices, a global becomes a constant (one name component, as
written), and LOGOS’s universes become levels: Prop is 0, Type n is n + 1, SProp is
super::level::LevelNode::SProp. match, fix and mutual fix are their
own nodes, and the literals keep their LOGOS meaning (Nat and Text as the core’s Nat and
string literals, the rest as Lit). An annotation is transparent and is not kept; a hole is
not a kernel term and is refused.
lift names a variable after the depth of its binder (v0 outermost), so a lifted term is
α-equivalent to the term that was lowered, and lowering it again gives the same id. It names the
kernel’s local i fvar{i}, which lower_open takes back to that local.
Enums§
- Lower
Error - Why a term has no image in the core.
Functions§
- explicit_
levels - The levels the
Termkernel’s application rule infers for a bare reference to a universe-polymorphic declaration (type_checker::implicit_levels_for_head), written out. The declaration’s level parameters become metavariables; left to right, each argument whose domain mentions one solves it from the argument’s type; a head whose every level is solved becomesConstat those levels. A head left with an unsolved level stays a bare reference, which the core refuses rather than guesses at. - level_
telescope - A global’s universe parameters and type: its explicit level telescope, or else the level
variables its type mentions, which the
Termkernel reads as bound by the declaration. - lift
- The LOGOS term for a closed core expression.
- lift_
level - The LOGOS universe for a core level.
- lower
- The core expression for a closed LOGOS term.
- lower_
open - The core expression for a LOGOS term over the kernel’s locals, named as
liftnames them. - lower_
universe - The core level for a LOGOS universe.