1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889(****************************************************************************)(* *)(* 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/>. *)(* *)(****************************************************************************)(** Fallback transfer functions *)openMopsaopenSig.Abstraction.StatelessopenUniversal.AstopenAstopenAlarmsmoduleDomain=structincludeGenStatelessDomainId(structletname="stubs.iterators.fallback"end)letchecks=[]letinitprogmanflow=Noneletaskquerymanflow=Noneletprint_exprmanflowprinterexp=()letopt_stub_use_forall_loop_eval=reffalse(** Use fallback evaluation of ∀ formulas with loops *)let()=register_builtin_option{key="-stub-use-forall-loop-evaluation";doc=" use the fallback evaluation of universally quantified formulas with loops";category="Stubs";spec=Setopt_stub_use_forall_loop_eval;default="";}letexec_assume_quantsquantscondrangemanflow=letreciter=function|[]->mk_assumecondrange|(EXISTS,_,_)::tl->itertl|(FORALL,_,_)::tlwhennot!opt_stub_use_forall_loop_eval->itertl|(FORALL,i,S_interval(a,b))::tl->letii=mk_varirangeinmk_block[mk_assigniiarange;mk_while(leiibrange)(mk_block[itertl;mk_assignii(addiionerange)range]range)range]range|(_,_,S_resource_)::tl->assertfalseinletstmt=iterquantsinman.execstmtflowleteval_quantified_formulaquantscondrangemanflow=letetrue=exec_assume_quantsquantscondrangemanflow>>%funflow->Eval.singleton(mk_truerange)flowinletnquants,ncond=negate_stub_quantified_formulaquantscondinletefalse=exec_assume_quantsnquantsncondrangemanflow>>%funflow->Eval.singleton(mk_falserange)flowinEval.joinetrueefalseletevalexpmanflow=matchekindexpwith|E_stub_quantified_formula(quants,cond)->eval_quantified_formulaquantscondexp.erangemanflow|>OptionExt.return|_->Noneletexecstmtmanflow=Noneendlet()=register_stateless_domain(moduleDomain)