1234567891011121314151617181920212223242526272829303132333435363738394041424344454647(**************************************************************************)(* 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). *)(* *)(**************************************************************************)moduleSentinel=Sva_sentinel(** Reduction between sentinels and {Ival}s. *)moduleReduce=structtypet1=Sentinel.bitvectortypet2=Sva_ival.bitvectorletreduce~size(sntl,ival)=letival_zero=Sva_ival.Bitvector_Forward.biconst~sizeZ.zeroin(* Reduce {ival} using {sentinel} *)letival=ifSentinel.is_zerosntlthenival_zeroelseivalin(* Reduce {sentinel} using {ival} *)letsntl=matchSva_ival.Bitvector_Forward.beq~sizeivalival_zerowith|Lattices.Quadrivalent.True->Sentinel.zero|Lattices.Quadrivalent.False->Sentinel.nonzero|_->sntlinsntl,ivalendmoduleIval_with_sentinel=Sva_reduced_prod.Make(Sentinel)(Sva_ival)(Reduce)includeIval_with_sentinel