Names
Content created by Fredrik Bakke, Fernando Chu and Egbert Rijke.
Created on 2023-04-27.
Last modified on 2026-05-02.
module reflection.names where
Imports
open import foundation.unit-type open import foundation.universe-levels open import foundation-core.booleans open import foundation-core.cartesian-product-types open import foundation-core.identity-types open import primitives.machine-integers open import primitives.strings
Idea
The Name-Agda type represents quoted names, i.e. they are an abstract
syntactic representation of terms. Agda provides primitive functions to
manipulate them, giving them an equality and ordering. A closed term can be
converted to a quoted name by means of the quote keyword, e.g. quote bool.
Definition
postulate Name-Agda : UU lzero {-# BUILTIN QNAME Name-Agda #-} primitive primQNameEquality : Name-Agda → Name-Agda → bool primQNameLess : Name-Agda → Name-Agda → bool primShowQName : Name-Agda → String primQNameToWord64s : Name-Agda → Word64 × Word64 primQNameToWord64sInjective : (a b : Name-Agda) → primQNameToWord64s a = primQNameToWord64s b → a = b
Examples
_ : primQNameLess (quote bool) (quote unit) = true
_ = refl
_ : primShowQName (quote bool) = "foundation-core.booleans.bool"
_ = refl
Recent changes
- 2026-05-02. Fredrik Bakke and Egbert Rijke. Remove dependency between
BUILTINand postulates (#1373). - 2024-02-07. Fredrik Bakke. Deduplicate definitions (#1022).
- 2023-10-21. Egbert Rijke and Fredrik Bakke. Formatting of postulates (#870).
- 2023-07-29. Fernando Chu and Fernando Chu. Minor reflection fixes (#685).
- 2023-05-01. Fredrik Bakke. Refactor 2, the sequel to refactor (#581).