1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768(**************************************************************************)(* *)(* This file is part of WP plug-in of Frama-C. *)(* *)(* Copyright (C) 2007-2023 *)(* CEA (Commissariat a l'energie atomique et aux energies *)(* 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 licenses/LGPLv2.1). *)(* *)(**************************************************************************)(* -------------------------------------------------------------------------- *)(* --- Passive Forms --- *)(* -------------------------------------------------------------------------- *)openLangopenLang.Ftypebinding=|Bindofvar*var(* fresh , bound *)|Joinofvar*var(* left, right *)typet=bindinglistletempty=[]letis_emptyn=n=[]letunion=List.appendletbind~fresh~boundbs=Bind(fresh,bound)::bsletjoinxybs=ifVar.equalxythenbselseJoin(x,y)::bsleteqxy=F.p_equal(e_varx)(e_vary)letreccollectphihs=function|[]->hs|Bind(x,y)::bs->collectphi(ifphiytheneqxy::hselsehs)bs|Join(x,y)::bs->collectphi(ifphix||phiytheneqxy::hselsehs)bsletapplybindingsp=letxs=varsppinleths=collect(funx->Vars.memxxs)[]bindingsinp_conj(p::hs)letconditionsbindingsphi=collectphi[]bindingsletiter=List.iterletprettyfmt=List.iterbeginfunction|Bind(x,y)->Format.fprintffmt"@ @[%a:=%a@]"F.pp_varxF.pp_vary|Join(x,y)->Format.fprintffmt"@ @[%a==%a@]"F.pp_varxF.pp_varyend