package coq-core
Install
Dune Dependency
Authors
Maintainers
Sources
md5=66e57ea55275903bef74d5bf36fbe0f1
sha512=1a7eac6e2f58724a3f9d68bbb321e4cfe963ba1a5551b9b011db4b3f559c79be433d810ff262593d753770ee41ea68fbd6a60daa1e2319ea00dff64c8851d70b
doc/coq-core.engine/Termops/index.html
Module Termops
Source
This file defines various utilities for term manipulation that are not needed in the kernel.
val push_rel_assum :
(Names.Name.t EConstr.binder_annot * EConstr.types) ->
Environ.env ->
Environ.env
about contexts
val push_rels_assum :
(Names.Name.t Constr.binder_annot * Constr.types) list ->
Environ.env ->
Environ.env
val push_named_rec_types :
(Names.Name.t Constr.binder_annot array * Constr.types array * 'a) ->
Environ.env ->
Environ.env
Associates the contents of an identifier in a rel_context
. Raise Not_found
if there is no such identifier.
Functions that build argument lists matching a block of binders or a context. rel_vect n m
builds |Rel (n+m);...;Rel(n+1)|
Prod/Lambda/LetIn destructors on econstr
val it_mkProd :
EConstr.types ->
(Names.Name.t EConstr.binder_annot * EConstr.types) list ->
EConstr.types
val it_mkLambda :
EConstr.constr ->
(Names.Name.t EConstr.binder_annot * EConstr.types) list ->
EConstr.constr
val it_mkNamedProd_or_LetIn :
Evd.evar_map ->
EConstr.types ->
EConstr.named_context ->
EConstr.types
val it_mkNamedLambda_or_LetIn :
Evd.evar_map ->
EConstr.constr ->
EConstr.named_context ->
EConstr.constr
Prod/Lambda/LetIn destructors on constr
Generic iterators on constr
val map_constr_with_binders_left_to_right :
Environ.env ->
Evd.evar_map ->
(EConstr.rel_declaration -> 'a -> 'a) ->
('a -> EConstr.constr -> EConstr.constr) ->
'a ->
EConstr.constr ->
EConstr.constr
val map_constr_with_full_binders :
Environ.env ->
Evd.evar_map ->
(EConstr.rel_declaration -> 'a -> 'a) ->
('a -> EConstr.constr -> EConstr.constr) ->
'a ->
EConstr.constr ->
EConstr.constr
val fold_constr_with_full_binders :
Environ.env ->
Evd.evar_map ->
(EConstr.rel_declaration -> 'a -> 'a) ->
('a -> 'b -> EConstr.constr -> 'b) ->
'a ->
'b ->
EConstr.constr ->
'b
occur checks
val occur_var_indirectly :
Environ.env ->
Evd.evar_map ->
Names.Id.t ->
EConstr.constr ->
Names.GlobRef.t option
val occur_var_in_decl :
Environ.env ->
Evd.evar_map ->
Names.Id.t ->
EConstr.named_declaration ->
bool
val occur_vars_in_decl :
Environ.env ->
Evd.evar_map ->
Names.Id.Set.t ->
EConstr.named_declaration ->
bool
As occur_var
but assume the identifier not to be a section variable
val free_rels_and_unqualified_refs :
Evd.evar_map ->
EConstr.constr ->
Int.Set.t * Names.Id.Set.t
dependent m t
tests whether m
is a subterm of t
for visible vars only
Type assignment for metavariables
pop c
lifts by -1 the positive indexes in c
...
Substitution of an arbitrary large term. Uses equality modulo reduction of let
val replace_term_gen :
Evd.evar_map ->
(Evd.evar_map -> int -> EConstr.constr -> bool) ->
int ->
EConstr.constr ->
EConstr.constr ->
EConstr.constr
replace_term_gen eq arity e c
replaces matching subterms according to eq
by e
in c
. If arity
is non-zero applications of larger length are handled atomically.
subst_term d c
replaces d
by Rel 1
in c
val replace_term :
Evd.evar_map ->
EConstr.constr ->
EConstr.constr ->
EConstr.constr ->
EConstr.constr
replace_term d e c
replaces d
by e
in c
Alternative term equalities
val compare_constr_univ :
Environ.env ->
Evd.evar_map ->
(Conversion.conv_pb -> EConstr.constr -> EConstr.constr -> bool) ->
Conversion.conv_pb ->
EConstr.constr ->
EConstr.constr ->
bool
val constr_cmp :
Environ.env ->
Evd.evar_map ->
Conversion.conv_pb ->
EConstr.constr ->
EConstr.constr ->
bool
prod_applist
forall (x1:B1;...;xn:Bn), B
a1...an
val prod_applist_decls :
Evd.evar_map ->
int ->
EConstr.constr ->
EConstr.constr list ->
EConstr.constr
In prod_applist_decls n c args
, c
is supposed to have the form ∀Γ.c
with Γ
of length m
and possibly with let-ins; it returns c
with the assumptions of Γ
instantiated by args
and the local definitions of Γ
expanded. Note that n
counts both let-ins and prods, while the length of args
only counts prods. In other words, varying n
changes how many trailing let-ins are expanded.
Remove recursively the casts around a term i.e. strip_outer_cast (Cast (Cast ... (Cast c, t) ... ))
is c
.
nb_lam
$
x_1:T_1
...x_n:T_n
c $
where $
c $
is not an abstraction gives $
n $
(casts are ignored)
Similar to nb_lam
, but gives the number of products instead
Similar to nb_prod
, but zeta-contracts let-in on the way
Get the last arg of a constr intended to be an application
val adjust_app_list_size :
EConstr.constr ->
EConstr.constr list ->
EConstr.constr ->
EConstr.constr list ->
EConstr.constr * EConstr.constr list * EConstr.constr * EConstr.constr list
val adjust_app_array_size :
EConstr.constr ->
EConstr.constr array ->
EConstr.constr ->
EConstr.constr array ->
EConstr.constr * EConstr.constr array * EConstr.constr * EConstr.constr array
name contexts
Set of local names
val process_rel_context :
(EConstr.rel_declaration -> Environ.env -> Environ.env) ->
Environ.env ->
Environ.env
other signature iterators
val assums_of_rel_context :
('c, 't, 'r) Context.Rel.pt ->
((Names.Name.t, 'r) Context.pbinder_annot * 't) list
val map_rel_context_with_binders :
(int -> 'c -> 'c) ->
('c, 'c, 'r) Context.Rel.pt ->
('c, 'c, 'r) Context.Rel.pt
val map_rel_context_in_env :
(Environ.env -> Constr.constr -> Constr.constr) ->
Environ.env ->
Constr.rel_context ->
Constr.rel_context
val fold_named_context_both_sides :
('a -> Constr.named_declaration -> Constr.named_declaration list -> 'a) ->
Constr.named_context ->
init:'a ->
'a
val compact_named_context :
Evd.evar_map ->
EConstr.named_context ->
EConstr.compacted_context
val map_rel_decl :
('r1 -> 'r2) ->
('a -> 'b) ->
('a, 'a, 'r1) Context.Rel.Declaration.pt ->
('b, 'b, 'r2) Context.Rel.Declaration.pt
val map_named_decl :
('r1 -> 'r2) ->
('a -> 'b) ->
('a, 'a, 'r1) Context.Named.Declaration.pt ->
('b, 'b, 'r2) Context.Named.Declaration.pt
val global_vars_set_of_decl :
Environ.env ->
Evd.evar_map ->
EConstr.named_declaration ->
Names.Id.Set.t
val global_app_of_constr :
Evd.evar_map ->
EConstr.constr ->
(Names.GlobRef.t * EConstr.EInstance.t) * EConstr.constr option
val dependency_closure :
Environ.env ->
Evd.evar_map ->
EConstr.named_context ->
Names.Id.Set.t ->
Names.Id.t list
Gives an ordered list of hypotheses, closed by dependencies, containing a given set
Test if an identifier is the basename of a global reference
val global_of_constr :
Evd.evar_map ->
EConstr.constr ->
Names.GlobRef.t * EConstr.EInstance.t
Debug pretty-printers
val pr_evar_map_filter :
?with_univs:bool ->
(Evar.t -> Evd.any_evar_info -> bool) ->
Environ.env ->
Evd.evar_map ->
Pp.t