package coq
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=73466e61f229b23b4daffdd964be72bd7a110963b9d84bd4a86bb05c5dc19ef3
doc/coq-core.kernel/Univ/index.html
Module Univ
Source
Alias name.
The universes hierarchy: Type 0- = Prop <= Type 0 = Set <= Type 1 <= ... Typing of universes: Type 0-, Type 0 : Type 1; Type i : Type (i+1) if i>0
univ_level_mem l u
Is l is mentioned in u ?
univ_level_rem u v min
removes u
from v
, resulting in min
if v
was exactly u
.
Constraints.
A value with universe Constraints.t.
Constrained
Enforcing Constraints.t.
Type explanation is used to decorate error messages to provide useful explanation why a given constraint is rejected. It is composed of a path of universes and relation kinds (r1,u1);..;(rn,un)
means .. <(r1) u1 <(r2) ... <(rn) un (where <(ri) is the relation symbol denoted by ri, currently only < and <=). The lowest end of the chain is supposed known (see UniverseInconsistency exn). The upper end may differ from the second univ of UniverseInconsistency because all universes in the path are canonical. Note that each step does not necessarily correspond to an actual constraint, but reflect how the system stores the graph and may result from combination of several Constraints.t...
type univ_inconsistency =
constraint_type * Universe.t * Universe.t * explanation Lazy.t option
Support for universe polymorphism
Substitution
A full substitution, might involve algebraic universes
Universe instances
A vector of universe levels with universe Constraints.t, representing local universe variables and associated Constraints.t; the names are user-facing names for printing
type 'a univ_abstracted = {
univ_abstracted_value : 'a;
univ_abstracted_binder : AbstractContext.t;
}
A value with bound universe levels.
Universe contexts (as sets)
A set of universes with universe Constraints.t. We linearize the set to a list after typechecking. Beware, representation could change.
A value in a universe context (resp. context set).
val extend_in_context_set :
'a in_universe_context_set ->
ContextSet.t ->
'a in_universe_context_set
Substitution of universes.
val subst_univs_level_abstract_universe_context :
universe_level_subst ->
AbstractContext.t ->
AbstractContext.t
Level to universe substitutions.
Only user in the kernel is template polymorphism. Ideally we get rid of this code if it goes away.
Substitution of instances
Creates u(0) ↦ 0; ...; u(n-1) ↦ n - 1
out of u(0); ...; u(n - 1)
TODO: move universe abstraction out of the kernel
compact_univ u
remaps local variables in u
such that their indices become consecutive. It returns the new universe and the mapping. Example: compact_univ (Var 0, i); (Prop, 0); (Var 2; j))
= (Var 0,i); (Prop, 0); (Var 1; j)
, 0; 2
Pretty-printing of universes.
val pr_universe_context :
(Level.t -> Pp.t) ->
?variance:Variance.t array ->
UContext.t ->
Pp.t
val pr_abstract_universe_context :
(Level.t -> Pp.t) ->
?variance:Variance.t array ->
AbstractContext.t ->
Pp.t