Frama-C API - Bag
List with constant-time concat operation.
val empty : 'a tval elt : 'a -> 'a tval list : 'a list -> 'a tval iter : ('a -> unit) -> 'a t -> unitval fold_left : ('b -> 'a -> 'b) -> 'b -> 'a t -> 'bval fold_right : ('a -> 'b -> 'b) -> 'a t -> 'b -> 'bval find : ('a -> bool) -> 'a t -> 'aval find_opt : ('a -> bool) -> 'a t -> 'a optionval find_map : ('a -> 'b option) -> 'a t -> 'b optionfind_map f b: finds the first element x of the bag such that f x returns Some y, and returns Some y. If no such element exists, returns None.
val exists : ('a -> bool) -> 'a t -> boolval for_all : ('a -> bool) -> 'a t -> boolval length : 'a t -> intval is_empty : 'a t -> boolval singleton : 'a t -> 'a optionval elements : 'a t -> 'a listMight have n^2 complexity in worst cases. It might be better to use a Vector to reach linear complexity.
val sort : ('a -> 'a -> int) -> 'a t -> 'a listThe returned list preserves duplicates and order of equals elements. Uses Merge Sort (from standard List module), but might have n^2 complexity in worst cases. It might be better to use a Vector to reach linear complexity.
