1234567891011121314151617181920212223242526272829303132333435363738394041424344(************************************************************************)(* * The Coq Proof Assistant / The Coq 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)=letmap=tryIndmap.findind!scheme_mapwithNot_found->CString.Map.emptyinscheme_map:=Indmap.addind(CString.Map.addkindconstmap)!scheme_mapletcache_scheme(kind,l)=Array.iter(cache_one_schemekind)lletsubst_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,CArray.Smart.map(subst_one_schemesubst)l)letdischarge_scheme(kind,l)=Some(kind,l)letinScheme:string*(inductive*Constant.t)array->Libobject.obj=letopenLibobjectindeclare_object@@superglobal_object"SCHEME"~cache:cache_scheme~subst:(Somesubst_scheme)~discharge:discharge_schemeletdeclare_schemekindindcl=Lib.add_leaf(inScheme(kind,indcl))letlookup_schemekindind=CString.Map.findkind(Indmap.findind!scheme_map)letall_schemes()=Indmap.domain!scheme_map