package coq-core
Install
Dune Dependency
Authors
Maintainers
Sources
md5=13d2793fc6413aac5168822313e4864e
sha512=ec8379df34ba6e72bcf0218c66fef248b0e4c5c436fb3f2d7dd83a2c5f349dd0874a67484fcf9c0df3e5d5937d7ae2b2a79274725595b4b0065a381f70769b42
doc/coq-core.kernel/CClosure/index.html
Module CClosure
Source
Lazy reduction.
fconstr
is the type of frozen constr
fconstr
can be accessed by using the function fterm_of
and by matching on type fterm
type fterm =
| FRel of int
| FAtom of Constr.constr
(*Metas and Sorts
*)| FFlex of table_key
| FInd of Constr.pinductive
| FConstruct of Constr.pconstructor
| FApp of fconstr * fconstr array
| FProj of Names.Projection.t * Sorts.relevance * fconstr
| FFix of Constr.fixpoint * usubs
| FCoFix of Constr.cofixpoint * usubs
| FCaseT of Constr.case_info * UVars.Instance.t * Constr.constr array * Constr.case_return * fconstr * Constr.case_branch array * usubs
| FCaseInvert of Constr.case_info * UVars.Instance.t * Constr.constr array * Constr.case_return * finvert * fconstr * Constr.case_branch array * usubs
| FLambda of int * (Names.Name.t Context.binder_annot * Constr.constr) list * Constr.constr * usubs
| FProd of Names.Name.t Context.binder_annot * fconstr * Constr.constr * usubs
| FLetIn of Names.Name.t Context.binder_annot * fconstr * fconstr * Constr.constr * usubs
| FEvar of Evar.t * Constr.constr list * usubs * evar_repack
| FInt of Uint63.t
| FFloat of Float64.t
| FArray of UVars.Instance.t * fconstr Parray.t * fconstr
| FLIFT of int * fconstr
| FCLOS of Constr.constr * usubs
| FIrrelevant
| FLOCKED
Relevances (eg in binder_annot or case_info) have NOT been substituted when there is a usubs field
type stack_member =
| Zapp of fconstr array
| ZcaseT of Constr.case_info * UVars.Instance.t * Constr.constr array * Constr.case_return * Constr.case_branch array * usubs
| Zproj of Names.Projection.Repr.t * Sorts.relevance
| Zfix of fconstr * stack
| Zprimitive of CPrimitives.t * Constr.pconstant * fconstr list * fconstr next_native_args
| Zshift of int
| Zupdate of fconstr
val get_native_args1 :
CPrimitives.t ->
Constr.pconstant ->
stack ->
fconstr list * fconstr * fconstr next_native_args * stack
val inductive_subst :
Declarations.mutual_inductive_body ->
UVars.Instance.t ->
fconstr array ->
usubs
identity if the first instance is empty
To lazy reduce a constr, create a clos_infos
with create_clos_infos
, inject the term to reduce with inject
; then use a reduction function
mk_atom: prevents a term from being evaluated
val destFLambda :
(usubs -> Constr.constr -> fconstr) ->
fconstr ->
Names.Name.t Context.binder_annot * fconstr * fconstr
Global and local constant cache
type 'constr evar_handler = {
evar_expand : 'constr Constr.pexistential -> 'constr evar_expansion;
evar_repack : (Evar.t * 'constr list) -> 'constr;
evar_irrelevant : 'constr Constr.pexistential -> bool;
qvar_irrelevant : Sorts.QVar.t -> bool;
}
val create_conv_infos :
?univs:UGraph.t ->
?evars:Constr.constr evar_handler ->
RedFlags.reds ->
Environ.env ->
clos_infos
val create_clos_infos :
?univs:UGraph.t ->
?evars:Constr.constr evar_handler ->
RedFlags.reds ->
Environ.env ->
clos_infos
val unfold_projection :
clos_infos ->
Names.Projection.t ->
Sorts.relevance ->
stack_member option
Reduction function
norm_val
is for strong normalization
Same as norm_val
but for terms
whd_val
is for weak head normalization
whd_stack
performs weak head normalization in a given stack. It stops whenever a reduction is blocked.
val eta_expand_ind_stack :
Environ.env ->
Constr.pinductive ->
fconstr ->
stack ->
(fconstr * stack) ->
stack * stack
eta_expand_ind_stack env ind c s t
computes stacks corresponding to the conversion of the eta expansion of t, considered as an inhabitant of ind, and the Constructor c of this inductive type applied to arguments s. Assumes t
is a rigid term, and not a constructor. ind
is the inductive of the constructor term c
Conversion auxiliary functions to do step by step normalisation
val unfold_ref_with_args :
clos_infos ->
clos_tab ->
table_key ->
stack ->
(fconstr * stack) option
Like unfold_reference
, but handles primitives: if there are not enough arguments, return None
. Otherwise return Some
with ZPrimitive
added to the stack. Produces a FIrrelevant
when the reference is irrelevant and the infos was created with create_conv_infos
.
Hook for Reduction
End of cbn debug section i