12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152(************************************************************************)(* * 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:string->'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.tagletfield=Dyn.createletempty=Map.emptyletsetsfv=Map.addfvsletgetsf=trySome(Map.findfs)withNot_found->Noneletremovesf=Map.removefsletmerges1s2=Map.fold(fun(Map.Any(f,v))s->Map.addfvs)s1s2end