1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071(**************************************************************************)(* *)(* 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). *)(* *)(**************************************************************************)openSigsmoduleMake(M:Sigs.Model)(L:Sigs.LogicSemanticswithmoduleM=M)=structmoduleM=MmoduleL=LopenMmoduleD=Heap.Set(* -------------------------------------------------------------------------- *)(* --- Domain --- *)(* -------------------------------------------------------------------------- *)letdslocobj=function|Slocl|Sdescr(_,l,_)->M.domainobjl|Srange(l,obj,_,_)|Sarray(l,obj,_)->M.domainobjlletdomain(r:locSigs.region)=List.fold_left(fund(obj,sloc)->D.uniond(dslocobjsloc))D.emptyr(* -------------------------------------------------------------------------- *)(* --- Assignation --- *)(* -------------------------------------------------------------------------- *)letrecassigned_seqhss=function|[]->Bag.concat(M.Sigma.assigned~pre:s.pre~post:s.postD.empty)hs|[obj,sloc]->leteq_sloc=M.assignedsobjslocinleths_sloc=Bag.list(List.mapCvalues.equationeq_sloc)inleths_sdom=M.Sigma.assigned~pre:s.pre~post:s.post(dslocobjsloc)inBag.concat(Bag.concaths_slochs_sdom)hs|(obj,sloc)::tail->letsigma=M.Sigma.havocs.post(dslocobjsloc)inlets_local={pre=sigma;post=s.post}inlets_other={pre=s.pre;post=sigma}inleteq_sloc=M.assigneds_localobjslocinleths_sloc=Bag.list(List.mapCvalues.equationeq_sloc)inassigned_seq(Bag.concaths_slochs)s_othertailletapply_assigns(s:sigmasequence)(r:M.locSigs.region)=Bag.elements(assigned_seqBag.emptysr)end