EConstrtype t = Evd.econstrType of incomplete terms. Essentially a wrapper around Constr.t ensuring that Constr.kind does not observe defined evars.
module ERelevance : sig ... endmodule ESorts : sig ... endmodule EInstance : sig ... endtype types = ttype constr = ttype existential = t Constr.pexistentialtype case_return = (t, ERelevance.t) Constr.pcase_returntype case_branch = (t, ERelevance.t) Constr.pcase_branchtype rec_declaration = (t, t, ERelevance.t) Constr.prec_declarationtype fixpoint = (t, t, ERelevance.t) Constr.pfixpointtype cofixpoint = (t, t, ERelevance.t) Constr.pcofixpointtype unsafe_judgment = (constr, types) Environ.punsafe_judgmenttype unsafe_type_judgment = (types, Evd.esorts) Environ.punsafe_type_judgmenttype named_declaration =
(constr, types, ERelevance.t) Context.Named.Declaration.pttype rel_declaration = (constr, types, ERelevance.t) Context.Rel.Declaration.pttype named_context = (constr, types, ERelevance.t) Context.Named.pttype rel_context = (constr, types, ERelevance.t) Context.Rel.pttype 'a binder_annot = ('a, ERelevance.t) Context.pbinder_annotval annotR : 'a -> 'a binder_annotval nameR : Names.Id.t -> Names.Name.t binder_annotval anonR : Names.Name.t binder_annottype case_invert = t Constr.pcase_inverttype case = (t, t, EInstance.t, ERelevance.t) Constr.pcasetype 'a puniverses = 'a * EInstance.tval kind :
Evd.evar_map ->
t ->
(t, t, ESorts.t, EInstance.t, ERelevance.t) Constr.kind_of_termSame as Constr.kind except that it expands evars and normalizes universes on the fly.
val kind_upto :
Evd.evar_map ->
Constr.t ->
(Constr.t, Constr.t, Sorts.t, UVars.Instance.t, Sorts.relevance)
Constr.kind_of_termval to_constr : ?abort_on_undefined_evars:bool -> Evd.evar_map -> t -> Constr.tReturns the evar-normal form of the argument. Note that this function is supposed to be called when the original term has not more free-evars anymore. If you need compatibility with the old semantics, set abort_on_undefined_evars to false.
For getting the evar-normal form of a term with evars see Evarutil.nf_evar.
val to_constr_opt : Evd.evar_map -> t -> Constr.t optionSame as to_constr, but returns None if some unresolved evars remain
type kind_of_type = | SortType of ESorts.t| CastType of types * t| ProdType of Names.Name.t binder_annot * t * t| LetInType of Names.Name.t binder_annot * t * t * t| AtomicType of t * t arrayval kind_of_type : Evd.evar_map -> t -> kind_of_typeval of_kind :
(t, t, ESorts.t, EInstance.t, ERelevance.t) Constr.kind_of_term ->
tConstruct a term from a view.
Evar-insensitive versions of the corresponding functions. See the Constr module for more information.
val mkRel : int -> tval mkVar : Names.Id.t -> tval mkMeta : Constr.metavariable -> tval mkEvar : t Constr.pexistential -> tval mkSProp : tval mkProp : tval mkSet : tval mkType : Univ.Universe.t -> tval mkCast : (t * Constr.cast_kind * t) -> tval mkProd : (Names.Name.t binder_annot * t * t) -> tval mkLambda : (Names.Name.t binder_annot * t * t) -> tval mkLetIn : (Names.Name.t binder_annot * t * t * t) -> tval mkConstU : (Names.Constant.t * EInstance.t) -> tval mkProj : (Names.Projection.t * ERelevance.t * t) -> tval mkIndU : (Names.inductive * EInstance.t) -> tval mkConstructU : (Names.constructor * EInstance.t) -> tval mkConstructUi : ((Names.inductive * EInstance.t) * int) -> tval mkFix : (t, t, ERelevance.t) Constr.pfixpoint -> tval mkCoFix : (t, t, ERelevance.t) Constr.pcofixpoint -> tval mkArrow : t -> ERelevance.t -> t -> tval mkArray : (EInstance.t * t array * t * t) -> tmodule UnsafeMonomorphic : sig ... endval mkRef : (Names.GlobRef.t * EInstance.t) -> tval type1 : t Abstracting/generalizing over binders
it = iterated or_LetIn = turn a local definition into a LetIn wo_LetIn = inlines local definitions (i.e. substitute them in the body) Named = binding is by name and the combinators turn it into a binding by index (complexity is nb(binders) * size(term))
val it_mkProd : t -> (Names.Name.t binder_annot * t) list -> tval it_mkLambda : t -> (Names.Name.t binder_annot * t) list -> tval mkProd_or_LetIn : rel_declaration -> t -> tval mkLambda_or_LetIn : rel_declaration -> t -> tval it_mkProd_or_LetIn : t -> rel_context -> tval it_mkLambda_or_LetIn : t -> rel_context -> tval mkProd_wo_LetIn : rel_declaration -> t -> tval mkLambda_wo_LetIn : rel_declaration -> t -> tval it_mkProd_wo_LetIn : t -> rel_context -> tval it_mkLambda_wo_LetIn : t -> rel_context -> tval mkNamedProd :
Evd.evar_map ->
Names.Id.t binder_annot ->
types ->
types ->
typesval mkNamedLambda :
Evd.evar_map ->
Names.Id.t binder_annot ->
types ->
constr ->
constrval mkNamedLetIn :
Evd.evar_map ->
Names.Id.t binder_annot ->
constr ->
types ->
constr ->
constrval mkNamedProd_or_LetIn : Evd.evar_map -> named_declaration -> types -> typesval mkNamedLambda_or_LetIn :
Evd.evar_map ->
named_declaration ->
types ->
typesval it_mkNamedProd_or_LetIn : Evd.evar_map -> t -> named_context -> tval it_mkNamedLambda_or_LetIn : Evd.evar_map -> t -> named_context -> tval mkNamedProd_wo_LetIn : Evd.evar_map -> named_declaration -> t -> tval it_mkNamedProd_wo_LetIn : Evd.evar_map -> t -> named_context -> tval mkLEvar : Evd.evar_map -> (Evar.t * t list) -> tVariant of mkEvar that removes identity variable instances from its argument.
val isRel : Evd.evar_map -> t -> boolval isVar : Evd.evar_map -> t -> boolval isInd : Evd.evar_map -> t -> boolval isRef : Evd.evar_map -> t -> boolval isEvar : Evd.evar_map -> t -> boolval isMeta : Evd.evar_map -> t -> boolval isSort : Evd.evar_map -> t -> boolval isCast : Evd.evar_map -> t -> boolval isApp : Evd.evar_map -> t -> boolval isLambda : Evd.evar_map -> t -> boolval isLetIn : Evd.evar_map -> t -> boolval isProd : Evd.evar_map -> t -> boolval isConst : Evd.evar_map -> t -> boolval isConstruct : Evd.evar_map -> t -> boolval isFix : Evd.evar_map -> t -> boolval isCoFix : Evd.evar_map -> t -> boolval isCase : Evd.evar_map -> t -> boolval isProj : Evd.evar_map -> t -> boolval isType : Evd.evar_map -> constr -> booltype arity = rel_context * ESorts.tval destArity : Evd.evar_map -> types -> arityval isArity : Evd.evar_map -> t -> boolval isVarId : Evd.evar_map -> Names.Id.t -> t -> boolval isRelN : Evd.evar_map -> int -> t -> boolval isRefX : Environ.env -> Evd.evar_map -> Names.GlobRef.t -> t -> boolval is_lib_ref : Environ.env -> Evd.evar_map -> string -> t -> boolThe string is interpreted by Rocqlib.lib_ref. If it is not registered, return false.
val destRel : Evd.evar_map -> t -> intval destMeta : Evd.evar_map -> t -> Constr.metavariableval destVar : Evd.evar_map -> t -> Names.Id.tval destSort : Evd.evar_map -> t -> ESorts.tval destCast : Evd.evar_map -> t -> t * Constr.cast_kind * tval destProd : Evd.evar_map -> t -> Names.Name.t binder_annot * types * typesval destLambda : Evd.evar_map -> t -> Names.Name.t binder_annot * types * tval destLetIn : Evd.evar_map -> t -> Names.Name.t binder_annot * t * types * tval destApp : Evd.evar_map -> t -> t * t arrayval destConst : Evd.evar_map -> t -> Names.Constant.t * EInstance.tval destEvar : Evd.evar_map -> t -> t Constr.pexistentialval destInd : Evd.evar_map -> t -> Names.inductive * EInstance.tval destConstruct : Evd.evar_map -> t -> Names.constructor * EInstance.tval destCase : Evd.evar_map -> t -> caseval destProj : Evd.evar_map -> t -> Names.Projection.t * ERelevance.t * tval destFix : Evd.evar_map -> t -> (t, t, ERelevance.t) Constr.pfixpointval destCoFix : Evd.evar_map -> t -> (t, t, ERelevance.t) Constr.pcofixpointval destRef : Evd.evar_map -> t -> Names.GlobRef.t * EInstance.tval decompose_app : Evd.evar_map -> t -> t * t arrayval decompose_app_list : Evd.evar_map -> t -> t * t listval decompose_lambda :
Evd.evar_map ->
t ->
(Names.Name.t binder_annot * t) list * tPops lambda abstractions until there are no more, skipping casts.
val decompose_lambda_decls : Evd.evar_map -> t -> rel_context * tPops lambda abstractions and letins until there are no more, skipping casts.
val decompose_lambda_n :
Evd.evar_map ->
int ->
t ->
(Names.Name.t binder_annot * t) list * tPops n lambda abstractions, skipping casts.
val decompose_lambda_n_assum : Evd.evar_map -> int -> t -> rel_context * tPops n lambda abstractions, and pop letins only if needed to expose enough lambdas, skipping casts.
val decompose_lambda_n_decls : Evd.evar_map -> int -> t -> rel_context * tPops n lambda abstractions and letins, skipping casts.
val decompose_lambda_n_decls_opt :
Evd.evar_map ->
int ->
t ->
(rel_context * t) optionLike decompose_lambda_n_decls but returns None instead of raising an anomaly when there are not enough abstractions.
val prod_decls : Evd.evar_map -> t -> rel_contextval to_lambda : Evd.evar_map -> int -> t -> tval decompose_prod :
Evd.evar_map ->
t ->
(Names.Name.t binder_annot * t) list * tval decompose_prod_n :
Evd.evar_map ->
int ->
t ->
(Names.Name.t binder_annot * t) list * tval decompose_prod_decls : Evd.evar_map -> t -> rel_context * tval decompose_prod_n_decls : Evd.evar_map -> int -> t -> rel_context * tval existential_type : Evd.evar_map -> existential -> typesval whd_evar : Evd.evar_map -> constr -> constrval eq_constr : Evd.evar_map -> t -> t -> boolval eq_constr_nounivs : Evd.evar_map -> t -> t -> boolval eq_constr_universes :
Environ.env ->
Evd.evar_map ->
?nargs:int ->
t ->
t ->
UnivProblem.Set.t optionDoes not produce QLeq nor QElimTo constraints
val leq_constr_universes :
Environ.env ->
Evd.evar_map ->
?nargs:int ->
t ->
t ->
UnivProblem.Set.t optionval eq_existential :
Evd.evar_map ->
(t -> t -> bool) ->
existential ->
existential ->
boolval eq_constr_universes_proj :
Environ.env ->
Evd.evar_map ->
t ->
t ->
UnivProblem.Set.t optioneq_constr_universes_proj can equate projections and their eta-expanded constant form.
val compare_constr : Evd.evar_map -> (t -> t -> bool) -> t -> t -> boolval map : Evd.evar_map -> (t -> t) -> t -> tval map_with_binders :
Evd.evar_map ->
('a -> 'a) ->
('a -> t -> t) ->
'a ->
t ->
tval map_branches : (t -> t) -> case_branch array -> case_branch arrayval map_return_predicate : (t -> t) -> case_return -> case_returnval map_existential : Evd.evar_map -> (t -> t) -> existential -> existentialval iter : Evd.evar_map -> (t -> unit) -> t -> unitval iter_with_binders :
Evd.evar_map ->
('a -> 'a) ->
('a -> t -> unit) ->
'a ->
t ->
unitval iter_with_full_binders :
Environ.env ->
Evd.evar_map ->
(rel_declaration -> 'a -> 'a) ->
('a -> t -> unit) ->
'a ->
t ->
unitval fold : Evd.evar_map -> ('a -> t -> 'a) -> 'a -> t -> 'aval fold_with_binders :
Evd.evar_map ->
('a -> 'a) ->
('a -> 'b -> t -> 'b) ->
'a ->
'b ->
t ->
'bval universes_of_constr :
?init:(Sorts.Quality.Set.t * Univ.Level.Set.t) ->
Evd.evar_map ->
t ->
Sorts.Quality.Set.t * Univ.Level.Set.tGather the universes transitively used in the term, including in the type of evars appearing in it.
module Vars : sig ... endSee vars.mli for the documentation of the functions below
val push_rel : rel_declaration -> Environ.env -> Environ.envval push_rel_context : rel_context -> Environ.env -> Environ.envval push_rec_types : rec_declaration -> Environ.env -> Environ.envval push_named :
Environ.var_status ->
named_declaration ->
Environ.env ->
Environ.envval push_named_context :
(Environ.var_status * named_declaration) list ->
Environ.env ->
Environ.envval push_named_context_val :
Environ.var_status ->
named_declaration ->
Environ.named_context_val ->
Environ.named_context_valval rel_context : Environ.env -> rel_contextval named_context : Environ.env -> named_contextval val_of_named_context :
(Environ.var_status * named_declaration) list ->
Environ.named_context_valval named_context_of_val : Environ.named_context_val -> named_contextval named_context_of_val_with_status :
Environ.named_context_val ->
(Environ.var_status * named_declaration) listval fold_named_context_val :
(Environ.named_context_val ->
Environ.var_status ->
named_declaration ->
'a ->
'a) ->
Environ.named_context_val ->
init:'a ->
'aval fold_named_context :
(Environ.env -> Environ.var_status -> named_declaration -> 'a -> 'a) ->
Environ.env ->
init:'a ->
'aval lookup_rel : int -> Environ.env -> rel_declarationval lookup_named : Names.variable -> Environ.env -> named_declarationval lookup_named_val :
Names.variable ->
Environ.named_context_val ->
named_declarationval check_hyps_inclusion :
Environ.env ->
Names.GlobRef.t ->
Constr.named_context ->
unitcheck_hyps_inclusion env gr hyps Check that hyps are included in env and fails with error otherwise.
val lookup_constant :
Environ.env ->
Evd.evar_map ->
Names.Constant.t ->
Declarations.constant_bodyval constant_value_in :
Environ.env ->
Evd.evar_map ->
(Names.Constant.t * EInstance.t) ->
constrval map_rel_context_in_env :
(Environ.env -> constr -> constr) ->
Environ.env ->
rel_context ->
rel_contextval match_named_context_val :
Environ.named_context_val ->
(Environ.var_status * named_declaration * Environ.named_context_val) optionval map_named_val :
(Environ.var_status ->
named_declaration ->
Environ.var_status * named_declaration) ->
Environ.named_context_val ->
Environ.named_context_valmap_named_val f ctxt apply f to the body and the type of each declarations. *** /!\ *** f t must preserve the name
val identity_subst_val : Environ.named_context_val -> t SList.tval fresh_global :
?loc:Loc.t ->
?rigid:Evd.rigid ->
?names:EInstance.t ->
Environ.env ->
Evd.evar_map ->
Names.GlobRef.t ->
Evd.evar_map * tval expand_case :
Environ.env ->
Evd.evar_map ->
case ->
(t, t, ERelevance.t) Inductive.pexpanded_caseval annotate_case :
Environ.env ->
Evd.evar_map ->
case ->
Constr.case_info
* EInstance.t
* t array
* ((rel_context * t) * ERelevance.t)
* case_invert
* t
* (rel_context * t) arraySame as above, but doesn't turn contexts into binders
val expand_branch :
Environ.env ->
Evd.evar_map ->
EInstance.t ->
t array ->
Names.constructor ->
case_branch ->
rel_contextGiven a universe instance and parameters for the inductive type, constructs the typed context in which the branch lives.
val contract_case :
Environ.env ->
Evd.evar_map ->
(t, t, ERelevance.t) Inductive.pexpanded_case ->
caseval of_existential : Constr.existential -> existentialval of_named_decl : Constr.named_declaration -> named_declarationval of_rel_decl : Constr.rel_declaration -> rel_declarationval to_rel_decl : Evd.evar_map -> rel_declaration -> Constr.rel_declarationval to_named_decl :
Evd.evar_map ->
named_declaration ->
Constr.named_declarationval of_named_context : Constr.named_context -> named_contextval of_rel_context : Constr.rel_context -> rel_contextval to_named_context : Evd.evar_map -> named_context -> Constr.named_contextval to_rel_context : Evd.evar_map -> rel_context -> Constr.rel_contextval of_case_invert : Constr.case_invert -> case_invertval of_binder_annot : 'a Constr.binder_annot -> 'a binder_annotval to_binder_annot : Evd.evar_map -> 'a binder_annot -> 'a Constr.binder_annotmodule Unsafe : sig ... endmodule Expand : sig ... end