123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657(****************************************************************************)(* *)(* 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/>. *)(* *)(****************************************************************************)(** Eval - abstract evaluations of expressions *)openAst.StmtopenAst.ExpropenTokenopenFlowopenContextopenCasesopenChangeopenAst.SemanticopenMopsa_utilstype'aeval=('a,expr)casesincludeCasesletsingleton?(changes=empty_change_map)?(cleaners=[])?(translations=[])eflow=lete'=List.fold_left(funacc(s,ee)->add_expr_translationseeacc)etranslationsinCases.singleton~changes~cleanerse'flowletadd_translationsemanticeevl=Cases.map_result(add_expr_translationsemantice)evlletprintfmt(evl:'aeval):unit=Cases.print_result(funfmteflow->pp_exprfmte)fmtevlletremove_duplicateslatticeevl=Cases.remove_duplicate_results~equal:(fune1e2->(* Compare the expressions and their translations *)0=Compare.paircompare_expr(SemanticMap.comparecompare_expr)(e1,e1.etrans)(e2,e2.etrans))latticeevl