(************************************************************************) (* * The Rocq Prover / The Rocq Development Team *) (* v * Copyright INRIA, CNRS and contributors *) (* <O___,, * (see version control and CREDITS file for authors & dates) *) (* \VV/ **************************************************************) (* // * This file is distributed under the terms of the *) (* * GNU Lesser General Public License Version 2.1 *) (* * (see LICENSE file for the text of the license) *) (************************************************************************)
open EConstr open Evd open Environ
type alias
val of_alias : alias -> EConstr.t
module AllowedEvars : sig
type t (** Represents the set of evars that can be defined by the pretyper *)
valall : t (** All evars can be defined *)
val mem : t -> Evar.t -> bool (** [mem allowed evk] is true iff evk can be defined *)
val from_pred : (Evar.t -> bool) -> t (** [from_pred p] means evars satisfying p can be defined *)
val except : Evar.Set.t -> t (** [except evars] means all evars can be defined except the ones in [evars] *)
val remove : Evar.t -> t -> t (** [remove evk allowed] removes [evk] from the set of evars allowed by [allowed] *)
end
type unify_flags = {
modulo_betaiota : bool; (* Enable beta-iota reductions during unification *)
open_ts : TransparentState.t; (* Enable delta reduction according to open_ts for open terms *)
closed_ts : TransparentState.t; (* Enable delta reduction according to closed_ts for closed terms (when calling conversion) *)
subterm_ts : TransparentState.t; (* Enable delta reduction according to subterm_ts for selection of subterms during higher-order
unifications. *)
allowed_evars : AllowedEvars.t; (* Disallowed evars are treated like rigid variables during unification: they can not be instantiated. *)
with_cs : bool (* Enable canonical structure resolution during unification *)
}
type unification_result =
| Success of evar_map
| UnifFailure of evar_map * Pretype_errors.unification_error
val is_success : unification_result -> bool
val is_evar_allowed : unify_flags -> Evar.t -> bool
(** Replace the vars and rels that are aliases to other vars and rels by
their representative that is most ancient in the context *) val expand_vars_in_term : env -> evar_map -> constr -> constr
(** One might want to use different conversion strategies for types and terms: e.g.preventingdeltareductionswhendoingtermunificationsbutallowing
arbitrary delta conversion when checking the types of evar instances. *)
type unification_kind =
| TypeUnification
| TermUnification
(** A unification function parameterized by: -unificationflags -thekindofunification -environment -sigma -conversionproblem
- the two terms to unify. *) type unifier = unify_flags -> unification_kind ->
env -> evar_map -> conv_pb -> constr -> constr -> unification_result
(** A conversion function: parameterized by the kind of unification, environment,sigma,conversionproblemandthetwotermstoconvert.
Conversion is not allowed to instantiate evars contrary to unification. *) type conversion_check = unify_flags -> unification_kind ->
env -> evar_map -> conv_pb -> constr -> constr -> bool
(** [instantiate_evar unify flags env sigma ev c] defines the evar [ev] with [c], checkingthatthetypeof[c]isunifiablewith[ev]'sdeclaredtypefirst.
(** [evar_define choose env ev c] try to instantiate [ev] with [c] (typed in [env]), possiblysolvingrelatedunificationproblems,possiblyleavingopen someproblemsthatcannotbesolvedinauniqueway(exceptifchooseis true);failsiftheinstanceisnotvalidforthegiven[ev]; If[ev]and[c]havenoninferablyconvertibletypes,anexception
[IllTypedInstance] is raised *)
val refresh_universes :
?status:Evd.rigid ->
?onlyalg:bool(* Only algebraic universes *) ->
?refreshset:bool -> (* Also refresh Prop and Set universes, so that the returned type can be any supertype
of the original type *) booloption(* direction: true for levels lower than the existing levels *) ->
env -> evar_map -> types -> evar_map * types
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.