12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182(******************************************************************************)(* *)(* The Alt-Ergo theorem prover *)(* Copyright (C) 2006-2013 *)(* *)(* Sylvain Conchon *)(* Evelyne Contejean *)(* *)(* Francois Bobot *)(* Mohamed Iguernelala *)(* Stephane Lescuyer *)(* Alain Mebsout *)(* *)(* CNRS - INRIA - Universite Paris Sud *)(* *)(* This file is distributed under the terms of the Apache Software *)(* License version 2.0 *)(* *)(* ------------------------------------------------------------------------ *)(* *)(* Alt-Ergo: The SMT Solver For Software Verification *)(* Copyright (C) 2013-2018 --- OCamlPro SAS *)(* *)(* This file is distributed under the terms of the Apache Software *)(* License version 2.0 *)(* *)(******************************************************************************)[@@@ocaml.warning"-33"]openOptionsmoduletypeHASHED=sigtypeeltvaleq:elt->elt->boolvalhash:elt->intvalset_id:int->elt->eltvalinitial_size:intvaldisable_weaks:unit->boolendmoduletypeS=sigtypetvalmake:t->tvalelements:unit->tlistendmoduleMake(Hashed:HASHED):(Swithtypet=Hashed.elt)=structtypet=Hashed.eltmoduleHWeak=Weak.Make(structtypet=Hashed.eltletequal=Hashed.eqlethash=Hashed.hashend)letstorage=HWeak.createHashed.initial_sizeletretain_list=ref[]letnext_id=ref0letmaked=letd=Hashed.set_id!next_iddinleto=HWeak.mergestoragedinifo==dthenbeginincrnext_id;ifHashed.disable_weaks()then(* retain a pointer to 'd' to prevent the GC from collecting
the object if H.disable_weaks is set *)retain_list:=d::!retain_listend;oletelements()=letacc=ref[]inHWeak.iter(fune->acc:=e::!acc)storage;!accend