| 1 | (************************************************************************) |
| 2 | (* * The Rocq Prover / The Rocq Development Team *) |
| 3 | (* v * Copyright INRIA, CNRS and contributors *) |
| 4 | (* <O___,, * (see version control and CREDITS file for authors & dates) *) |
| 5 | (* \VV/ **************************************************************) |
| 6 | (* // * This file is distributed under the terms of the *) |
| 7 | (* * GNU Lesser General Public License Version 2.1 *) |
| 8 | (* * (see LICENSE file for the text of the license) *) |
| 9 | (************************************************************************) |
| 10 | |
| 11 | open Genarg |
| 12 | |
| 13 | (** Substitution functions *) |
| 14 | type 'glb subst_fun = Mod_subst.substitution -> 'glb -> 'glb |
| 15 | |
| 16 | module SubstObj = |
| 17 | struct |
| 18 | type ('raw, 'glb, 'top) obj = 'glb subst_fun |
| 19 | let name = "subst" |
| 20 | let default _ = None |
| 21 | end |
| 22 | |
| 23 | module Subst = Register (SubstObj) |
| 24 | |
| 25 | let substitute = Subst.obj |
| 26 | let register_subst0 = Subst.register0 |
| 27 | |
| 28 | let generic_substitute subs (GenArg (Glbwit wit, v)) = |
| 29 | in_gen (glbwit wit) (substitute wit subs v) |