123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657(************************************************************************)(* * 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) *)(************************************************************************)moduleD=Dyn.Make()type('raw,'glb)tag=('raw*'glb)D.tagletcreatename=D.createnameleteqt1t2=D.eqt1t2letreprtag=D.reprtagtypeany_tag=Any:_tag->any_tagletnames=(* magic: all tags are at tuple types *)D.names|>Option.map@@fun(D.Anyt)->Any(Obj.magict)typeraw=Raw:('raw,_)tag*'raw->rawtypeglb=Glb:(_,'glb)tag*'glb->glbmoduleRegister(M:sigtype('raw,'glb)tend)=structmoduleV=structtype_t=V:('raw,'glb)M.t->('raw*'glb)tendmoduleVMap=D.Map(V)letvals=refVMap.emptyletmemtag=VMap.memtag!valsletregistertagv=assert(not@@memtag);vals:=VMap.addtag(Vv)!valsletfind_opttag=tryletVv=VMap.findtag!valsinSomevwithNot_found->Noneletgettag=tryletVv=VMap.findtag!valsinvwithNot_found->assertfalseend