Module Sstt.TagComp

Component for a type tagged with a particular tag.

type t

The type of types tagged with a particular fixed tag.

Basics

The minimal signature of a component.

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.

Explicit DNF, construction and extraction

val dnf : t -> Dnf.t

dnf t returns a disjunctive normal form of t.

val mk : Atom.t -> t

Creates a component from an atom.

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

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

Operations for indexed components

Operations on components that are indexed by a type, such as tuples (indexed by integers) or tagged types (indexed by a symbolic tag).

val any : Tag.t -> t

The top element for the given index.

val empty : Tag.t -> t

The bottom element for the given index.

val of_dnf : Tag.t -> Dnf.t -> t

of_dnf idx d builds a component for the given index and DNF.

val tag : t -> Tag.t

tag t returns the common tag of all the tagged-types in this component.

val as_atom : t -> Atom.t

as_atom t returns t as a pair of its tag and a plain type.