123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116(****************************************************************************)(* *)(* This file is part of MOPSA, a Modular Open Platform for Static Analysis. *)(* *)(* Copyright (C) 2017-2019 The MOPSA Project. *)(* *)(* This program is free software: 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, either version 3 of the License, or *)(* (at your option) any later version. *)(* *)(* This program 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. *)(* *)(* You should have received a copy of the GNU Lesser General Public License *)(* along with this program. If not, see <http://www.gnu.org/licenses/>. *)(* *)(****************************************************************************)(** Extended domains signatures used by combiners *)openCore.AllopenAbstraction.DomainmoduletypeDOMAIN_COMBINER=sigincludeDOMAINvaldomains:DomainSet.tvalsemantics:SemanticSet.tvalrouting_table:routing_tablevalsubset:('a,t)man->'actx->t*'a->t*'a->boolvaljoin:('a,t)man->'actx->t*'a->t*'a->tvalmeet:('a,t)man->'actx->t*'a->t*'a->tvalwiden:('a,t)man->'actx->t*'a->t*'a->tvalmerge:path->t->t*change_map->t*change_map->tvalexec:DomainSet.toption->stmt->('a,t)man->'aflow->'apostoptionvaleval:DomainSet.toption->expr->('a,t)man->'aflow->'aevaloptionvalask:DomainSet.toption->('a,'r)query->('a,t)man->'aflow->('a,'r)casesoptionvalprint_state:DomainSet.toption->printer->t->unitvalprint_expr:DomainSet.toption->('a,t)man->'aflow->printer->expr->unitendmoduleDomainToCombiner(D:DOMAIN):DOMAIN_COMBINERwithtypet=D.t=structincludeDletdomains=DomainSet.singletonD.nameletsemantics=SemanticSet.emptyletrouting_table=empty_routing_tableletsubset__(a,_)(a',_)=D.subsetaa'letjoin__(a,_)(a',_)=D.joinaa'letmeet__(a,_)(a',_)=D.meetaa'letwiden_ctx(a,_)(a',_)=D.widenctxaa'letmergepathpre(a1,m1)(a2,m2)=lete1=get_changepathm1inlete2=get_changepathm2inifcompare_changee1e2=0thena1elseifis_empty_changee1thena2elseifis_empty_changee2thena1elseD.mergepre(a1,e1)(a2,e2)letexectargets=D.execletevaltargets=D.evalletasktargets=D.askletprint_statetargets=D.print_stateletprint_exprtargets=D.print_exprendmoduleStandardToStacked(D:DOMAIN_COMBINER):Stacked.STACKED_COMBINERwithtypet=D.t=structincludeDletsubsetmanctx((a,s)asx)((a',s')asx')=ifa==a'thentrue,s,s'elseD.subsetmanctxxx',s,s'letjoinmanctx((a,s)asx)((a',s')asx')=ifa==a'thena,s,s'elseD.joinmanctxxx',s,s'letmeetmanctx((a,s)asx)((a',s')asx')=ifa==a'thena,s,s'elseD.meetmanctxxx',s,s'letwidenmanctx((a,s)asx)((a',s')asx')=ifa==a'thena,s,s',trueelseD.widenmanctxxx',s,s',trueendmoduleStackedToStandard(D:Stacked.STACKED_COMBINER):DOMAIN_COMBINERwithtypet=D.t=structincludeDletsubsetmanctxaa'=letb,_,_=D.subsetmanctxaa'inbletjoinmanctxaa'=leta,_,_=D.joinmanctxaa'inaletmeetmanctxaa'=leta,_,_=D.meetmanctxaa'inaletwidenmanctxaa'=leta,_,_,_=D.widenmanctxaa'inaend