Module AcyclicGraph.Make

Parameters

Signature

type t
val empty : t
val check_invariants : required_canonical:(Point.t -> bool) -> t -> unit
exception AlreadyDeclared
val add : ?⁠rank:int -> Point.t -> t -> t

All points must be pre-declared through this function before they can be mentioned in the others. NB: use a large rank to keep the node canonical

exception Undeclared of Point.t
val check_declared : t -> Point.Set.t -> unit
raises Undeclared

if one of the points is not present in the graph.

type 'a check_function = t -> 'a -> 'a -> bool
val check_eq : Point.t check_function
val check_leq : Point.t check_function
val check_lt : Point.t check_function
val enforce_eq : Point.t -> Point.t -> t -> t
val enforce_leq : Point.t -> Point.t -> t -> t
val enforce_lt : Point.t -> Point.t -> t -> t
val constraints_of : t -> Point.Constraints.t * Point.Set.t list
val constraints_for : kept:Point.Set.t -> t -> Point.Constraints.t
val domain : t -> Point.Set.t
val choose : (Point.t -> bool) -> t -> Point.t -> Point.t option
High-level representation
type node =
| Alias of Point.t
| Node of bool Point.Map.t

Nodes v s.t. u < v (true) or u <= v (false)

type repr = node Point.Map.t
val repr : t -> repr