12345678910111213141516171819202122232425262728293031323334353637383940414243(************************************************************************)(* * The Rocq Prover / The Rocq Development Team *)(* v * Copyright INRIA, CNRS and contributors *)(* <O___,, * (see version control and CREDITS file for authors & dates) *)(* \VV/ **************************************************************)(* // * This file is distributed under the terms of the *)(* * GNU Lesser General Public License Version 2.1 *)(* * (see LICENSE file for the text of the license) *)(************************************************************************)openGenarg(** Substitution functions *)type'glbsubst_fun=Mod_subst.substitution->'glb->'glbmoduleSubstObj=structtype('raw,'glb,'top)obj='glbsubst_funletname="subst"letdefault_=NoneendmoduleSubst=Register(SubstObj)letsubstitute=Subst.objletregister_subst0=Subst.register0letgeneric_substitutesubs(GenArg(Glbwitwit,v))=in_gen(glbwitwit)(substitutewitsubsv)moduleCSubstObj=structtype(_,'g)t='gsubst_funendmoduleCSubst=GenConstr.Register(CSubstObj)letregister_constr_subst=CSubst.registerletconstr_substsubst(GenConstr.Glb(tag,v)aso)=letsubstf=CSubst.gettaginletv'=substfsubstvinifv==v'thenoelseGenConstr.Glb(tag,v')