1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556(************************************************************************)(* * 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) *)(************************************************************************)(** This module implements an "untyped store", in this particular case
we see it as an extensible record whose fields are left
unspecified. ***)(** We use a dynamic "name" allocator. But if we needed to serialise
stores, we might want something static to avoid troubles with
plugins order. *)moduletypeS=sigtypettype'afieldvalfield:unit->'afieldvalempty:tvalset:t->'afield->'a->tvalget:t->'afield->'aoptionvalremove:t->'afield->tvalmerge:t->t->tendmoduleMake():S=structmoduleDyn=Dyn.Make()moduleMap=Dyn.Map(structtype'at='aend)typet=Map.ttype'afield='aDyn.tagletnext=ref0letfield()=letf=Dyn.anonymous!nextinincrnext;fletempty=Map.emptyletsetsfv=Map.addfvsletgetsf=trySome(Map.findfs)withNot_found->Noneletremovesf=Map.removefsletmerges1s2=Map.fold(fun(Map.Any(f,v))s->Map.addfvs)s1s2end