12345678910111213141516171819202122232425262728293031323334353637383940414243(************************************************************************)(* * 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) *)(************************************************************************)openLibobjectopenStructuresletopen_canonical_structurei(o,_)=letenv=Global.env()inletsigma=Evd.from_envenvinifInt.equali1thenInstance.registerenvsigma~warn:falseoletcache_canonical_structure(o,_)=letenv=Global.env()inletsigma=Evd.from_envenvinInstance.register~warn:trueenvsigmaoletdischarge_canonical_structure(x,local)=letgref=Instance.reprxiniflocal||(Globnames.isVarRefgref&&Lib.is_in_sectiongref)thenNoneelseSome(x,local)letcanon_cat=create_category"canonicals"letinCanonStruc:Instance.t*bool->obj=declare_object{(default_object"CANONICAL-STRUCTURE")withopen_function=simple_open~cat:canon_catopen_canonical_structure;cache_function=cache_canonical_structure;subst_function=(fun(subst,(c,local))->Instance.substsubstc,local);classify_function=(funx->Substitute);discharge_function=discharge_canonical_structure}letadd_canonical_structurex=Lib.add_leaf(inCanonStrucx)letdeclare_canonical_structure?(local=false)ref=letenv=Global.env()inletsigma=Evd.from_envenvinadd_canonical_structure(Instance.makeenvsigmaref,local)