type label = int type atom = int type const = Integer of Big_int.big_int | Atom of atom | Char of Chars.Unichar.t (** Algebra **) type node type descr val make: unit -> node val define: node -> descr -> unit val cons: descr -> node val internalize: node -> node val id: node -> int val descr: node -> descr val equal_descr: descr -> descr -> bool val hash_descr: descr -> int module DescrHash: Hashtbl.S with type key = descr (** Boolean connectives **) val cup : descr -> descr -> descr val cap : descr -> descr -> descr val diff : descr -> descr -> descr val neg : descr -> descr val empty : descr val any : descr (** Constructors **) val interval : Big_int.big_int -> Big_int.big_int -> descr val atom : atom -> descr val times : node -> node -> descr val arrow : node -> node -> descr val record : label -> bool -> node -> descr val char : Chars.Unichar.t -> descr val char_class : Chars.Unichar.t -> Chars.Unichar.t -> descr val constant : const -> descr (** Positive systems and least solutions **) module Positive : sig type v val forward: unit -> v val define: v -> v -> unit val ty: descr -> v val cup: v list -> v val times: v -> v -> v val solve: v -> node end (** Labels and atom names **) val mk_atom : string -> atom val atom_name : atom -> string val label : string -> label val label_name : label -> string (** Normalization **) module Product : sig val any : descr val other : descr -> descr val is_product : descr -> bool (* List of non-empty rectangles *) type t = (descr * descr) list val get: descr -> t val pi1: t -> descr val pi2: t -> descr (* Intersection with (pi1,Any) *) val restrict_1: t -> descr -> t (* List of non-empty rectangles whose first projection are pair-wise disjunct *) type normal = t val normal: descr -> t end module Record : sig val any : descr (* List of maps label -> (optional, content) *) type t = (label, (bool * descr)) SortedMap.t list val get: descr -> t val is_empty: t -> bool val restrict_label_present: t -> label -> t val restrict_field: t -> label -> descr -> t val restrict_label_absent: t -> label -> t val project_field: t -> label -> descr type normal = [ `Success | `Fail | `Label of label * (descr * normal) list * normal ] val normal: descr -> normal val project : descr -> label -> descr (* Raise Not_found if label is not necessarily present *) end module Arrow : sig val any : descr type t val get: descr -> t (* Always succeed; no check <= Arrow.any *) val domain: t -> descr val apply: t -> descr -> descr (* Always succeed; no check on the domain *) end module Int : sig val any : descr val is_int : descr -> bool val get: descr -> Intervals.t val put: Intervals.t -> descr end module Atom : sig val has_atom : descr -> atom -> bool end val normalize : node -> node (** Subtyping and sample values **) val is_empty : descr -> bool val non_empty: descr -> bool val subtype : descr -> descr -> bool module Sample : sig type t = | Int of Big_int.big_int | Atom of atom | Char of Chars.Unichar.t | Pair of t * t | Record of (label * t) list | Fun of (node * node) list val get : descr -> t (** Extract a sample value from a non empty type; raise Not_found for an empty type **) end module Print : sig val register_global : string -> descr -> unit val print : Format.formatter -> node -> unit val print_descr: Format.formatter -> descr -> unit val print_sample : Format.formatter -> Sample.t -> unit end val check: descr -> unit