package coq-core
Install
    
    dune-project
 Dependency
Authors
Maintainers
Sources
md5=0cfaa70f569be9494d24c829e6555d46
    
    
  sha512=8ee967c636b67b22a4f34115871d8f9b9114df309afc9ddf5f61275251088c6e21f6cf745811df75554d30f4cebb6682f23eeb2e88b771330c4b60ce3f6bf5e2
    
    
  doc/coq-core.pretyping/Find_subterm/index.html
Module Find_subtermSource
Finding subterms, possibly up to some unification function, possibly at some given occurrences
A testing function is typically a unification function returning a substitution or failing with Error, together with a function to merge substitutions and an initial substitution; last_found is used for error messages and it has to be initialized with None.
type ('a, 'b) testing_function = {match_fun : int -> 'a -> EConstr.constr -> ('b, unit) Result.t;merge_fun : 'b -> 'a -> ('a, unit) Result.t;mutable testing_state : 'a;mutable last_found : Pretype_errors.position_reporting option;
}val make_eq_univs_test : 
  Environ.env ->
  Evd.evar_map ->
  EConstr.constr ->
  (Evd.evar_map, Evd.evar_map) testing_functionThis is the basic testing function, looking for exact matches of a closed term
val replace_term_occ_modulo : 
  Environ.env ->
  Evd.evar_map ->
  Locus.occurrences Locus.or_like_first ->
  ('a, 'b) testing_function ->
  (unit -> EConstr.constr) ->
  EConstr.constr ->
  EConstr.constrreplace_term_occ_modulo occl test mk c looks in c for subterm modulo a testing function test and replaces successfully matching subterms at the indicated occurrences occl with mk (); it turns an Error value returned by the merge_fun function into a SubtermUnificationError.
val replace_term_occ_decl_modulo : 
  Environ.env ->
  Evd.evar_map ->
  (Locus.occurrences * Locus.hyp_location_flag) Locus.or_like_first ->
  ('a, 'b) testing_function ->
  (unit -> EConstr.constr) ->
  EConstr.named_declaration ->
  EConstr.named_declarationreplace_term_occ_decl_modulo is similar to replace_term_occ_modulo but for a named_declaration.
val subst_closed_term_occ : 
  Environ.env ->
  Evd.evar_map ->
  Locus.occurrences Locus.or_like_first ->
  EConstr.constr ->
  EConstr.constr ->
  EConstr.constr * Evd.evar_mapsubst_closed_term_occ occl c d replaces occurrences of closed c at positions occl by Rel 1 in d (see also Note OCC), unifying universes which results in a set of constraints.
val subst_closed_term_occ_decl : 
  Environ.env ->
  Evd.evar_map ->
  (Locus.occurrences * Locus.hyp_location_flag) Locus.or_like_first ->
  EConstr.constr ->
  EConstr.named_declaration ->
  EConstr.named_declaration * Evd.evar_mapsubst_closed_term_occ_decl evd occl c decl replaces occurrences of closed c at positions occl by Rel 1 in decl.