package lrgrep
Module Utils.IntSetSource
include S with type element = int
include SetSig.S1 with type 'a element := element and type 'a t := t
Decomposing sets
These functions implements the Refine.DECOMPOSABLE interface. We cannot reference it here as Refine is implemented using bitsets, that would create a reference cycle.
Split a set into consecutive “runs” of elements that share the same class.
Parameters
cls : 'a element → 'b elementthat assigns a class to each element.xs : 'a t– the input set to be split.
Returns A list of pairs. Each pair is made of a class (the result of cls for the run) and the subset of the original elements that belong to that run (preserving the original order).