package coq-core
Install
dune-project
Dependency
Authors
Maintainers
Sources
md5=0cfaa70f569be9494d24c829e6555d46
sha512=8ee967c636b67b22a4f34115871d8f9b9114df309afc9ddf5f61275251088c6e21f6cf745811df75554d30f4cebb6682f23eeb2e88b771330c4b60ce3f6bf5e2
doc/coq-core.engine/Evarutil/index.html
Module EvarutilSource
This module provides useful higher-level functions for evar manipulation.
Metas
new_meta is a generator of unique meta variables
Creating a fresh evar given their type and context
val new_evar :
?src:Evar_kinds.t Loc.located ->
?filter:Evd.Filter.t ->
?relevance:EConstr.ERelevance.t ->
?abstract_arguments:Evd.Abstraction.t ->
?candidates:EConstr.constr list ->
?naming:Namegen.intro_pattern_naming_expr ->
?typeclass_candidate:bool ->
?principal:bool ->
?hypnaming:naming_mode ->
Environ.env ->
Evd.evar_map ->
EConstr.types ->
Evd.evar_map * EConstr.tval new_pure_evar :
?src:Evar_kinds.t Loc.located ->
?filter:Evd.Filter.t ->
?relevance:EConstr.ERelevance.t ->
?abstract_arguments:Evd.Abstraction.t ->
?candidates:EConstr.constr list ->
?name:Names.Id.t ->
?typeclass_candidate:bool ->
?principal:bool ->
Environ.named_context_val ->
Evd.evar_map ->
EConstr.types ->
Evd.evar_map * Evar.tAlias of Evd.new_pure_evar
val new_type_evar :
?src:Evar_kinds.t Loc.located ->
?filter:Evd.Filter.t ->
?naming:Namegen.intro_pattern_naming_expr ->
?principal:bool ->
?hypnaming:naming_mode ->
Environ.env ->
Evd.evar_map ->
Evd.rigid ->
Evd.evar_map * (EConstr.constr * EConstr.ESorts.t)Create a new Type existential variable, as we keep track of them during type-checking and unification.
Unification utils
head_evar c returns the head evar of c if any
may raise NoHeadEvar
advance sigma g returns Some g' if g' is undefined and is the current avatar of g (for instance g was changed by clear into g'). It returns None if g has been (partially) solved.
reachable_from_evars sigma seeds computes the descendents of evars in seeds by restriction or evar-evar unifications in sigma.
The following functions return the set of undefined evars contained in the object, the defined evars being traversed. This is roughly a combination of the previous functions and nf_evar.
val filtered_undefined_evars_of_evar_info :
?cache:undefined_evars_cache ->
Evd.evar_map ->
'a Evd.evar_info ->
Evar.Set.toccur_evar_upto sigma k c returns true if k appears in c. It looks up recursively in sigma for the value of existential variables.
Value/Type constraints
flush_and_check_evars raise Uninstantiated_evar if an evar remains uninstantiated; nf_evar leaves uninstantiated evars as is
val jv_nf_evar :
Evd.evar_map ->
EConstr.unsafe_judgment array ->
EConstr.unsafe_judgment arrayPresenting terms without solved evars
Replacing all evars, possibly raising Uninstantiated_evar
val finalize :
?abort_on_undefined_evars:bool ->
Evd.evar_map ->
((EConstr.t -> Constr.t) -> 'a) ->
Evd.evar_map * 'afinalize env sigma f combines universe minimisation, evar-and-universe normalisation and universe restriction.
It minimizes universes in sigma, calls f a normalisation function with respect to the updated sigma and restricts the local universes of sigma to those encountered while running f.
Note that the normalizer passed to f holds some imperative state in its closure.
Term manipulation up to instantiation
val kind_of_term_upto :
Evd.evar_map ->
Constr.constr ->
(Constr.constr, Constr.types, Sorts.t, UVars.Instance.t, Sorts.relevance)
Constr.kind_of_termLike Constr.kind except that kind_of_term sigma t exposes t as an evar e only if e is uninstantiated in sigma. Otherwise the value of e in sigma is (recursively) used.
val eq_constr_univs_test :
evd:Evd.evar_map ->
extended_evd:Evd.evar_map ->
EConstr.constr ->
EConstr.constr ->
booleq_constr_univs_test ~evd ~extended_evd t u tests equality of t and u up to existential variable instantiation and equalisable universes. The term t is interpreted in evd while u is interpreted in extended_evd. The universe constraints in extended_evd are assumed to be an extension of those in evd.
val compare_cumulative_instances :
Conversion.conv_pb ->
UVars.Variance.t array ->
UVars.Instance.t ->
UVars.Instance.t ->
Evd.evar_map ->
(Evd.evar_map, UGraph.univ_inconsistency) Util.unioncompare_cumulative_instances cv_pb variance u1 u2 sigma Returns Inl sigma' where sigma' is sigma augmented with universe constraints such that u1 cv_pb? u2 according to variance. Additionally flexible universes in irrelevant positions are unified if possible. Returns Inr p when the former is impossible.
val compare_constructor_instances :
Evd.evar_map ->
UVars.Instance.t ->
UVars.Instance.t ->
(Evd.evar_map, UGraph.univ_inconsistency) Util.unionWe should only compare constructors at convertible types, so this is only an opportunity to unify universes.
But what about qualities?
Unification problems
add_unification_pb ?tail pb sigma Add a unification problem pb to sigma, if not already present. Put it at the end of the list if tail is true, by default it is false.
Removing hyps in evars'context
raise OccurHypInSimpleClause if the removal breaks dependencies
type clear_dependency_error = | OccurHypInSimpleClause of Names.Id.t option| EvarTypingBreak of Constr.existential| NoCandidatesLeft of Evar.t
exception ClearDependencyError of Names.Id.t
* clear_dependency_error
* Names.GlobRef.t optionRestrict an undefined evar according to a (sub)filter and candidates. The evar will be defined if there is only one candidate left,
val restrict_evar :
Evd.evar_map ->
Evar.t ->
Evd.Filter.t ->
EConstr.constr list option ->
Evd.evar_map * Evar.tval clear_hyps_in_evi :
Environ.env ->
Evd.evar_map ->
Environ.named_context_val ->
EConstr.types ->
Names.Id.Set.t ->
Evd.evar_map * Environ.named_context_val * EConstr.typesval clear_hyps2_in_evi :
Environ.env ->
Evd.evar_map ->
Environ.named_context_val ->
EConstr.types ->
EConstr.types ->
Names.Id.Set.t ->
Evd.evar_map * Environ.named_context_val * EConstr.types * EConstr.typesval check_and_clear_in_constr :
Environ.env ->
Evd.evar_map ->
clear_dependency_error ->
Names.Id.Set.t ->
EConstr.constr ->
Evd.evar_mapval push_rel_decl_to_named_context :
hypnaming:naming_mode ->
Evd.evar_map ->
EConstr.rel_declaration ->
ext_named_context ->
ext_named_contextval push_rel_context_to_named_context :
hypnaming:naming_mode ->
Environ.env ->
Evd.evar_map ->
EConstr.types ->
Environ.named_context_val * EConstr.types * EConstr.constr SList.t * csubstval generalize_evar_over_rels :
Evd.evar_map ->
EConstr.existential ->
EConstr.types * EConstr.constr listval subterm_source :
Evar.t ->
?where:Evar_kinds.subevar_kind ->
Evar_kinds.t Loc.located ->
Evar_kinds.t Loc.located