12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667(****************************************************************************)(* *)(* 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/>. *)(* *)(****************************************************************************)(** Reduction rules for abstract evaluations *)openCore.All(** Manager used by simplified reduction rules *)type('a,'b)simplified_reduction_man={get_env:'t.'tid->'b->'t;set_env:'t.'tid->'t->'b->'b;get_value:'t.'tid->var->'b->'t;set_value:'t.'tid->var->'t->'b->'b;ask:'r.('a,'r)query->'actx->'b->'r;}(** Signature of simplified reduction rules *)moduletypeSIMPLIFIED_REDUCTION=sigvalname:stringvalreduce:stmt->('a,'b)simplified_reduction_man->'actx->'b->'b->'bend(** {2 Registration} *)(** **************** *)(** Registered simplified reductions *)letsimplified_reductions:(moduleSIMPLIFIED_REDUCTION)listref=ref[](** Register a new simplified reduction *)letregister_simplified_reductionrule=simplified_reductions:=rule::!simplified_reductions(** Find an simplified reduction by its name *)letfind_simplified_reductionname=List.find(funv->letmoduleV=(valv:SIMPLIFIED_REDUCTION)incompareV.namename=0)!simplified_reductionsletsimplified_reductions()=List.map(funv->letmoduleD=(valv:SIMPLIFIED_REDUCTION)inD.name)!simplified_reductions