Module Topped_set.Lift

Parameters

module Set : SET

Signature

exception TopError of string
type t
include Datatype_sig.PRINTABLE with type t := t
include Datatype_sig.SHOW with type t := t
val show : t -> string

String representation of type t

val pp : Stdlib.Format.formatter -> t -> unit

Output to formatter

val print : ?prefix:string -> t -> unit

Output to stdout.

val show_option : t option -> string
val print_option : ?prefix:string -> t option -> unit
val dump : string -> t -> unit

Dump to file given by filename

Lists of printable values

val show_list : ?separator:string -> t list -> string
val pp_list : Stdlib.Format.formatter -> t list -> unit
val print_list : ?separator:string -> ?prefix:string -> t list -> unit

Constructors

val top : t
val empty : t
val singleton : Set.elt -> t
val of_list : Set.elt list -> t
val is_concrete : t -> bool

Convertors

val elements : t -> Set.elt list
val add : Set.elt -> t -> t
val remove : Set.elt -> t -> t
val cardinal : t -> int
val cardinal_opt : t -> int option
val choose : t -> Set.elt

Binary operations

val union : t -> t -> t
val inter : t -> t -> t
val diff : t -> t -> t
val map : (Set.elt -> Set.elt) -> t -> t
val map2 : (Set.elt -> Set.elt -> Set.elt) -> t -> t -> t
val apply_partial_binop : (Set.elt -> Set.elt -> Set.elt option) -> t -> t -> t
val apply_partial_variadic_op : (Set.elt list -> Set.elt option) -> t list -> t
val cartesian_product : t -> t -> (Set.elt * Set.elt) list option

Predicates

val is_empty : t -> bool
val cardinal_geq : int -> t -> bool
val equal : t -> t -> bool