package coq-core
Install
Dune Dependency
Authors
Maintainers
Sources
md5=64b49dbc3205477bd7517642c0b9cbb6
sha512=02fb5b4fb575af79e092492cbec6dc0d15a1d74a07f827f657a72d4e6066532630e5a6d15be4acdb73314bd40b9a321f9ea0584e0ccfe51fd3a56353bd30db9b
doc/coq-core.engine/UState/index.html
Module UState
Source
This file defines universe unification states which are part of evarmaps. Most of the API below is reexported in Evd
. Consider using higher-level primitives when needed.
type universes_entry =
| Monomorphic_entry of Univ.ContextSet.t
| Polymorphic_entry of UVars.UContext.t
Type of universe unification states. They allow the incremental building of universe constraints during an interactive proof.
Constructors
Different ways to create a new universe state
Main entry point at the beginning of a declaration declaring the binding names as rigid universes.
Main entry point when only names matter, e.g. for printing.
Main entry point when starting from the instance of a global reference, e.g. when building a scheme.
Misc
Projections and other destructors
The local context of the state, i.e. a set of bound variables together with their associated constraints.
The local universes that are unification variables
The initial graph with just the declarations of new universes.
Can this universe be instantiated with an algebraic universe (ie it appears in inferred types only).
Shorthand for context_set
composed with ContextSet.constraints
.
Shorthand for context_set
with Context_set.to_context
.
Pick from context
or context_set
based on poly
.
Return local names of universes.
Returns the normal form of the sort variable.
Must not be allowed to be algebraic
Returns the normal form of the relevance.
Constraints handling
Names
Retrieve the universe associated to the name.
Gives a name to the level (making it a binder). Asserts the name is not already used by a level
Unification
val restrict_universe_context :
lbound:UGraph.Bound.t ->
Univ.ContextSet.t ->
Univ.Level.Set.t ->
Univ.ContextSet.t
restrict_universe_context lbound (univs,csts) keep
restricts univs
to the universes in keep
. The constraints csts
are adjusted so that transitive constraints between remaining universes (those in keep
and those not in univs
) are preserved.
restrict uctx ctx
restricts the local universes of uctx
to ctx
extended by local named universes and side effect universes (from demote_seff_univs
). Transitive constraints between retained universes are preserved.
restrict_even_binders uctx ctx
restricts the local universes of uctx
to ctx
extended by side effect universes (from demote_seff_univs
). Transitive constraints between retained universes are preserved.
Removes from the uctx_local part of the UState the universes and constraints that are present in the universe graph in the input env (supposedly the global ones)
Mark the universes as not local any more, because they have been globally declared by some side effect. You should be using emit_side_effects instead.
Declare a new local sort.
Declare a new local universe; use rigid if a global or bound universe; use flexible for a universe existential variable; use univ_flexible_alg for a universe existential variable allowed to be instantiated with an algebraic universe
cf UnivFlex
type ('a, 'b, 'c) gen_universe_decl = {
univdecl_qualities : 'a;
univdecl_instance : 'b;
univdecl_extensible_instance : bool;
univdecl_constraints : 'c;
univdecl_extensible_constraints : bool;
}
type universe_decl =
(Sorts.QVar.t list, Univ.Level.t list, Univ.Constraints.t) gen_universe_decl
check_univ_decl ctx decl
If non extensible in decl
, check that the local universes (resp. universe constraints) in ctx
are implied by decl
.
Return a universes_entry
containing the local universes of ctx
and their constraints.
When polymorphic, the universes corresponding to decl.univdecl_instance
come first in the order defined by that list.
TODO: Document me
Pretty-printing
Only looks in the local names, not in the nametab.