Sets of abstract types whose content cannot be inspected. An abstract type represents the whole sets of its values, and does not provide any way to represent subsets. These abstract types behave like atoms and are used to represent e.g. OCaml types such as float.
Contrary to other sets of values, it is not possible to represent propre subsets of abstract types. Therefore, the "elements" of the set represented by the type t are only strings representing the whole abstract type by its name (e.g. "float").
One can therefore represent the set of all abstract values that do not contain any float, as diff any (atom "float") but cannot represent a singleton set containing a particular individual float.
include Cduce_types.Tset.S with type elem = T.t include Cduce_types.Tset.Tset_base type elemThe type of the values in the set
The type of the set, with mandatory custom operations.
include Custom.T type tval dump : Stdlib.Format.formatter -> t -> unitval check : t -> unitval equal : t -> t -> boolval hash : t -> intval compare : t -> t -> intval empty : t The empty set
val any : t The full set, containing all possible values for this kind.
val atom : elem -> t atom e creates a singleton set containing element e.
val cup : t -> t -> t cup t1 t2 returns the unions of t1 and t2.
val cap : t -> t -> t cap t1 t2 returns the intersection of t1 and t2.
val diff : t -> t -> t diff t1 t2 returns the set of elements of t1 not in t2.
val neg : t -> t neg t returns the set diff any t.
module Infix : sig ... end val is_empty : t -> boolis_empty t checks wheter t is the empty set.
val contains : elem -> t -> boolcontains s t checks whether the type label s belongs to t
val disjoint : t -> t -> booldisjoint t1 t2 checks whether t1 and t2 have an empty intersection.
val sample : t -> elem optionsample t returns a sample for t. If t is not finite, returns None. If t is finite and non empty, returns one of its elements.
raises [Not_found] if t is empty.
val contains_sample : elem option -> t -> boolcontains_sample s t checks whether the given sample represents an element of t.
val print : t -> (Stdlib.Format.formatter -> unit) listprint t returns a list of functions that can print the combination of abstract types in t. Each abstract typename is prefixed by ! to differenciate it from a type identifier. If t is any, the set is simply printed as Abstract.