package herdtools7

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Diet.IntSource

Sourcetype elt = int

The type of the set elements

Sourcetype interval

An interval: a range (x, y) of set values where all the elements from x to y inclusive are in the set

Sourcemodule Interval : sig ... end
Sourcetype t

The type of sets

Sourceval equal : t -> t -> bool

Equality over sets

Sourceval compare : t -> t -> int

Comparison over sets

Sourceval pp : Format.formatter -> t -> unit

Pretty-print a set

Sourceval empty : t

The empty set

Sourceval is_empty : t -> bool

Test whether a set is empty or not

Sourceval singleton : elt -> t

singleton x is the set containing just x.

Sourceval cardinal : t -> elt

cardinal t is the number of elements in the set t

Sourceval mem : elt -> t -> bool

mem elt t tests whether elt is in set t

Sourceval fold : (interval -> 'a -> 'a) -> t -> 'a -> 'a

fold f t acc folds f across all the intervals in t

Sourceval fold_individual : (elt -> 'a -> 'a) -> t -> 'a -> 'a

fold_individual f t acc folds f across all the individual elements of t

Sourceval filter_map_individual : (elt -> elt option) -> t -> t

filter_map_individual f t is the set of all f(x) for x in t.

Sourceval iter : (interval -> unit) -> t -> unit

iter f t iterates f across all the intervals in t

Sourceval add : interval -> t -> t

add interval t returns the set consisting of t plus interval

Sourceval remove : interval -> t -> t

remove interval t returns the set consisting of t minus interval

Sourceval min_elt : t -> elt

min_elt t returns the smallest (in terms of the ordering) element in t, or raises Not_found if the set is empty.

Sourceval max_elt : t -> elt

max_elt t returns the largest (in terms of the ordering) element in t, or raises Not_found if the set is empty.

Sourceval min_interval : t -> interval

min_interval t returns the smallest (in terms of the ordering) interval in t, or raises Not_found if the set is empty.

Sourceval max_interval : t -> interval

max_interval t returns the largest (in terms of the ordering) interval in t, or raises Not_found if the set is empty.

Sourceval choose : t -> interval

choose t returns one interval, or raises Not_found if the set is empty

Sourceval take : t -> elt -> (t * t) option

take n returns Some a, b where cardinal a = n and diff t a = b or None if cardinal t < n

Sourceval union : t -> t -> t

set union

Sourceval unions : t list -> t

Iterated set union.

Sourceval diff : t -> t -> t

set difference

Sourceval inter : t -> t -> t

set intersection

Sourceval subset : t -> t -> bool

subsets

Sourceval cross_filter_map_individual : (elt -> elt -> elt option) -> t -> t -> t

Cross product on all elements of sets

Sourceval find_next_gap : elt -> t -> elt

find_next_gap from t returns the next element that's absent in set t and greater than or equal to from *

Sourceval elements : t -> interval list

elements t returns the list of intervals in the set t.

Sourceval elements_individual : t -> elt list

elements_individual t returns the list of elements in the set t.

Sourceval of_list : elt list -> t

of_list li returns the set of elements in the list li.

OCaml

Innovation. Community. Security.