package coq
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=583471c8ed4f227cb374ee8a13a769c46579313d407db67a82d202ee48300e4b
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 Univ.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.
The subset of unification variables that can be instantiated with algebraic universes as they appear 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.
Constraints handling
Names
Retrieve the universe associated to the name.
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.
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 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
make_flexible_variable g algebraic l
Turn the variable l
flexible, and algebraic if algebraic
is true and l
can be. That is if there are no strict upper constraints on l
and and it does not appear in the instance of any non-algebraic universe. Otherwise the variable is just made flexible.
If l
is already algebraic it will remain so even with algebraic:false
.
Make the level non algebraic. Undefined behaviour on already-defined algebraics.
Turn all undefined flexible algebraic variables into simply flexible ones. Can be used in case the variables might appear in universe instances (typically for polymorphic program obligations).
type ('a, 'b) gen_universe_decl = {
univdecl_instance : 'a;
univdecl_extensible_instance : bool;
univdecl_constraints : 'b;
univdecl_extensible_constraints : bool;
}
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.