12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970(**************************************************************************)(* *)(* This file is part of WP plug-in of Frama-C. *)(* *)(* Copyright (C) 2007-2025 *)(* 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). *)(* *)(**************************************************************************)openMemorymoduleMake(M:Memory.Model)(L:Memory.LogicSemanticswithmoduleM=M)=structmoduleM=MmoduleL=LmoduleD=Sigma.Domain(* -------------------------------------------------------------------------- *)(* --- Domain --- *)(* -------------------------------------------------------------------------- *)letdslocobj=function|Slocl|Sdescr(_,l,_)->M.domainobjl|Srange(l,obj,_,_)|Sarray(l,obj,_)->M.domainobjlletdomain(r:L.locMemory.region)=List.fold_left(fund(obj,sloc)->D.uniond(dslocobjsloc))D.emptyr(* -------------------------------------------------------------------------- *)(* --- Assignation --- *)(* -------------------------------------------------------------------------- *)letrecassigned_seqhss=function|[]->Bag.concat(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=Sigma.assigned~pre:s.pre~post:s.post(dslocobjsloc)inBag.concat(Bag.concaths_slochs_sdom)hs|(obj,sloc)::tail->letsigma=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:Sigma.sigmasequence)(r:M.locMemory.region)=Bag.elements(assigned_seqBag.emptysr)end