123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174(**************************************************************************)(* *)(* This file is part of WP plug-in of Frama-C. *)(* *)(* Copyright (C) 2007-2023 *)(* CEA (Commissariat a l'energie atomique et aux energies *)(* alternatives) *)(* *)(* you can redistribute it and/or modify it under the terms of the GNU *)(* Lesser General Public License as published by the Free Software *)(* Foundation, version 2.1. *)(* *)(* It is distributed in the hope that it will be useful, *)(* but WITHOUT ANY WARRANTY; without even the implied warranty of *)(* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *)(* GNU Lesser General Public License for more details. *)(* *)(* See the GNU Lesser General Public License version 2.1 *)(* for more details (enclosed in the file licenses/LGPLv2.1). *)(* *)(**************************************************************************)(* -------------------------------------------------------------------------- *)(* --- Aggregation of MergeMap and MergeSet --- *)(* -------------------------------------------------------------------------- *)moduletypeT=sigtypetvalhash:t->intvalequal:t->t->boolvalcompare:t->t->intendmoduletypeMap=sigtypekeytype'atvalempty:'atvaladd:key->'a->'at->'atvalmem:key->'at->boolvalfind:key->'at->'avalfindk:key->'at->key*'avalsize:'at->intvalis_empty:'at->bool(** [insert (fun key v old -> ...) key v map] *)valinsert:(key->'a->'a->'a)->key->'a->'at->'atvalchange:(key->'b->'aoption->'aoption)->key->'b->'at->'atvalmap:('a->'b)->'at->'btvalmapi:(key->'a->'b)->'at->'btvalmapf:(key->'a->'boption)->'at->'btvalmapq:(key->'a->'aoption)->'at->'atvalfilter:(key->'a->bool)->'at->'atvalpartition:(key->'a->bool)->'at->'at*'atvaliter:(key->'a->unit)->'at->unitvalfold:(key->'a->'b->'b)->'at->'b->'bvaliter_sorted:(key->'a->unit)->'at->unitvalfold_sorted:(key->'a->'b->'b)->'at->'b->'bvalunion:(key->'a->'a->'a)->'at->'at->'atvalinter:(key->'a->'b->'c)->'at->'bt->'ctvalinterf:(key->'a->'b->'coption)->'at->'bt->'ctvalinterq:(key->'a->'a->'aoption)->'at->'at->'atvaldiffq:(key->'a->'a->'aoption)->'at->'at->'atvalsubset:(key->'a->'b->bool)->'at->'bt->boolvalequal:('a->'a->bool)->'at->'at->boolvaliterk:(key->'a->'b->unit)->'at->'bt->unitvaliter2:(key->'aoption->'boption->unit)->'at->'bt->unitvalmerge:(key->'aoption->'boption->'coption)->'at->'bt->'cttypedomainvaldomain:'at->domainendmoduletypeSet=sigtypeelttypetvalempty:tvaladd:elt->t->tvalsingleton:elt->tvalelements:t->eltlistvalis_empty:t->boolvalmem:elt->t->boolvaliter:(elt->unit)->t->unitvalfold:(elt->'a->'a)->t->'a->'avalfilter:(elt->bool)->t->tvalpartition:(elt->bool)->t->t*tvalfor_all:(elt->bool)->t->boolvalexists:(elt->bool)->t->boolvaliter_sorted:(elt->unit)->t->unitvalfold_sorted:(elt->'a->'a)->t->'a->'avalunion:t->t->tvalinter:t->t->tvaldiff:t->t->tvalsubset:t->t->boolvalintersect:t->t->boolvalof_list:eltlist->ttype'amappingvalmapping:(elt->'a)->t->'amappingendmoduletypeS=sigtypettypesettype'amapvalhash:t->intvalequal:t->t->boolvalcompare:t->t->intmoduleMap:Mapwithtype'at='amapandtypekey=tandtypedomain=setmoduleSet:Setwithtypet=setandtypeelt=tandtype'amapping='amapendmoduleMake(A:T)=structtypet=A.ttypeset=A.tlistIntmap.ttype'amap=(A.t*'a)listIntmap.tlethash=A.hashletequal=A.equalletcompare=A.comparemoduleMap_i=Mergemap.Make(A)moduleSet_i=Mergeset.Make(A)moduleMap=structincludeMap_itypedomain=setletdomainm=Intmap.map(List.mapfst)mendmoduleSet=structincludeSet_itype'amapping='amapletmappingfm=Intmap.map(List.map(funk->k,fk))mendend