1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586(* This file is free software, part of Archsat. See file "LICENSE" for more details. *)(* Arbitrary tags for expressions. *)(* Functor instantiation *)(* ************************************************************************ *)(* Key info *)type'ainfo={print:'aPretty.print;}moduleM=Hmap.Make(structtype'at='ainfoend)(* Types and key creation *)(* ************************************************************************ *)typemap=M.ttype'at='aM.keyletinfok=M.Key.infokletcreate?(print=Pretty.Ignore)()=letinfo={print;}inM.Key.createinfo(* Iteration *)(* ************************************************************************ *)typebinding=M.binding=B:'at*'a->bindingletitermf=M.iterfmletfoldmaccf=M.foldfmacc(* small wrappers *)(* ************************************************************************ *)letempty=M.emptyletis_empty=M.is_emptyletgetmk=M.findkmletunsetmk=M.remkmletsetmkl=M.addklm(* convenient wrappers for advanced tags *)(* ************************************************************************ *)letget_listmk=matchgetmkwith|None->[]|Somel->lletget_lastmk=matchgetmkwith|None->None|Some[]->None|Some(x::_)->Somexletset_optmk=function|None->m|Somev->setmkvletaddmkv=setmk(v::get_listmk)letadd_optmk=function|None->m|Somev->addmkvletadd_listmk=function|[]->m|l->setmk(List.rev_appendl(get_listmk))