1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586(****************************************************************************)(* *)(* 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/>. *)(* *)(****************************************************************************)(** Engine for an automatic analysis without user interaction *)openCore.AllopenToplevelopenEngine_sigmoduleMake(Toplevel:TOPLEVEL):ENGINEwithtypet=Toplevel.t=structtypet=Toplevel.tletrecinitprog=Toplevel.initprogmanandanalyzestmtflow=Toplevel.execstmtmanflow|>post_to_flowmanandexec?(route=toplevel)stmtflow=Toplevel.exec~routestmtmanflowandeval?(route=toplevel)?(translate=any_semantic)?(translate_when=[])expflow=Toplevel.eval~route~translate~translate_whenexpmanflowandask:typer.?route:route->(Toplevel.t,r)query->Toplevel.tflow->(Toplevel.t,r)cases=fun?(route=toplevel)queryflow->Toplevel.ask~routequerymanflowandprint_expr?(route=toplevel)flowprinterexp=Toplevel.print_expr~routemanflowprinterexpandlattice:Toplevel.tlattice={bottom=Toplevel.bottom;top=Toplevel.top;is_bottom=Toplevel.is_bottom;subset=(functxaa'->Toplevel.subsetmanctxaa');join=(functxaa'->Toplevel.joinmanctxaa');meet=(functxaa'->Toplevel.meetmanctxaa');widen=(functxaa'->Toplevel.widenmanctxaa');merge=Toplevel.merge;print=Toplevel.print_state;}andman:(Toplevel.t,Toplevel.t)man={lattice;get=(funtkflow->letabs=Flow.gettklatticeflowinCases.singletonabsflow);set=(funtkabsflow->letflow=Flow.settkabslatticeflowinPost.returnflow);add_change=(funstmtpathflowchange_map->add_stmt_to_change_mapstmt(List.revpath)change_map);exec=exec;eval=eval;ask=ask;print_expr=print_expr;}end