1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465(****************************************************************************)(* *)(* 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 reduction rules *)type'aeval_reduction_man={get_man:'t.'tid->('a,'t)man;(** Get the manger of a domain *)}moduletypeEVAL_REDUCTION=sigvalname:string(** Name of the reduction rule *)valreduce:expr->('a,'b)man->'aeval_reduction_man->'aflow->exprlist->'aflow->'aevaloption(** [reduce e results man input_flow output_flow] reduces a product evaluation *)end(** {2 Registration} *)(** **************** *)(** Registered eval reductions *)leteval_reductions:(moduleEVAL_REDUCTION)listref=ref[](** Register a new eval reduction *)letregister_eval_reductionrule=eval_reductions:=rule::!eval_reductions(** Find an eval reduction by its name *)letfind_eval_reductionname=List.find(funv->letmoduleV=(valv:EVAL_REDUCTION)incompareV.namename=0)!eval_reductionsleteval_reductions()=List.map(funv->letmoduleD=(valv:EVAL_REDUCTION)inD.name)!eval_reductions