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) *)(************************************************************************)openNamesletscheme_map=Summary.refIndmap.empty~name:"Schemes"letcache_one_schemekind(ind,const)=scheme_map:=Indmap.updateind(function|None->Some(CString.Map.singletonkindconst)|Somemap->Some(CString.Map.addkindconstmap))!scheme_mapletcache_scheme(kind,l)=cache_one_schemekindlletsubst_one_schemesubst(ind,const)=(* Remark: const is a def: the result of substitution is a constant *)(Mod_subst.subst_indsubstind,Mod_subst.subst_constantsubstconst)letsubst_scheme(subst,(kind,l))=(kind,subst_one_schemesubstl)letinScheme:Libobject.locality*(string*(inductive*Constant.t))->Libobject.obj=letopenLibobjectindeclare_object@@object_with_locality"SCHEME"~cache:cache_scheme~subst:(Somesubst_scheme)~discharge:(funx->x)letdeclare_schemelocalkindindcl=Lib.add_leaf(inScheme(local,(kind,indcl)))letlookup_schemekindind=CString.Map.findkind(Indmap.findind!scheme_map)letall_schemes()=!scheme_map