Module AcyclicGraph.Make
Parameters
Signature
val add : ?rank:int -> Point.t -> t -> tAll points must be pre-declared through this function before they can be mentioned in the others. NB: use a large
rankto keep the node canonical
exceptionUndeclared 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_functionval check_leq : Point.t check_functionval check_lt : Point.t check_functionval enforce_eq : Point.t -> Point.t -> t -> t optionval enforce_leq : Point.t -> Point.t -> t -> t optionval enforce_lt : Point.t -> Point.t -> t -> t option
type explanation= Point.t * (constraint_type * Point.t) listType explanation is used to decorate error messages to provide a useful explanation why a given constraint is rejected. It is composed of a starting universe
u0and a path of universes and relation kinds(r1,u1);..;(rn,un)meaningu0 <(r1) u1 <(r2) ... <(rn) un(where<(ri)is the relation symbol denoted by ri). When the rejected constraint is aa <= bora < bthen the path is frombtoa, ieu0 == bandun == a. when the rejected constraint is an equality the path may go in either direction. Note that each step does not necessarily correspond to an actual constraint, but reflect how the system stores the graph and may result from combination of several Constraints.t...
val get_explanation : (Point.t * constraint_type * Point.t) -> t -> explanationAssuming that the corresponding call to
enforce_*returnedNone, this will give a trace for the failure.
type 'a constraint_fold= (Point.t * constraint_type * Point.t) -> 'a -> 'a
val constraints_of : t -> 'a constraint_fold -> 'a -> 'a * Point.Set.t listval constraints_for : kept:Point.Set.t -> t -> 'a constraint_fold -> 'a -> 'aval domain : t -> Point.Set.tval choose : (Point.t -> bool) -> t -> Point.t -> Point.t option
High-level representation
type node=|Alias of Point.t|Node of bool Point.Map.tNodes v s.t. u < v (true) or u <= v (false)
type repr= node Point.Map.t