123456789101112131415161718192021222324252627282930313233343536373839404142434445464748(******************************************************************************)(* *)(* Sek *)(* *)(* Arthur Charguéraud, Émilie Guermeur and François Pottier *)(* *)(* Copyright Inria. All rights reserved. This file is distributed 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, as described in the file LICENSE. *)(* *)(******************************************************************************)openPrivateSignatures(* [Front], [Back] *)letis_valid(a,i,k)=0<=k&&0<=i&&i+k<=Array.lengthaletis_empty(_,_,k)=k=0let[@inline]iterpov((a,i,k)asseg)yield=assert(is_validseg);matchpovwith|Front->forj=itoi+k-1doyielda.(j)done|Back->forj=i+k-1downtoidoyielda.(j)donelet[@inline]iter2pov((a1,i1,k1)asseg1)((a2,i2,k2)asseg2)yield=assert(is_validseg1);assert(is_validseg2);assert(k1=k2);letk=k1inmatchpovwith|Front->forj=0tok-1doyielda1.(i1+j)a2.(i2+j)done|Back->forj=k-1downto0doyielda1.(i1+j)a2.(i2+j)done