123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111(**************************************************************************)(* This file is part of the Codex semantics library. *)(* *)(* Copyright (C) 2013-2025 *)(* CEA (Commissariat à l'énergie atomique et aux énergies *)(* alternatives) *)(* *)(* 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, version 2.1. *)(* *)(* It 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. *)(* *)(* See the GNU Lesser General Public License version 2.1 *)(* for more details (enclosed in the file LICENSE). *)(* *)(**************************************************************************)moduleLog=Tracelog.Make(structletcategory="Single_value_abstraction.Noop"end);;(* TODO: backward transfer functions from usage of the inverse
function + inter. E.g. use - when there was a +, etc. *)moduleStringSet=Set.Make(structtypet=stringletcompare=compareend)letpast_warnings=refStringSet.emptyletwarn_oncewhat=ifnot(StringSet.memwhat!past_warnings)thenbeginpast_warnings:=StringSet.addwhat!past_warnings;Log.warning(funp->p"No backpropagation for '%s'"what)endmoduleInteger_Backward=structletassume___=warn_once"assume";(None,None)letiunknown__=warn_once"iunknown";(None)letimod___=warn_once"imod";(None,None)letidiv___=warn_once"idiv";(None,None)letimul___=warn_once"imul";(None,None)letiadd___=warn_once"iadd";(None,None)letitimesk__=warn_once"itimes";Noneletige0__=warn_once"ige0";Noneletieq0__=warn_once"ieq0";Noneletishl___=warn_once"ishl";(None,None)letishr___=warn_once"ishr";(None,None)letiand___=warn_once"iand";(None,None)letior___=warn_once"ior";(None,None)letixor___=warn_once"ixor";(None,None)endmoduleBitvector_Backward=structletbeq~size___=warn_once"beq";(None,None)letbiule~size___=warn_once"biule";(None,None)letbisle~size___=warn_once"bisle";(None,None)letbitimes~size___=warn_once"bitimes";Noneletbiadd~size~nsw~nuw~nusw___=warn_once"biadd";(None,None)letbisub~size~flags___=warn_once"bisub";(None,None)letbimul~size~flags___=warn_once"bimul";(None,None)letbxor~size___=warn_once"bxor";(None,None)letband~size___=warn_once"band";(None,None)letbor~size___=warn_once"bor";(None,None)letnondet~sizelresult=warn_once"nondet";List.map(fun_->None)lletassume~size_cond_store_result=warn_once"assume";(None,None)letbsext~size~oldsize__=warn_once"bsext";(None)letbuext~size~oldsize__=warn_once"buext";(None)letbofbool~size__=warn_once"bofbool";(None)letbashr~size___=warn_once"bashr";(None,None)letblshr~size___=warn_once"blshr";(None,None)letbshl~size~flags___=warn_once"bshl";(None,None)letbisdiv~size___=warn_once"bisdiv";(None,None)letbiudiv~size___=warn_once"biudiv";(None,None)letbconcat~size1~size2ab_=warn_once"bconcat";(None,None)letbismod~size___=warn_once"bismod";(None,None)letbiumod~size___=warn_once"biumod";(None,None)letbextract~size~index~oldsize__=warn_once"bextract";(None)letvalid~size___=warn_once"valid";(None)letvalid_ptr_arith~size____=warn_once"valid_ptr_arith";(None,None)letbshift~size~offset~max__=warn_once"bshift";(None)letbindex~size__k__=warn_once"bindex";(None,None)endmoduleBlock_Forward=structletsizeof_=assertfalseletconcat_=assertfalseletload~size_=assertfalseletstore~size_=assertfalseletbinary_to_block~size_=assertfalseendmoduleBlock_Backward=Block_Forward;;moduleMemory_Forward=structletvar_=assertfalseletnondet_=assertfalseletassume_=assertfalseletstore~size_=assertfalseletmemcpy~size_=assertfalseletload~size_=assertfalseletload_block_=assertfalseletstore_block_=assertfalseletbuiltin_=assertfalseletmalloc~id~malloc_size=assertfalseletfree_=assertfalseletunknown~level=assertfalseendmoduleMemory_Backward=Memory_Forward;;