package coq
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=583471c8ed4f227cb374ee8a13a769c46579313d407db67a82d202ee48300e4b
doc/coq-core.pretyping/GlobEnv/index.html
Module GlobEnvSource
Type of environment extended with naming and ltac interpretation data
To embed constr in glob_constr
type 'a obj_interp_fun =
?loc:Loc.t ->
poly:bool ->
t ->
Evd.evar_map ->
Evardefine.type_constraint ->
'a ->
EConstr.unsafe_judgment * Evd.evar_mapPretyping name management
The following provides a level of abstraction for the kind of environment used for type inference (so-called pretyping); in particular:
- it supports that term variables can be interpreted as Ltac variables pointing to the effective expected name
- it incrementally and lazily computes the renaming of rel variables used to build purely-named evar contexts
Build a pretyping environment from an ltac environment
val make :
hypnaming:Evarutil.naming_mode ->
Environ.env ->
Evd.evar_map ->
Ltac_pretype.ltac_var_map ->
tExport the underlying environment
Push to the environment, returning the declaration(s) with interpreted names
val push_rel :
hypnaming:Evarutil.naming_mode ->
Evd.evar_map ->
EConstr.rel_declaration ->
t ->
EConstr.rel_declaration * tval push_rel_context :
hypnaming:Evarutil.naming_mode ->
?force_names:bool ->
Evd.evar_map ->
EConstr.rel_context ->
t ->
EConstr.rel_context * tval push_rec_types :
hypnaming:Evarutil.naming_mode ->
Evd.evar_map ->
(Names.Name.t Context.binder_annot array * EConstr.constr array) ->
t ->
Names.Name.t Context.binder_annot array * tDeclare an evar using renaming information
val new_evar :
t ->
Evd.evar_map ->
?src:Evar_kinds.t Loc.located ->
?naming:Namegen.intro_pattern_naming_expr ->
EConstr.constr ->
Evd.evar_map * EConstr.constrval new_type_evar :
t ->
Evd.evar_map ->
src:Evar_kinds.t Loc.located ->
Evd.evar_map * EConstr.constrhide_variable env na id tells to hide the binding of id in the ltac environment part of env and to additionally rebind it to id' in case na is some Name id'. It is useful e.g. for the dual status of y as term and binder. This is the case of match y return p with ... end which implicitly denotes match z as z return p with ... end when y is bound to a variable z and match t as y return p with ... end when y is bound to a non-variable term t. In the latter case, the binding of y to t should be hidden in p.
In case a variable is not bound by a term binder, look if it has an interpretation as a term in the ltac_var_map
val interp_ltac_variable :
?loc:Loc.t ->
(t -> Glob_term.glob_constr -> Evd.evar_map * EConstr.unsafe_judgment) ->
t ->
Evd.evar_map ->
Names.Id.t ->
Evd.evar_map * EConstr.unsafe_judgmentInterp an identifier as an ltac variable bound to an identifier, or as the identifier itself if not bound to an ltac variable
Interpreting a generic argument, typically a "ltac:(...)", taking into account the possible renaming
val interp_glob_genarg :
?loc:Loc.t ->
poly:bool ->
t ->
Evd.evar_map ->
Evardefine.type_constraint ->
Genarg.glob_generic_argument ->
EConstr.unsafe_judgment * Evd.evar_map