Module Sstt.Tuples

Tuple components.

type t

Tuples are a family of components indexed by an integer (the arity of the tuple). Type t represents sets finite or co-finite sets of tuple components of distinct arities. For instance, it can represent the type of all tuples execpt those of arity 2 and 4.

Basics

A compononet family is a set of components indexed by a values. For instances, tuples constitute a family of components indexed by their size. For instance, 3-tuples and 4-tuples behave similarly, but are distinct components that cannot be mixed (their intersection is empty).

val any : t

The top element of t (the set of all values of type t).

val empty : t

The bottom element of t (the empty set of values of type t).

val compare : t -> t -> int

Comparison working on the internal representation of t.

val equal : t -> t -> bool

Equality, equal a b is equivalent to compare a b = 0.

Indexed component and misc. operations

val mk : Comp.Atom.t -> t
val mk_comp : Comp.t -> t
val components : t -> Comp.t list * bool

components t returns a pair (cs,b) where cs are the tuple components explicitely present in t, and b is a boolean indicating whether components of other cardinalities are any (if b is true) or empty (if b is false).

val of_components : (Comp.t list * bool) -> t
val get : int -> t -> Comp.t

get n t returns the tuple component of cardinality n in t.

val map : (Comp.t -> Comp.t) -> t -> t

map f t replaces every tuple component p in t by f p.

val construct : (bool * Comp.t list) -> t
val destruct : t -> bool * Comp.t list

destruct t returns a pair (b,cs) such that: if b is true, then t contains exactly the tuple components cs, and if b is false, then the negation of t contains exactly the tuple components cs.

val map_nodes : (Ty.t -> Ty.t) -> t -> t

map_nodes f t replaces every node n in t by the node f n.