package coq-core

  1. Overview
  2. Docs
The Coq Proof Assistant -- Core Binaries and Tools

Install

Dune Dependency

Authors

Maintainers

Sources

coq-8.18.0.tar.gz
md5=8d852367b54f095d9fbabd000304d450
sha512=46922d5f2eb6802a148a52fd3e7f0be8370c93e7bc33cee05cf4a2044290845b10ccddbaa306f29c808e7c5019700763e37e45ff6deb507b874a4348010fed50

doc/coq-core.pretyping/Find_subterm/index.html

Module Find_subtermSource

Finding subterms, possibly up to some unification function, possibly at some given occurrences

Sourceexception SubtermUnificationError of Pretype_errors.subterm_unification_error

A testing function is typically a unification function returning a substitution or failing with a NotUnifiable 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.

Sourcetype 'a testing_function = {
  1. match_fun : 'a -> EConstr.constr -> 'a;
  2. merge_fun : 'a -> 'a -> 'a;
  3. mutable testing_state : 'a;
  4. mutable last_found : Pretype_errors.position_reporting option;
}

This is the basic testing function, looking for exact matches of a closed term

replace_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 a NotUnifiable exception raised by the testing function into a SubtermUnificationError.

replace_term_occ_decl_modulo is similar to replace_term_occ_modulo but for a named_declaration.

subst_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.

subst_closed_term_occ_decl evd occl c decl replaces occurrences of closed c at positions occl by Rel 1 in decl.

OCaml

Innovation. Community. Security.